[concurrency-interest] Reference/IdentityMap toString

Jason Mehrens jason_mehrens at hotmail.com
Fri Aug 20 10:20:38 EDT 2010


Jed,
 
> I think you're basically arguing that IdentityHashMap (and any "map" or 
> "set" that uses identity == rather than the equals contract) is broken. 
 
IdentityHashMap has a nice warning in the javadocs which is great.  Specifically, I'm arguing that any map that doesn't use the equals contract but uses the AbstractMap.toString is broken.  The reason is that map containment is determined by the equivalence relationship and AbstractMap.toString lists what is contained in the map.  Therefore, the string representation of a map must accurately describe the equivalence relationship, otherwise the string representation is broken.
 
Regards,
 
Jason 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20100820/d39260b6/attachment.html>


More information about the Concurrency-interest mailing list