Browse Source

Simplify some control flow code

Closes gh-24925
pull/24926/head
Deycoesr 6 years ago committed by GitHub
parent
commit
87f28ce48e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      spring-web/src/main/java/org/springframework/web/bind/support/WebRequestDataBinder.java
  2. 2
      spring-web/src/main/java/org/springframework/web/util/pattern/RegexPathElement.java

2
spring-web/src/main/java/org/springframework/web/bind/support/WebRequestDataBinder.java

@ -130,7 +130,7 @@ public class WebRequestDataBinder extends WebDataBinder { @@ -130,7 +130,7 @@ public class WebRequestDataBinder extends WebDataBinder {
*/
private boolean isMultipartRequest(WebRequest request) {
String contentType = request.getHeader("Content-Type");
return (contentType != null && StringUtils.startsWithIgnoreCase(contentType, "multipart"));
return StringUtils.startsWithIgnoreCase(contentType, "multipart");
}
private void bindParts(HttpServletRequest request, MutablePropertyValues mpvs) {

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

@ -136,7 +136,7 @@ class RegexPathElement extends PathElement { @@ -136,7 +136,7 @@ class RegexPathElement extends PathElement {
if (matches) {
if (isNoMorePattern()) {
if (matchingContext.determineRemainingPath &&
(this.variableNames.isEmpty() ? true : textToMatch.length() > 0)) {
(this.variableNames.isEmpty() || textToMatch.length() > 0)) {
matchingContext.remainingPathIndex = pathIndex + 1;
matches = true;
}

Loading…
Cancel
Save