Skip to content

Commit 4caf6bc

Browse files
committed
Polishing
1 parent ee3e159 commit 4caf6bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spring-core/src/main/java/org/springframework/util/StringUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ public static Locale parseLocale(String localeValue) {
853853
if (!localeValue.contains("_") && !localeValue.contains(" ")) {
854854
validateLocalePart(localeValue);
855855
Locale resolved = Locale.forLanguageTag(localeValue);
856-
if (resolved.getLanguage().length() > 0) {
856+
if (!resolved.getLanguage().isEmpty()) {
857857
return resolved;
858858
}
859859
}
@@ -1182,7 +1182,7 @@ public static String[] tokenizeToStringArray(
11821182
if (trimTokens) {
11831183
token = token.trim();
11841184
}
1185-
if (!ignoreEmptyTokens || token.length() > 0) {
1185+
if (!ignoreEmptyTokens || !token.isEmpty()) {
11861186
tokens.add(token);
11871187
}
11881188
}
@@ -1244,7 +1244,7 @@ public static String[] delimitedListToStringArray(
12441244
result.add(deleteAny(str.substring(pos, delPos), charsToDelete));
12451245
pos = delPos + delimiter.length();
12461246
}
1247-
if (str.length() > 0 && pos <= str.length()) {
1247+
if (!str.isEmpty() && pos <= str.length()) {
12481248
// Add rest of String, but not in case of empty input.
12491249
result.add(deleteAny(str.substring(pos), charsToDelete));
12501250
}

0 commit comments

Comments
 (0)