You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Situation
I've had the situation that a @Controller was defined with @RequestMapping("/*") to manage all request for that Dispatcher (that already defined urlPatterns="/main/something/*" to distinguish from other dispatcher).
Now, when the Dispatcher was initializing it was throwing StringIndexOutOfBoundsException for a method in that Controller with a @GetMapping(value = "/x/{val}") mapping defined.
Workaround
Currently I've solved it by defining the @Controller with a @RequestMapping(/**) for matching multiple path segments (as I assume it's intended).
Enhancement
I am unsure whether it's
an enhancement request for a better exception OR
a bug in combine when instead of endsWithSeparatorWildcard it's equal to the wildcard
changed the title [-]`PathPattern.combine(PathPattern)` throws `StringIndexOutOfBoundsException`[/-][+]PathPattern#combine throws StringIndexOutOfBoundsException[/+]on Jun 3, 2025
So PathPattern.combine is expecting a pattern ending with /** but doesn't handle /* properly which causes the StringIndexOutOfBoundsException - which is a runtime exception.
Hence, possibly a bug as it crashs when combining /* and /x/y.
Activity
[-]`PathPattern.combine(PathPattern)` throws `StringIndexOutOfBoundsException`[/-][+]PathPattern#combine throws StringIndexOutOfBoundsException[/+]DhruvTheDev1 commentedon Jun 3, 2025
So PathPattern.combine is expecting a pattern ending with /** but doesn't handle /* properly which causes the StringIndexOutOfBoundsException - which is a runtime exception.
Hence, possibly a bug as it crashs when combining /* and /x/y.
Fix out of bounds exception for PathPattern#combine