Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed May 14, 2024
1 parent ee3e159 commit 4caf6bc
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ public static Locale parseLocale(String localeValue) {
if (!localeValue.contains("_") && !localeValue.contains(" ")) {
validateLocalePart(localeValue);
Locale resolved = Locale.forLanguageTag(localeValue);
if (resolved.getLanguage().length() > 0) {
if (!resolved.getLanguage().isEmpty()) {
return resolved;
}
}
Expand Down Expand Up @@ -1182,7 +1182,7 @@ public static String[] tokenizeToStringArray(
if (trimTokens) {
token = token.trim();
}
if (!ignoreEmptyTokens || token.length() > 0) {
if (!ignoreEmptyTokens || !token.isEmpty()) {
tokens.add(token);
}
}
Expand Down Expand Up @@ -1244,7 +1244,7 @@ public static String[] delimitedListToStringArray(
result.add(deleteAny(str.substring(pos, delPos), charsToDelete));
pos = delPos + delimiter.length();
}
if (str.length() > 0 && pos <= str.length()) {
if (!str.isEmpty() && pos <= str.length()) {
// Add rest of String, but not in case of empty input.
result.add(deleteAny(str.substring(pos), charsToDelete));
}
Expand Down

0 comments on commit 4caf6bc

Please sign in to comment.