Attached to the CCC proposal corresponding to this bug report is the latest JSR-201 spec draft for enum types (labeled "Preliminary Proposed Final Draft 2"). There are three substantive changes in this draft:
(1) All enum constructors are implicitly private. The compiler should implement this behavior.
(2) The use of the abstract and final modifiers on enum types is prohibited. The compiler should generate a compile-time error if a program uses either of these modifiers on an enum-type.
(3) It is illegal to reflectively instantiate an enum type.
Constructor.newInstance() will need new checks. (Class.newInstance() should then behave properly as it is implemented in terms of Constructor.newInstance().)
(1) All enum constructors are implicitly private. The compiler should implement this behavior.
(2) The use of the abstract and final modifiers on enum types is prohibited. The compiler should generate a compile-time error if a program uses either of these modifiers on an enum-type.
(3) It is illegal to reflectively instantiate an enum type.
Constructor.newInstance() will need new checks. (Class.newInstance() should then behave properly as it is implemented in terms of Constructor.newInstance().)
- relates to
-
JDK-5009574 Compiler should prohibit extending java.lang.Enum
-
- Resolved
-
-
JDK-5005748 enum classes final unless specialized
-
- Resolved
-
-
JDK-5035528 JavaDoc for enum classes should omit final and abstract modifiers
-
- Closed
-