< prev index next >
src/jdk.naming.dns/share/classes/com/sun/jndi/dns/DnsName.java
Print this page
rev 52881 : 8214971: Replace use of string.equals("") with isEmpty()
*** 366,376 ****
}
boolean hasRootLabel() {
return (!isEmpty() &&
! get(0).equals(""));
}
/*
* Helper method for public comparison methods. Lexicographically
* compares components of this name in the range [beg,end) with
--- 366,376 ----
}
boolean hasRootLabel() {
return (!isEmpty() &&
! get(0).isEmpty());
}
/*
* Helper method for public comparison methods. Lexicographically
* compares components of this name in the range [beg,end) with
*** 440,450 ****
// If name is neither "." nor "", the octets (zero or more)
// from the rightmost dot onward are now added as the final
// label of the name. Those two are special cases in that for
// all other domain names, the number of labels is one greater
// than the number of dot separators.
! if (!name.equals("") && !name.equals(".")) {
add(0, label.toString());
}
domain = name; // do this last, since add() sets it to null
}
--- 440,450 ----
// If name is neither "." nor "", the octets (zero or more)
// from the rightmost dot onward are now added as the final
// label of the name. Those two are special cases in that for
// all other domain names, the number of labels is one greater
// than the number of dot separators.
! if (!name.isEmpty() && !name.equals(".")) {
add(0, label.toString());
}
domain = name; // do this last, since add() sets it to null
}
< prev index next >