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
While working on further changes in the framework leveraging PathPattern, I've found the following behavior:
PathPatternParserparser = newPathPatternParser();
PathPatternp1 = parser.parse("/{foo}");
PathPatternp2 = parser.parse("/{foo}.*");
Map<String, String> r1 = p1.matchAndExtract("/file.txt");
Map<String, String> r2 = p2.matchAndExtract("/file.txt");
// works fineassertEquals(r1.get("foo"), "file.txt");
assertEquals(r2.get("foo"), "file");
// returns -1, thus considering that "/{foo}" is more specific than "/{foo}.*"assertThat(p1.compareTo(p2), Matchers.greaterThan(0));
Judging from our previous discussion, I'm wondering if this is now the expected behavior or if this is inconsistent with what's described in that comment.
By the way, when comparing "/{foo}" and "/{foo}.txt", "/{foo}.txt" is considered the most specific one.
I've made a minimal change to bring us in line with the AntPathMatcher behavior - PathPattern comparison now produces the expected result for Brians testcase. I've raised #20177 to look at improving things in future.
Brian Clozel opened SPR-15597 and commented
Hi Andy Clement,
While working on further changes in the framework leveraging
PathPattern
, I've found the following behavior:Judging from our previous discussion, I'm wondering if this is now the expected behavior or if this is inconsistent with what's described in that comment.
By the way, when comparing
"/{foo}"
and"/{foo}.txt"
,"/{foo}.txt"
is considered the most specific one.Thanks,
Affects: 5.0 RC1
Referenced from: commits 77576ed
The text was updated successfully, but these errors were encountered: