< prev index next >

src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsContext.java

Print this page
rev 52881 : 8214971: Replace use of string.equals("") with isEmpty()
Reviewed-by: jlaskey, prappo, lancea, dfuchs, redestad

@@ -535,12 +535,12 @@
             ? name
             : new CompositeName().add(name.toString());
         int prefixLast = prefixC.size() - 1;
 
         // Let toolkit do the work at namespace boundaries.
-        if (nameC.isEmpty() || nameC.get(0).equals("") ||
-                prefixC.isEmpty() || prefixC.get(prefixLast).equals("")) {
+        if (nameC.isEmpty() || nameC.get(0).isEmpty() ||
+                prefixC.isEmpty() || prefixC.get(prefixLast).isEmpty()) {
             return super.composeName(nameC, prefixC);
         }
 
         result = (prefix == prefixC)
             ? (CompositeName) prefixC.clone()

@@ -685,11 +685,11 @@
      *          if class or type is unknown
      */
     private static CT fromAttrId(String attrId)
             throws InvalidAttributeIdentifierException {
 
-        if (attrId.equals("")) {
+        if (attrId.isEmpty()) {
             throw new InvalidAttributeIdentifierException(
                     "Attribute ID cannot be empty");
         }
         int rrclass;
         int rrtype;
< prev index next >