Code Review 7030649: URL.equals() fails to compare jar urls

Michael McMahon michael.x.mcmahon at oracle.com
Thu Apr 14 09:56:13 PDT 2011


Chris Hegarty wrote:
> Alan, Michael,
>
> This is an old issue. JAR URLs may not compare equal when their 
> enclosing URL's are. The reason is that 
> URLStreamHandle.equals(URL,URL) and sameFile(URL,URL) doesn't know 
> about the composite URL syntax used by JAR URLs. To resolve this we 
> should overridden samefile in sun.net.www.protocol.jar.Handler. Ditto 
> for hashCode.
>
> http://cr.openjdk.java.net/~chegar/7030649/webrev.00/webrev/
>
> -Chris.

line 106: += should be just +

In the test the flag passed is being reset for each test, so only the
result of the last test is considered for the overall test.

Looks fine otherwise

- Michael



More information about the net-dev mailing list