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

Inherited @throws tags should be displayed in doc comment order of parent class

XMLWordPrintable

      Given P.method, a method with more than one explicit @throws tags, the
      @throws tags are properly output to HTML in the same order they appear in
      the doc comments in the source files. The bug is that when a method C.method
      in a child class overrides P.method, the *inherited* @throws tags in C.method
      are output in the order they appear in the throws clause of C.method, rather
      than the same order they appeared in P.method. The @throws tags should
      be output to HTML in the same order in P.method as they are in C.method.

      The restriction is due to the algorithm we use. We iterate through the
      declared exceptions in C.method and then inherit the @throws tags if necessary.
      We could go in the other direction (iterate through the @throws tags
      of the parent and inherit if the exception is declared).

      We did not fix this for 1.5.0 because we discovered it late in Beta 2 --
      it would have required a lot of work and might have introduced new bugs.

      FYI, we discovered this bug when we fixed this related bug:
      498507: Running javadoc twice produces different order for exceptions due to @throws

            jjg Jonathan Gibbons
            dkramersunw Douglas Kramer (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: