According to the API, it uses the equals() method.
Originally posted by Ron Newman:
He did override equals(), but he did not override hashCode(). Could this be the real problem? Does containsValue() compare hash codes as an optimization, to avoid unneeded calls on equals() ?
I didn't see anything there that should cause a problem.
Originally posted by Fred Close:
Thanks for your answers ...
I think Ron found the problem ...
What is that? Is that a mongol hoarde? Can we fend them off with this tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton