@@ -168,6 +168,7 @@ protected String getToStringInfix() {
168
168
* <li>If neither instance has patterns, use an empty String (i.e. "").
169
169
* </ul>
170
170
*/
171
+ @ Override
171
172
public PatternsRequestCondition combine (PatternsRequestCondition other ) {
172
173
Set <String > result = new LinkedHashSet <String >();
173
174
if (!this .patterns .isEmpty () && !other .patterns .isEmpty ()) {
@@ -209,6 +210,7 @@ else if (!other.patterns.isEmpty()) {
209
210
* or a new condition with sorted matching patterns;
210
211
* or {@code null} if no patterns match.
211
212
*/
213
+ @ Override
212
214
public PatternsRequestCondition getMatchingCondition (HttpServletRequest request ) {
213
215
if (this .patterns .isEmpty ()) {
214
216
return this ;
@@ -256,9 +258,8 @@ private String getMatchingPattern(String pattern, String lookupPath) {
256
258
if (this .pathMatcher .match (pattern , lookupPath )) {
257
259
return pattern ;
258
260
}
259
- boolean endsWithSlash = pattern .endsWith ("/" );
260
261
if (this .useTrailingSlashMatch ) {
261
- if (!endsWithSlash && this .pathMatcher .match (pattern + "/" , lookupPath )) {
262
+ if (!pattern . endsWith ( "/" ) && this .pathMatcher .match (pattern + "/" , lookupPath )) {
262
263
return pattern +"/" ;
263
264
}
264
265
}
@@ -277,6 +278,7 @@ private String getMatchingPattern(String pattern, String lookupPath) {
277
278
* contain only patterns that match the request and are sorted with
278
279
* the best matches on top.
279
280
*/
281
+ @ Override
280
282
public int compareTo (PatternsRequestCondition other , HttpServletRequest request ) {
281
283
String lookupPath = this .pathHelper .getLookupPathForRequest (request );
282
284
Comparator <String > patternComparator = this .pathMatcher .getPatternComparator (lookupPath );
0 commit comments