We need to override hashCode() and equals() because the default

implementations do a fucking DNS lookup on the host of the URL. The degree
to which that violates expectations about the "expense" of calling
hashCode() is so astronomical as to be unexpressible without complicated
metaphor.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3421 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2005-03-23 01:56:54 +00:00
parent 32a42047dc
commit 4bfbb96dfe
@@ -68,6 +68,18 @@ public class Handler extends URLStreamHandler
AttachableURLFactory.attachHandler("resource", Handler.class);
}
// documentation inherited
protected int hashCode (URL url)
{
return String.valueOf(url).hashCode();
}
// documentation inherited
protected boolean equals (URL u1, URL u2)
{
return String.valueOf(u1).equals(String.valueOf(u2));
}
// documentation inherited
protected URLConnection openConnection (URL url)
throws IOException