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

Bring enum implementation up to date with its spec

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 5.0
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b46
    • CPU:
      generic
    • OS:
      generic

      Description

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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: