src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsName.java
changeset 52902 e3398b2e1ab0
parent 47216 71c04702a3d5
equal deleted inserted replaced
52901:3ba9ff4d4aaf 52902:e3398b2e1ab0
   366     }
   366     }
   367 
   367 
   368 
   368 
   369     boolean hasRootLabel() {
   369     boolean hasRootLabel() {
   370         return (!isEmpty() &&
   370         return (!isEmpty() &&
   371                 get(0).equals(""));
   371                 get(0).isEmpty());
   372     }
   372     }
   373 
   373 
   374     /*
   374     /*
   375      * Helper method for public comparison methods.  Lexicographically
   375      * Helper method for public comparison methods.  Lexicographically
   376      * compares components of this name in the range [beg,end) with
   376      * compares components of this name in the range [beg,end) with
   440         // If name is neither "." nor "", the octets (zero or more)
   440         // If name is neither "." nor "", the octets (zero or more)
   441         // from the rightmost dot onward are now added as the final
   441         // from the rightmost dot onward are now added as the final
   442         // label of the name.  Those two are special cases in that for
   442         // label of the name.  Those two are special cases in that for
   443         // all other domain names, the number of labels is one greater
   443         // all other domain names, the number of labels is one greater
   444         // than the number of dot separators.
   444         // than the number of dot separators.
   445         if (!name.equals("") && !name.equals(".")) {
   445         if (!name.isEmpty() && !name.equals(".")) {
   446             add(0, label.toString());
   446             add(0, label.toString());
   447         }
   447         }
   448 
   448 
   449         domain = name;          // do this last, since add() sets it to null
   449         domain = name;          // do this last, since add() sets it to null
   450     }
   450     }