Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5009601

Bring enum implementation up to date with its spec

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 5.0
    • 1.4.0
    • tools
    • b46
    • generic
    • generic

      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().)

            darcy Joe Darcy
            jjb Josh Bloch
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: