Archiviert
13
0

Correctly clone enum set.

Dieser Commit ist enthalten in:
Kristian S. Stangeland 2013-08-07 00:33:23 +02:00
Ursprung 18f5998f8a
Commit b27922dd3d

Datei anzeigen

@ -237,7 +237,7 @@ public class ListeningWhitelist {
* @return A copy of the enum set. * @return A copy of the enum set.
*/ */
private static <T extends Enum<T>> EnumSet<T> safeEnumSet(Collection<T> options, Class<T> enumClass) { private static <T extends Enum<T>> EnumSet<T> safeEnumSet(Collection<T> options, Class<T> enumClass) {
if (options != null) { if (options != null && !options.isEmpty()) {
return EnumSet.copyOf(options); return EnumSet.copyOf(options);
} else { } else {
return EnumSet.noneOf(enumClass); return EnumSet.noneOf(enumClass);