File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
main/java/org/springframework/util
test/java/org/springframework/util Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -776,7 +776,10 @@ else if (pattern2EqualsPath) {
776
776
return 1 ;
777
777
}
778
778
779
- if (info1 .isPrefixPattern () && info2 .getDoubleWildcards () == 0 ) {
779
+ if (info1 .isPrefixPattern () && info2 .isPrefixPattern ()) {
780
+ return info2 .getLength () - info1 .getLength ();
781
+ }
782
+ else if (info1 .isPrefixPattern () && info2 .getDoubleWildcards () == 0 ) {
780
783
return 1 ;
781
784
}
782
785
else if (info2 .isPrefixPattern () && info1 .getDoubleWildcards () == 0 ) {
Original file line number Diff line number Diff line change @@ -481,8 +481,9 @@ public void patternComparator() {
481
481
assertThat (comparator .compare ("/hotels/**" , "/hotels/{hotel}/bookings/{booking}/cutomers/{customer}" )).isEqualTo (1 );
482
482
assertThat (comparator .compare ("/hotels/foo/bar/**" , "/hotels/{hotel}" )).isEqualTo (1 );
483
483
assertThat (comparator .compare ("/hotels/{hotel}" , "/hotels/foo/bar/**" )).isEqualTo (-1 );
484
- assertThat (comparator .compare ("/hotels/**/bookings/**" , "/hotels/**" )).isEqualTo (2 );
485
- assertThat (comparator .compare ("/hotels/**" , "/hotels/**/bookings/**" )).isEqualTo (-2 );
484
+
485
+ // gh-23125
486
+ assertThat (comparator .compare ("/hotels/*/bookings/**" , "/hotels/**" )).isEqualTo (-11 );
486
487
487
488
// SPR-8683
488
489
assertThat (comparator .compare ("/**" , "/hotels/{hotel}" )).isEqualTo (1 );
You can’t perform that action at this time.
0 commit comments