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

Enum should be an abstract class as per spec

XMLWordPrintable

    • b44
    • generic
    • generic

      The JSR-201 Public Review Draft Spec says that java.lang.Enum is an abstract class but it is currently a concrete class (basically a typo). Because it has only a protected constructor, there's no chance that anyone actually instantiated one.

      Also, the class comment should match what is in the latest spec draft:

      /**
       * The common base class of all enum types. Every enum type extends this
       * class, but it must not be subclassed manually. (This class does not,
       * itself define an enum type.)
       */

      Finally, the sole constructor should precede the accessors name() and ordinal() (by convention).

            jjb Josh Bloch
            jjb Josh Bloch
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: