Use String#isEmpty where feasible
This commit replaces checks for empty strings ("".equals(...)) with the String#isEmpty method. Closes gh-32377
This commit is contained in:
parent
30e75e4a09
commit
eb01cc0d9d
|
@ -653,14 +653,14 @@ public class EmitUtils {
|
|||
e.dup();
|
||||
e.ifnull(skip);
|
||||
e.swap();
|
||||
if (delims != null && delims.before != null && !"".equals(delims.before)) {
|
||||
if (delims != null && delims.before != null && !delims.before.isEmpty()) {
|
||||
e.push(delims.before);
|
||||
e.invoke_virtual(Constants.TYPE_STRING_BUFFER, APPEND_STRING);
|
||||
e.swap();
|
||||
}
|
||||
EmitUtils.process_array(e, type, callback);
|
||||
shrinkStringBuffer(e, 2);
|
||||
if (delims != null && delims.after != null && !"".equals(delims.after)) {
|
||||
if (delims != null && delims.after != null && !delims.after.isEmpty()) {
|
||||
e.push(delims.after);
|
||||
e.invoke_virtual(Constants.TYPE_STRING_BUFFER, APPEND_STRING);
|
||||
}
|
||||
|
|
|
@ -230,7 +230,7 @@ public class TypeUtils {
|
|||
}
|
||||
|
||||
private static String map(String type) {
|
||||
if (type.equals("")) {
|
||||
if (type.isEmpty()) {
|
||||
return type;
|
||||
}
|
||||
String t = (String)transforms.get(type);
|
||||
|
|
|
@ -877,7 +877,7 @@ public abstract class StringUtils {
|
|||
@SuppressWarnings("deprecation") // for Locale constructors on JDK 19
|
||||
@Nullable
|
||||
public static Locale parseLocaleString(String localeString) {
|
||||
if (localeString.equals("")) {
|
||||
if (localeString.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue