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

Enumeration class documentation should use generics

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 5.0
    • core-libs

      URL OF FAULTY DOCUMENTATION :
      http://java.sun.com/j2se/1.5.0/docs/api/java/util/Enumeration.html

      A DESCRIPTION OF THE PROBLEM :
      The example in the class documentation (javadoc) should use generics.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      For example, to print all elements of a vector v:

           Vector<T> v;
           //...
           for (Enumeration<T> e = v.elements() ; e.hasMoreElements() ;) {
               System.out.println(e.nextElement());
           }
      ACTUAL -
      For example, to print all elements of a vector v:

           for (Enumeration e = v.elements() ; e.hasMoreElements() ;) {
               System.out.println(e.nextElement());
           }
      ###@###.### 2005-07-15 02:02:40 GMT

            martin Martin Buchholz
            jleesunw Jon Lee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: