You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was rather surprised by the original error, so I made a minor revision to allow the class of the contained Enum to be determined. As long as the Enum has at least one definition, using the complement of an empty set works.
Unfortunately, I could not get the EnumMap to behave in a similar fashion due to the constructor requiring a class object and EnumSet.copyOf(Collection) doesn't work if the collection is empty :(
From [email protected] on September 26, 2012 01:52:57
I was rather surprised by the original error, so I made a minor revision to allow the class of the contained Enum to be determined. As long as the Enum has at least one definition, using the complement of an empty set works.
EnumSet.allOf(Enum) == EnumSet.complementOf(EnumSet.noneOf(Enum))
Unfortunately, I could not get the EnumMap to behave in a similar fashion due to the constructor requiring a class object and EnumSet.copyOf(Collection) doesn't work if the collection is empty :(
I hate Java generics...
Attachment: DefaultSerializers.java.patch
Original issue: http://code.google.com/p/kryo/issues/detail?id=91
The text was updated successfully, but these errors were encountered: