|
|
|
|
@ -123,7 +123,7 @@ public abstract class StringUtils {
@@ -123,7 +123,7 @@ public abstract class StringUtils {
|
|
|
|
|
* @see #hasText(CharSequence) |
|
|
|
|
*/ |
|
|
|
|
public static boolean hasLength(@Nullable CharSequence str) { |
|
|
|
|
return (str != null && str.length() > 0); |
|
|
|
|
return (str != null && !str.isEmpty()); // as of JDK 15
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -853,7 +853,7 @@ public abstract class StringUtils {
@@ -853,7 +853,7 @@ public abstract class StringUtils {
|
|
|
|
|
if (!localeValue.contains("_") && !localeValue.contains(" ")) { |
|
|
|
|
validateLocalePart(localeValue); |
|
|
|
|
Locale resolved = Locale.forLanguageTag(localeValue); |
|
|
|
|
if (resolved.getLanguage().length() > 0) { |
|
|
|
|
if (!resolved.getLanguage().isEmpty()) { |
|
|
|
|
return resolved; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -1182,7 +1182,7 @@ public abstract class StringUtils {
@@ -1182,7 +1182,7 @@ public abstract class StringUtils {
|
|
|
|
|
if (trimTokens) { |
|
|
|
|
token = token.trim(); |
|
|
|
|
} |
|
|
|
|
if (!ignoreEmptyTokens || token.length() > 0) { |
|
|
|
|
if (!ignoreEmptyTokens || !token.isEmpty()) { |
|
|
|
|
tokens.add(token); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -1244,7 +1244,7 @@ public abstract class StringUtils {
@@ -1244,7 +1244,7 @@ public abstract class StringUtils {
|
|
|
|
|
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)); |
|
|
|
|
} |
|
|
|
|
|