src/java.base/windows/classes/sun/net/www/protocol/file/Handler.java
changeset 53018 8bf9268df0e2
parent 52902 e3398b2e1ab0
child 55704 04cccf60fe44
equal deleted inserted replaced
53017:e10a1f7aaa13 53018:8bf9268df0e2
   143          * per RFC 1738 no hostname is equivalent to 'localhost'
   143          * per RFC 1738 no hostname is equivalent to 'localhost'
   144          * i.e. file:///path is equal to file://localhost/path
   144          * i.e. file:///path is equal to file://localhost/path
   145          */
   145          */
   146         String s1 = u1.getHost();
   146         String s1 = u1.getHost();
   147         String s2 = u2.getHost();
   147         String s2 = u2.getHost();
   148         if ("localhost".equalsIgnoreCase(s1) && ( s2 == null || "".equals(s2)))
   148         if ("localhost".equalsIgnoreCase(s1) && (s2 == null || s2.isEmpty()))
   149             return true;
   149             return true;
   150         if ("localhost".equalsIgnoreCase(s2) && ( s1 == null || "".equals(s1)))
   150         if ("localhost".equalsIgnoreCase(s2) && (s1 == null || s1.isEmpty()))
   151             return true;
   151             return true;
   152         return super.hostsEqual(u1, u2);
   152         return super.hostsEqual(u1, u2);
   153     }
   153     }
   154 }
   154 }