< prev index next >

src/java.base/share/classes/sun/security/x509/RDN.java

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

@@ -119,11 +119,11 @@
                 && quoteCount != 1) {
                 /*
                  * Plus sign is a separator
                  */
                 String avaString = name.substring(avaOffset, nextPlus);
-                if (avaString.length() == 0) {
+                if (avaString.isEmpty()) {
                     throw new IOException("empty AVA in RDN \"" + name + "\"");
                 }
 
                 // Parse AVA, and store it in vector
                 AVA ava = new AVA(new StringReader(avaString), keywordMap);

@@ -139,11 +139,11 @@
             nextPlus = name.indexOf('+', searchOffset);
         }
 
         // parse last or only AVA
         String avaString = name.substring(avaOffset);
-        if (avaString.length() == 0) {
+        if (avaString.isEmpty()) {
             throw new IOException("empty AVA in RDN \"" + name + "\"");
         }
         AVA ava = new AVA(new StringReader(avaString), keywordMap);
         avaVec.add(ava);
 

@@ -197,11 +197,11 @@
             if (nextPlus > 0 && name.charAt(nextPlus - 1) != '\\' ) {
                 /*
                  * Plus sign is a separator
                  */
                 String avaString = name.substring(avaOffset, nextPlus);
-                if (avaString.length() == 0) {
+                if (avaString.isEmpty()) {
                     throw new IOException("empty AVA in RDN \"" + name + "\"");
                 }
 
                 // Parse AVA, and store it in vector
                 AVA ava = new AVA

@@ -215,11 +215,11 @@
             nextPlus = name.indexOf('+', searchOffset);
         }
 
         // parse last or only AVA
         String avaString = name.substring(avaOffset);
-        if (avaString.length() == 0) {
+        if (avaString.isEmpty()) {
             throw new IOException("empty AVA in RDN \"" + name + "\"");
         }
         AVA ava = new AVA(new StringReader(avaString), AVA.RFC2253, keywordMap);
         avaVec.add(ava);
 
< prev index next >