Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.2
-
None
Description
This is because the hash code of MultiKey is calculated only once.
So if the MultiKey is deserialized in an other jvm, and if one at least of the subkeys defines its hash code with System.identityHashCode() (for example all the enums does), then the hash code of the MultiKey is no longer valid, and you can't retreive the key in your Map.
I fixed it by making the cached hash code field transient, and by recalculating the hash code during deserialization.
Attachments
Attachments
Issue Links
- relates to
-
COLLECTIONS-576 MultiKey subclassing has deserialization problem since COLLECTIONS-266: either declare protected readResolve() or MultiKey must be final
- Closed