Skip to content

Commit 82a99ad

Browse files
polish
1 parent c6fa180 commit 82a99ad

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

spring-core/src/main/java/org/springframework/asm/TypePath.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public int getStepArgument(final int index) {
117117
* @return the corresponding TypePath object, or {@literal null} if the path is empty.
118118
*/
119119
public static TypePath fromString(final String typePath) {
120-
if (typePath == null || typePath.length() == 0) {
120+
if (typePath == null || typePath.isEmpty()) {
121121
return null;
122122
}
123123
int typePathLength = typePath.length();

spring-core/src/main/java/org/springframework/cglib/core/TypeUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public static String getPackageName(String className) {
9797
}
9898

9999
public static String upperFirst(String s) {
100-
if (s == null || s.length() == 0) {
100+
if (s == null || s.isEmpty()) {
101101
return s;
102102
}
103103
return Character.toUpperCase(s.charAt(0)) + s.substring(1);

spring-r2dbc/src/main/java/org/springframework/r2dbc/core/binding/BindMarkersFactoryResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private static String filterBindMarker(CharSequence input) {
153153
builder.append(ch);
154154
}
155155
}
156-
if (builder.length() == 0) {
156+
if (builder.isEmpty()) {
157157
return "";
158158
}
159159
return "_" + builder.toString();

spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ public void append(String path) {
877877
@Override
878878
@Nullable
879879
public PathComponent build() {
880-
if (this.path.length() == 0) {
880+
if (this.path.isEmpty()) {
881881
return null;
882882
}
883883
String sanitized = getSanitizedPath(this.path);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public boolean matches(int pathIndex, PathPattern.MatchingContext matchingContex
7373
return false;
7474
}
7575
String candidateCapture = matchingContext.pathElementValue(pathIndex);
76-
if (candidateCapture.length() == 0) {
76+
if (candidateCapture.isEmpty()) {
7777
return false;
7878
}
7979

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ public boolean matches(int pathIndex, MatchingContext matchingContext) {
6666
}
6767
else {
6868
return (matchingContext.isMatchOptionalTrailingSeparator() && // if optional slash is on...
69-
segmentData != null && segmentData.length() > 0 && // and there is at least one character to match the *...
69+
segmentData != null && !segmentData.isEmpty() && // and there is at least one character to match the *...
7070
(pathIndex + 1) == matchingContext.pathLength && // and the next path element is the end of the candidate...
7171
matchingContext.isSeparator(pathIndex)); // and the final element is a separator
7272
}
7373
}
7474
}
7575
else {
7676
// Within a path (e.g. /aa/*/bb) there must be at least one character to match the wildcard
77-
if (segmentData == null || segmentData.length() == 0) {
77+
if (segmentData == null || segmentData.isEmpty()) {
7878
return false;
7979
}
8080
return (this.next != null && this.next.matches(pathIndex, matchingContext));

spring-webmvc/src/main/java/org/springframework/web/servlet/tags/UrlTag.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ protected String createQueryString(List<Param> params, Set<String> usedParams, b
323323
StringBuilder qs = new StringBuilder();
324324
for (Param param : params) {
325325
if (!usedParams.contains(param.getName()) && StringUtils.hasLength(param.getName())) {
326-
if (includeQueryStringDelimiter && qs.length() == 0) {
326+
if (includeQueryStringDelimiter && qs.isEmpty()) {
327327
qs.append('?');
328328
}
329329
else {

0 commit comments

Comments
 (0)