Skip to content
This repository has been archived by the owner on Dec 12, 2018. It is now read-only.

#1164 Added Mapping Conflict Check to Spring WebMvc Configuration #1165

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

andersonkyle
Copy link

This PR fixes #1164 by adding a method that checks whether any Mappings defined by the User conflict with those that Stormpath wants to create. If a conflict is found, an IllegalStateException is thrown which adheres to the standard Spring behavior.

/**
* Fix for https://github.com/stormpath/stormpath-sdk-java/issues/1164
*
* @since 1.2.3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please change this to 1.3.0?

*
* @since 1.2.3
*/
private <T extends AbstractController> void assertUniqueMethodMapping(T c) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reformat with IntelliJ's default settings (e.g. space after for, space after if, before brace, etc). Thanks!

throw new IllegalStateException("Mapping conflict. Stormpath cannot map '" + c.getUri() + "'. " +
"There is already '" + handlerMethod.getBean() +
"' bean method\n" + handlerMethod + " mapped.");
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change this to read: `Mapping confict: Stormpath cannot map '" + c.getUri() + "'. " + handlerMethod.getBean() + "#" + handlerMethod + " is already mapped to this URI."

@andersonkyle
Copy link
Author

@mraible The changes you've requested are done. Thanks.

@mraible
Copy link
Contributor

mraible commented Jan 4, 2017

@kanderson450 Cool - thanks! LGTM 👍

Will merge after CI passes.

@mrioan mrioan changed the base branch from 1.2.x to master February 3, 2017 15:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants