| « Long Overdue Server Reassignment | Half-tweaks and Outages » |
HashCode: Forgot My Own Advice
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.