Skip to content

Commit 87f28ce

Browse files
authored
Simplify some control flow code
Closes gh-24925
1 parent b8835c9 commit 87f28ce

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public void bind(WebRequest request) {
130130
*/
131131
private boolean isMultipartRequest(WebRequest request) {
132132
String contentType = request.getHeader("Content-Type");
133-
return (contentType != null && StringUtils.startsWithIgnoreCase(contentType, "multipart"));
133+
return StringUtils.startsWithIgnoreCase(contentType, "multipart");
134134
}
135135

136136
private void bindParts(HttpServletRequest request, MutablePropertyValues mpvs) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public boolean matches(int pathIndex, MatchingContext matchingContext) {
136136
if (matches) {
137137
if (isNoMorePattern()) {
138138
if (matchingContext.determineRemainingPath &&
139-
(this.variableNames.isEmpty() ? true : textToMatch.length() > 0)) {
139+
(this.variableNames.isEmpty() || textToMatch.length() > 0)) {
140140
matchingContext.remainingPathIndex = pathIndex + 1;
141141
matches = true;
142142
}

0 commit comments

Comments
 (0)