I am not sure how important this clean up is but since you've done it ..

replacing "".equals(foo) wth foo.isEmpty(()
isn't equivalent but the cases I saw where you did are either
foo == null || [!]foo.isEmpty()
eg :
-        if (fontName == null || "".equals(fontName)) {
+        if (fontName == null || fontName.isEmpty()) {
or
foo != null && [!]foo.isEmpty()

eg:
-        if(text != null && !text.equals("")) {
+        if(text != null && !text.isEmpty()) {

so these should be fine. Although for the line above since
you are touching it I'd like "if(" turned into "if ("

Here's another one

-                            if(!keyword.equals("")&&  !value.equals("")) {
+                            if(!keyword.isEmpty()&&  !value.isEmpty()) {


With those updates,  +1

-phil

On 5/2/19, 5:01 AM, Sergey Bylokhov wrote:
Hello.
Please review the fix for JDK 13.

Bug: https://bugs.openjdk.java.net/browse/JDK-8223237
Fix: http://cr.openjdk.java.net/~serb/8223237/webrev.00

This change is an equivalent of JDK-8214971[1] but for the java.desktop module.
 - The string.equals("") replaced by the string.isEmpty() in all cases
- The "".equals(string) replaced by the string.isEmpty() when string is non-null
[1] https://bugs.openjdk.java.net/browse/JDK-8214971


In one case I dropped string.equals("") as unneeded:
http://cr.openjdk.java.net/~serb/8223237/webrev.00/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java.udiff.html

Reply via email to