< prev index next >

src/java.base/windows/classes/sun/net/www/protocol/file/Handler.java

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

*** 143,154 **** * per RFC 1738 no hostname is equivalent to 'localhost' * i.e. file:///path is equal to file://localhost/path */ String s1 = u1.getHost(); String s2 = u2.getHost(); ! if ("localhost".equalsIgnoreCase(s1) && ( s2 == null || "".equals(s2))) return true; ! if ("localhost".equalsIgnoreCase(s2) && ( s1 == null || "".equals(s1))) return true; return super.hostsEqual(u1, u2); } } --- 143,154 ---- * per RFC 1738 no hostname is equivalent to 'localhost' * i.e. file:///path is equal to file://localhost/path */ String s1 = u1.getHost(); String s2 = u2.getHost(); ! if ("localhost".equalsIgnoreCase(s1) && (s2 == null || s2.isEmpty())) return true; ! if ("localhost".equalsIgnoreCase(s2) && (s1 == null || s1.isEmpty())) return true; return super.hostsEqual(u1, u2); } }
< prev index next >