Use String#isEmpty where possible (#7690)

This commit is contained in:
Benoit Lacelle authored and GitHub committed 2023-04-08 08:04:47 -07:00
1 parent ff654d142e
commit c48728d0f4
40 files changed
+59 -59

No files matched your search

+2 -2
View File
@@ -1110,7 +1110,7 @@ public class Util {
*/
@CheckForNull
public static String fixEmpty(@CheckForNull String s) {
if (s == null || s.length() == 0) return null;
if (s == null || s.isEmpty()) return null;
return s;
}
@@ -1487,7 +1487,7 @@ public class Util {
*/
@CheckForNull
public static Number tryParseNumber(@CheckForNull String numberStr, @CheckForNull Number defaultNumber) {
if (numberStr == null || numberStr.length() == 0) {
if (numberStr == null || numberStr.isEmpty()) {
return defaultNumber;
}
try {