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

Documenting type parameters not mentioned for generic methods/constructors

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 5.0
    • docs
    • b43
    • x86
    • windows_xp
    • Verified

      A DESCRIPTION OF THE PROBLEM :
      The current Javadoc tool documentation does not mention that generic methods may have its type parameters documented with @param tags similar to generic classes. This seems to be a feature that not many developers are aware of and IMHO worth to be documented.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The parameter-name can be the name of a parameter in a method or constructor, or the name of a type parameter of a class or method or constructor. Use angle brackets around this parameter name to specify the use of a type parameter, such as:

           /**
            * @param <E> Type of element stored in a list
            */
           public interface List<E> extends <E> {
           }

          /**
           * blah.
           *
           * @param <T> blah
           * @param <V> blah
           * @param string blah
           * @param type blah
           *
           * @return blah
           */
          <T, V extends T> V convert(String string, Class<T> type);
      ACTUAL -
      The parameter-name can be the name of a parameter in a method or constructor, or the name of a type parameter of a class. Use angle brackets around this parameter name to specify the use of a type parameter, such as:

           /**
            * @param <E> Type of element stored in a list
            */
           public interface List<E> extends Collection<E> {
           }

      URL OF FAULTY DOCUMENTATION :
      http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.html#@param
      ###@###.### 2005-05-11 12:25:00 GMT

            dkramersunw Douglas Kramer (Inactive)
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: