-
Bug
-
Resolution: Fixed
-
P4
-
6
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=141155
$ cat X.java
public enum X {
A, B, C;
}
$ javac X.java
$ javap X
Compiled from "X.java"
public final class X extends java.lang.Enum{
public static final X A;
public static final X B;
public static final X C;
public static final X[] values();
public static X valueOf(java.lang.String);
static {};
}
The method values() is final which contradicts the JLS.
$ cat X.java
public enum X {
A, B, C;
}
$ javac X.java
$ javap X
Compiled from "X.java"
public final class X extends java.lang.Enum{
public static final X A;
public static final X B;
public static final X C;
public static final X[] values();
public static X valueOf(java.lang.String);
static {};
}
The method values() is final which contradicts the JLS.
- relates to
-
JDK-6424491 Cannot initialise nested enums
- Closed