@@ -112,9 +112,6 @@ public class PathPattern implements Comparable<PathPattern> {
112
112
/** The options to use to parse a pattern. */
113
113
private final PathContainer .Options pathOptions ;
114
114
115
- /** If this pattern has no trailing slash, allow candidates to include one and still match successfully. */
116
- private final boolean matchOptionalTrailingSeparator ;
117
-
118
115
/** Will this match candidates in a case-sensitive way? (case sensitivity at parse time). */
119
116
private final boolean caseSensitive ;
120
117
@@ -152,12 +149,10 @@ public class PathPattern implements Comparable<PathPattern> {
152
149
private boolean catchAll = false ;
153
150
154
151
155
- @ SuppressWarnings ("deprecation" )
156
152
PathPattern (String patternText , PathPatternParser parser , @ Nullable PathElement head ) {
157
153
this .patternString = patternText ;
158
154
this .parser = parser ;
159
155
this .pathOptions = parser .getPathOptions ();
160
- this .matchOptionalTrailingSeparator = parser .isMatchOptionalTrailingSeparator ();
161
156
this .caseSensitive = parser .isCaseSensitive ();
162
157
this .head = head ;
163
158
@@ -202,8 +197,7 @@ public boolean hasPatternSyntax() {
202
197
*/
203
198
public boolean matches (PathContainer pathContainer ) {
204
199
if (this .head == null ) {
205
- return !hasLength (pathContainer ) ||
206
- (this .matchOptionalTrailingSeparator && pathContainerIsJustSeparator (pathContainer ));
200
+ return !hasLength (pathContainer );
207
201
}
208
202
else if (!hasLength (pathContainer )) {
209
203
if (this .head instanceof WildcardTheRestPathElement || this .head instanceof CaptureTheRestPathElement ) {
@@ -226,9 +220,7 @@ else if (!hasLength(pathContainer)) {
226
220
@ Nullable
227
221
public PathMatchInfo matchAndExtract (PathContainer pathContainer ) {
228
222
if (this .head == null ) {
229
- return (hasLength (pathContainer ) &&
230
- !(this .matchOptionalTrailingSeparator && pathContainerIsJustSeparator (pathContainer )) ?
231
- null : PathMatchInfo .EMPTY );
223
+ return (hasLength (pathContainer ) && !pathContainerIsJustSeparator (pathContainer ) ? null : PathMatchInfo .EMPTY );
232
224
}
233
225
else if (!hasLength (pathContainer )) {
234
226
if (this .head instanceof WildcardTheRestPathElement || this .head instanceof CaptureTheRestPathElement ) {
@@ -647,7 +639,7 @@ public Map<String, MultiValueMap<String, String>> getMatrixVariables() {
647
639
* candidate currently being considered for a match but also some accumulators for
648
640
* extracted variables.
649
641
*/
650
- class MatchingContext {
642
+ static class MatchingContext {
651
643
652
644
final PathContainer candidate ;
653
645
@@ -681,10 +673,6 @@ public void setMatchAllowExtraPath() {
681
673
this .determineRemainingPath = true ;
682
674
}
683
675
684
- public boolean isMatchOptionalTrailingSeparator () {
685
- return matchOptionalTrailingSeparator ;
686
- }
687
-
688
676
public void set (String key , String value , MultiValueMap <String ,String > parameters ) {
689
677
if (this .extractedUriVariables == null ) {
690
678
this .extractedUriVariables = new HashMap <>();
0 commit comments