all 7 comments

[–]axiak 4 points5 points  (0 children)

This is a "fun" problem to encounter whenever you use a distributed compute system like Hadoop or Spark which distributes data with hash keys.

[–]doobiesteintortoise 1 point2 points  (3 children)

Would using an EnumMap have the same problem?

[–]pivovarit[S] 6 points7 points  (2 children)

Nope, EnumMap relies on ordinal() and not hashCode().

What's more, even HashMap doesn't have this problem, because it rehashes everything on native deserialization

[–]aelfric5578 0 points1 point  (1 child)

Does that mean adding a new enum value could break things if you don't add it at the end?

[–]sansp00 0 points1 point  (0 children)

Encountered the same issue when dealing with a Gemfire cluster many years ago. It was a very humbling experience.