if (url1 == null || url2 == null || url1.getPort() != url2.getPort())
if (url1 == null || url2 == null) return false; int p1 = url1.getPort (); if (p1 == -1) p1 = url1.handler.getDefaultPort (); int p2 = url2.getPort (); if (p2 == -1) p2 = url2.handler.getDefaultPort (); if (p1 != p2)
  protected boolean sameFile(URL url1, URL url2)  {    if (url1 == url2)      return true;    // This comparison is very conservative.  It assumes that any    // field can be null.    if (url1 == null || url2 == null || url1.getPort() != url2.getPort())      return false;    String s1, s2;    s1 = url1.getProtocol();    s2 = url2.getProtocol();    if (s1 != s2 && (s1 == null || ! s1.equals(s2)))      return false;    s1 = url1.getHost();    s2 = url2.getHost();    if (s1 != s2 && (s1 == null || ! s1.equals(s2)))      return false;    s1 = canonicalizeFilename(url1.getFile());    s2 = canonicalizeFilename(url2.getFile());    if (s1 != s2 && (s1 == null || ! s1.equals(s2)))      return false;    return true;  }