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

Javadoc for generic constructor doesn't document type parameter

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 5.0, 8, 11, 17, 22
    • tools
    • b09
    • generic
    • generic

      Consider this example:

      /**
       * @param <T> documentation for T
       */
      public class Test<T> {
          /**
           * @param <S> documentation for S
           * @param clazz documentation for clazz
           */
          public <S extends T> Test(Class<S> clazz) {}

          /**
           * @param <S> documentation for S
           * @param clazz documentation for clazz
           */
          public static <S extends Number> Test<S> newInstance(Class<S> clazz) {}
      }

      The type parameter on the constructor isn't documented by the standard doclet
      as the it is for the generic method newInstance:

      Constructor Summary
      Test(java.lang.Class<S> clazz)

      Method Summary
      static <S extends java.lang.Number> Test<S> newInstance(java.lang.Class<S> clazz)

            acobbs Archie Cobbs
            ahe Peter Ahe
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: