diff --git a/classpath/java/lang/Class.java b/classpath/java/lang/Class.java index 621a8fcd28..225680a66b 100644 --- a/classpath/java/lang/Class.java +++ b/classpath/java/lang/Class.java @@ -345,6 +345,18 @@ public final class Class { } } + public T[] getEnumConstants() { + if (isAssignableFrom(Enum.class)) { + try { + return (T[]) getMethod("values").invoke(null); + } catch (Exception e) { + throw new Error(); + } + } else { + return null; + } + } + public ClassLoader getClassLoader() { return loader; }