Dedicated specificity comparator in PathPattern
The PathPattern compareTo method is now consistent with equals when two patterns are of the same specificity but otherwise different. Separately PathPattern now exposes a Comparator by specificity that offers the current functionality of compareTo. This can be used for actual sorting where we only care about specificity.
This commit is contained in:
@@ -387,7 +387,7 @@ public class PathPatternParserTests {
|
||||
// Based purely on catchAll
|
||||
p1 = parse("{*foobar}");
|
||||
p2 = parse("{*goo}");
|
||||
assertEquals(0, p1.compareTo(p2));
|
||||
assertTrue(p1.compareTo(p2) != 0);
|
||||
|
||||
p1 = parse("/{*foobar}");
|
||||
p2 = parse("/abc/{*ww}");
|
||||
|
||||
Reference in New Issue
Block a user