From 7b989a4c1c318b3593d9f32fcdf830bb3252f198 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Sun, 3 Dec 2017 17:46:35 +0300 Subject: [PATCH] Fix bug in EnumSet.of --- .../src/main/java/org/teavm/classlib/java/util/TEnumSet.java | 1 + 1 file changed, 1 insertion(+) diff --git a/classlib/src/main/java/org/teavm/classlib/java/util/TEnumSet.java b/classlib/src/main/java/org/teavm/classlib/java/util/TEnumSet.java index 13a7700de..e30476767 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/util/TEnumSet.java +++ b/classlib/src/main/java/org/teavm/classlib/java/util/TEnumSet.java @@ -113,6 +113,7 @@ public abstract class TEnumSet> extends AbstractSet impleme @SafeVarargs public static > TEnumSet of(E first, E... rest) { TEnumSet result = TEnumSet.noneOf(first.getDeclaringClass()); + result.fastAdd(first); for (E e : rest) { result.fastAdd(e); }