diff options
author | Andrej Shadura <andrew.shadura@collabora.co.uk> | 2019-03-09 12:38:16 +0000 |
---|---|---|
committer | Andrej Shadura <andrew.shadura@collabora.co.uk> | 2019-03-09 12:38:16 +0000 |
commit | 673684ec2c6cac26840588b958de098f0c54dd53 (patch) | |
tree | c59a0c2767a9ccfa80ca84b30e33d7e39ab1cbcc /spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/PatternsRequestCondition.java | |
parent | f0e4dab77c149a3dd88691ae95b448a5a7819a32 (diff) | |
parent | 139a199c595da36850738b73ee65310ed0a4a94d (diff) |
Update upstream source from tag 'upstream/4.3.23_git20190308'
Update to upstream version '4.3.23~git20190308'
with Debian dir 6d5a5b12f9bb323cd3b6fb67329b6f998e2ff19a
Diffstat (limited to 'spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/PatternsRequestCondition.java')
-rw-r--r-- | spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/PatternsRequestCondition.java | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/PatternsRequestCondition.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/PatternsRequestCondition.java index 43f5b496..d800d0c9 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/PatternsRequestCondition.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/condition/PatternsRequestCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -179,8 +179,8 @@ public final class PatternsRequestCondition extends AbstractRequestCondition<Pat else { result.add(""); } - return new PatternsRequestCondition(result, this.pathHelper, this.pathMatcher, this.useSuffixPatternMatch, - this.useTrailingSlashMatch, this.fileExtensions); + return new PatternsRequestCondition(result, this.pathHelper, this.pathMatcher, + this.useSuffixPatternMatch, this.useTrailingSlashMatch, this.fileExtensions); } /** @@ -201,17 +201,14 @@ public final class PatternsRequestCondition extends AbstractRequestCondition<Pat */ @Override public PatternsRequestCondition getMatchingCondition(HttpServletRequest request) { - if (this.patterns.isEmpty()) { return this; } - String lookupPath = this.pathHelper.getLookupPathForRequest(request); List<String> matches = getMatchingPatterns(lookupPath); - - return matches.isEmpty() ? null : - new PatternsRequestCondition(matches, this.pathHelper, this.pathMatcher, this.useSuffixPatternMatch, - this.useTrailingSlashMatch, this.fileExtensions); + return (!matches.isEmpty() ? + new PatternsRequestCondition(matches, this.pathHelper, this.pathMatcher, + this.useSuffixPatternMatch, this.useTrailingSlashMatch, this.fileExtensions) : null); } /** @@ -259,7 +256,7 @@ public final class PatternsRequestCondition extends AbstractRequestCondition<Pat } if (this.useTrailingSlashMatch) { if (!pattern.endsWith("/") && this.pathMatcher.match(pattern + "/", lookupPath)) { - return pattern +"/"; + return pattern + "/"; } } return null; |