diff --git a/classlib/src/main/java/org/teavm/classlib/java/util/TGenericEnumSet.java b/classlib/src/main/java/org/teavm/classlib/java/util/TGenericEnumSet.java index 0dbdee5a8..fb587162e 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/util/TGenericEnumSet.java +++ b/classlib/src/main/java/org/teavm/classlib/java/util/TGenericEnumSet.java @@ -21,6 +21,7 @@ import java.util.Iterator; import java.util.NoSuchElementException; import org.teavm.classlib.java.lang.TClass; import org.teavm.platform.Platform; +import org.teavm.platform.PlatformClass; class TGenericEnumSet> extends TEnumSet { Class cls; @@ -39,7 +40,9 @@ class TGenericEnumSet> extends TEnumSet { } static Enum[] getConstants(Class cls) { - return Platform.getEnumConstants(((TClass) (Object) cls).getPlatformClass()); + PlatformClass platformClass = ((TClass) (Object) cls).getPlatformClass(); + Platform.initClass(platformClass); + return Platform.getEnumConstants(platformClass); } @Override