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

Compiler should prohibit extending java.lang.Enum

    XMLWordPrintable

    Details

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

      Description

      The JSR-201 Public Review Draft Spec says that it is illegal for a class to extend java.lang.Enum explicitly but compiler permits it. The following program should generate an compile-time error. In fact it crashes the compiler:

      public class Junk extends Enum {
          Junk() { super(null, 0); }
      }

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: