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

stddoclet: Inherited @throws improperly copies from overridden method to subclas

XMLWordPrintable

    • beta2
    • generic, x86, sparc
    • generic, solaris_2.6, solaris_7, windows_2000
    • Verified

      When an overriding method's doc comment doesn't contain any javadoc tags,
      the standard doclet copies the javadoc tags from the overridden methods
      doc comment in the superclass. In some cases, this results in copying
      @throws tags to the overriding method in the subclass when the subclass's
      method doesn't throw any exceptions.

      An example of this is the java.io.PrintWriter.write(int) spec.
       http://webwork.eng/products/jdk/1.3/docs/api/java/io/PrintWriter.html#write(int)

      PrintWriter.write(int) overrides Writer.write(int), and PrintWriter.write's spec copies the @throws IOException tag from Writer.write's spec. However, this is
      not appropriate since PrintWriter.write does not throw IOException.

      The standard doclet should not blindly copy javadoc tags, or at least @throws
      tags, to the overriding class's spec.

      This problem is present in 1.2.2 and 1.3.

            jhosunw Jamie Ho (Inactive)
            asommere Alan Sommerer (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: