I stumbled across the issue with TObjectDoubleHashMap
of trove. The version 2.0.2 doesn't override the hashCode
method.
More recent versions of trove (3.0.0) include the hashCode
.
Note, that the equals
method is overriden in both versions.
Why wasn't the hashCode
method overriden in the version 2? Maybe the contract for overriding hashCode
/equals
was introduced after the trove maps were written originally? Or is it simply a violation of the contract and a bug that was fixed later? I'd be very surprised if it's a bug and not a feature, because how come the class that mostly deals with hashing not override hashCode
when it has equals