My Simple Blog
« Long Overdue Server ReassignmentHalf-tweaks and Outages »

HashCode: Forgot My Own Advice

Permalink 02/02/10 15:19, by Jeff, Categories: Blather , Tags:

Link: http://www.objectpartners.com/2009/01/09/equals-and-hashcode/

Some time ago I wrote a little bit on the Java equals-hashCode contract. Recently, I hastily violated this, and have spent the last two days chasing down failures in my refactoring due to this violation.

To be fair, I wasn't done yet, and would like to think that I certainly would have properly implemented hashCode() to go along with my developing equals() in my code. I'm a little, shall we say "particular" about such things, and am very certain I would have.

What I'm surprised (and frustrataed) at myself for is not realizing this was my problem. I would normally create my equals() and hashCode() at the same time, but, for whatever reason, this time I did not.

Now I'm back on track...and kicking myself...gently, of course.

No feedback yet

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
PoorExcellent
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
February 2012
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29      
Just some random blathering and thoughts.

Search

Ad From Google

XML Feeds

multiblog platform