Skip to content

Commit 3956423

Browse files
committed
Polish
The high level matchStarting API was removed a few commits ago. This change tidies up by removing the supporting infrastructure for that from the PathElements.
1 parent a8693bf commit 3956423

File tree

7 files changed

+1
-25
lines changed

7 files changed

+1
-25
lines changed

spring-web/src/main/java/org/springframework/web/util/pattern/CaptureVariablePathElement.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,7 @@ public boolean matches(int pathIndex, PathPattern.MatchingContext matchingContex
111111
}
112112
}
113113
else {
114-
if (matchingContext.isMatchStartMatching && pathIndex == matchingContext.pathLength) {
115-
match = true; // no more data but matches up to this point
116-
}
117-
else if (this.next != null) {
114+
if (this.next != null) {
118115
match = this.next.matches(pathIndex, matchingContext);
119116
}
120117
}

spring-web/src/main/java/org/springframework/web/util/pattern/LiteralPathElement.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,6 @@ public boolean matches(int pathIndex, MatchingContext matchingContext) {
104104
}
105105
}
106106
else {
107-
if (matchingContext.isMatchStartMatching && pathIndex == matchingContext.pathLength) {
108-
return true; // no more data but everything matched so far
109-
}
110107
return (this.next != null && this.next.matches(pathIndex, matchingContext));
111108
}
112109
}

spring-web/src/main/java/org/springframework/web/util/pattern/PathPattern.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,6 @@ class MatchingContext {
581581

582582
final int pathLength;
583583

584-
boolean isMatchStartMatching = false;
585-
586584
@Nullable
587585
private Map<String, String> extractedUriVariables;
588586

@@ -613,10 +611,6 @@ public boolean isMatchOptionalTrailingSeparator() {
613611
return matchOptionalTrailingSeparator;
614612
}
615613

616-
public void setMatchStartMatching(boolean b) {
617-
isMatchStartMatching = b;
618-
}
619-
620614
public void set(String key, String value, MultiValueMap<String,String> parameters) {
621615
if (this.extractedUriVariables == null) {
622616
this.extractedUriVariables = new HashMap<>();

spring-web/src/main/java/org/springframework/web/util/pattern/RegexPathElement.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@ public boolean matches(int pathIndex, MatchingContext matchingContext) {
153153
}
154154
}
155155
else {
156-
if (matchingContext.isMatchStartMatching && (pathIndex + 1 >= matchingContext.pathLength)) {
157-
return true; // no more data but matches up to this point
158-
}
159156
matches = (this.next != null && this.next.matches(pathIndex + 1, matchingContext));
160157
}
161158
}

spring-web/src/main/java/org/springframework/web/util/pattern/SeparatorPathElement.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ public boolean matches(int pathIndex, MatchingContext matchingContext) {
5151
}
5252
else {
5353
pathIndex++;
54-
if (matchingContext.isMatchStartMatching && pathIndex == matchingContext.pathLength) {
55-
return true; // no more data but matches up to this point
56-
}
5754
return (this.next != null && this.next.matches(pathIndex, matchingContext));
5855
}
5956
}

spring-web/src/main/java/org/springframework/web/util/pattern/SingleCharWildcardedPathElement.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,6 @@ public boolean matches(int pathIndex, MatchingContext matchingContext) {
111111
}
112112
}
113113
else {
114-
if (matchingContext.isMatchStartMatching && pathIndex == matchingContext.pathLength) {
115-
return true; // no more data but everything matched so far
116-
}
117114
return (this.next != null && this.next.matches(pathIndex, matchingContext));
118115
}
119116
}

spring-web/src/main/java/org/springframework/web/util/pattern/WildcardPathElement.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ public boolean matches(int pathIndex, MatchingContext matchingContext) {
7373
}
7474
}
7575
else {
76-
if (matchingContext.isMatchStartMatching && pathIndex == matchingContext.pathLength) {
77-
return true; // no more data but matches up to this point
78-
}
7976
// Within a path (e.g. /aa/*/bb) there must be at least one character to match the wildcard
8077
if (segmentData == null || segmentData.length() == 0) {
8178
return false;

0 commit comments

Comments
 (0)