8.9.3: Simplify implicit declaration of values() and valueOf(String)

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 13
    • Affects Version/s: 12
    • Component/s: specification

      Since the introduction of enum types in Java SE 5, section 8.9.3 of the JLS has included the following javadoc for the implicit enum member `public static E[] values()`:

      /**
      * Returns an array containing the constants of this enum
      * type, in the order they're declared. This method may be
      * used to iterate over the constants as follows:
      *
      * for(E c : E.values())
      * System.out.println(c);
      * ...

      The tip about the for-each loop may have been reasonable for Java SE 5.0, but it not necessary today and has been removed from the generated javadoc via JDK-8173730 in JDK 12.

            Assignee:
            Alex Buckley
            Reporter:
            Joe Darcy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: