-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
William Butler opened SPR-5069 and commented
This bug is related to the fix for #9228.
There is still an issue related to the following method (in AnnotationMethodHandlerAdapter.java):
[CODE]
private boolean isBetterPathMatch(String mappedPath, String mappedPathToCompare, String lookupPath) {
return (mappedPath != null && (mappedPathToCompare == null ||
mappedPath.equals(lookupPath) || mappedPathToCompare.length() < mappedPath.length()));
}
[/CODE]
If multiple methods are annotated with the same path value, one can be considered "better" than another based on the fact that the mappedPath equals lookupPath. There is no check to see if the mappedPathToCompare is also equal to the lookupPath. The code should probably be changed to something like:
[CODE]
private boolean isBetterPathMatch(String mappedPath, String mappedPathToCompare, String lookupPath) {
return (mappedPath != null && (mappedPathToCompare == null ||
mappedPath.equals(lookupPath) && !mappedPathToCompare.equals(lookupPath) || mappedPathToCompare.length() < mappedPath.length()));
}
[/CODE]
Affects: 2.5.3, 2.5.4, 2.5.5
Issue Links:
- @RequestMapping method resolution is not deterministic [SPR-4551] #9228
@RequestMapping
method resolution is not deterministic