A HashMap bug with a Proxy value?
Alan.Bateman at oracle.com
Wed Jan 12 08:59:10 PST 2011
Chris Hegarty wrote:
> Are you referring to java.net.Proxy? Proxy.equals depends on the
> resolution of its address. Address resolution could change over time,
> depending on the caching policy. java.net.URL has a similar issue.
> Strangely,I would have expected containsValue and containsKey to behave
> in a similar fashion. I think the specification for these methods is
> very clear, they should use equals(). I'm not sure if containsKey is
> correct if it accepts key equality.
I assume he is talking about java.lang.reflect.Proxy as it forwards the
hashCode and equals methods to the invocation handler.
More information about the core-libs-dev