Re: Seeming Non-determinism in Java Programs

Ray Tayek <[email protected]> Sun, 6 Apr 2008 20:05:31 -0700
Newsgroups gmane.comp.windows.devel.java.advanced
Message-ID <[email protected]>
At 06:04 PM 4/6/2008, you wrote:
>...
>But as far as I know (and certainly as I intended), no class whose
>instances are stored in hashed structures rely on the default
>implementation of hashCode(). That implementation is only congruent
>with the default implementation of equals() as instance identity. I
>never overload one of those without overloading the other, so this
>should not be an explanation for what I'm seeing (thus leading to my
>perplexity).

if you have overridden hashCode and equals, make sure you are not
modifying any properties that change the hashcode after the object is
in the collection or map.

thanks

---
vice-chair http://ocjug.org/

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com