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...
Original issue reported on code.google.com by Devin.Ch...@gmail.com on 25 Sep 2012 at 11:52
Original issue reported on code.google.com by
Devin.Ch...@gmail.com
on 25 Sep 2012 at 11:52Attachments: