< prev index next >

src/java.base/share/classes/java/net/URLPermission.java

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

*** 531,545 **** private boolean impliesHostrange(Authority that) { String thishost = this.p.hostname(); String thathost = that.p.hostname(); ! if (p.wildcard() && thishost.equals("")) { // this "*" implies all others return true; } ! if (that.p.wildcard() && thathost.equals("")) { // that "*" can only be implied by this "*" return false; } if (thishost.equals(thathost)) { // covers all cases of literal IP addresses and fixed --- 531,545 ---- private boolean impliesHostrange(Authority that) { String thishost = this.p.hostname(); String thathost = that.p.hostname(); ! if (p.wildcard() && thishost.isEmpty()) { // this "*" implies all others return true; } ! if (that.p.wildcard() && thathost.isEmpty()) { // that "*" can only be implied by this "*" return false; } if (thishost.equals(thathost)) { // covers all cases of literal IP addresses and fixed
< prev index next >