< prev index next >

src/java.base/share/classes/sun/security/provider/PolicyParser.java

Print this page
rev 52979 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: TBD

@@ -389,13 +389,13 @@
      */
     private void writeKeyStoreEntry(PrintWriter out) {
         out.print("keystore \"");
         out.print(keyStoreUrlString);
         out.print('"');
-        if (keyStoreType != null && keyStoreType.length() > 0)
+        if (keyStoreType != null && !keyStoreType.isEmpty())
             out.print(", \"" + keyStoreType + "\"");
-        if (keyStoreProvider != null && keyStoreProvider.length() > 0)
+        if (keyStoreProvider != null && !keyStoreProvider.isEmpty())
             out.print(", \"" + keyStoreProvider + "\"");
         out.println(";");
         out.println();
     }
 

@@ -444,11 +444,11 @@
                 int cctr = 0;
                 while (aliases.hasMoreTokens()) {
                     String alias = aliases.nextToken().trim();
                     if (alias.equals(","))
                         cctr++;
-                    else if (alias.length() > 0)
+                    else if (!alias.isEmpty())
                         actr++;
                 }
                 if (actr <= cctr)
                     throw new ParsingException(
                             st.lineno(),
< prev index next >