This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
with regards to this problem, I have discovered that HashSet.contains( Object o ) is not calling my .equals( Object o ) method that I've written for it. Is there any scenario in which HashSet.contains( Object obj ) would not invoke the obj.equals( hashset_element ) ? Jamie
Originally posted by Jamie Robertson: actually, now that I think of it, could my hashCode() method implementations be incorrect so they aren't checking in the right bucket for the element?
FOUND IT!!! damn hashCode() implementation all along. It was correct for checking equality within the same class, but when it tried to check equality with my second allowable class ( with its own different hashCode() implementation ) it couldn't find the right bucket to then check equality. One night of sleep, plus 6 minutes and problem solved!! it's too bad I don't get more sleep Jamie