Re: Seeming Non-determinism in Java Programs
Randall R Schulz <[email protected]> Sun, 6 Apr 2008 20:31:52 -0700
| Newsgroups | gmane.comp.windows.devel.java.advanced |
|---|---|
| Message-ID | <[email protected]> |
On Sunday 06 April 2008 20:05, Ray Tayek wrote: > 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. Yeah. I've thought of that, too. I can't say I can guarantee all these things are correct, but I've scrutinized the code and cannot find any problems. Randall Schulz =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com