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

Javadoc comments should be inherited from most derived superinterface or superclass

XMLWordPrintable

    • b61
    • generic
    • generic

      When you have a Java inheritance hierarchy like this:

      A->B->C

      and A and B both provide javadoc for some method m, and C has no doc comment
      for method m, it should inherit from B, not from A, as appears to happen.

      Self-explanatory shell transcript follows:
      (C.html should contain "m1-B", not "m1-A")

      $ cat [ABC].java; javadoc [ABC].java && grep 'm[0-9]-' C.html
      public interface A {
          /**
           * m1-A
           */
          void m1();
      }
      public interface B extends A {
          /**
           * m1-B
           */
          void m1();
      }
      public class C implements B {
          public void m1() {}
      }
      Loading source file A.java...
      Loading source file B.java...
      Loading source file C.java...
      Constructing Javadoc information...
      Standard Doclet version 1.6.0-ea
      Building tree for all the packages and classes...
      Generating A.html...
      Generating B.html...
      Generating C.html...
      Generating package-frame.html...
      Generating package-summary.html...
      Generating package-tree.html...
      Generating constant-values.html...
      Building index for all the packages and classes...
      Generating overview-tree.html...
      Generating index-all.html...
      Generating deprecated-list.html...
      Building index for all classes...
      Generating allclasses-frame.html...
      Generating allclasses-noframe.html...
      Generating index.html...
      Generating help-doc.html...
      Generating stylesheet.css...
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;m1-A</TD>
      <DD>m1-A
      ###@###.### 2005-05-15 23:50:20 GMT
      I am currently testing a fix for this. There is a bug where the list of superinterfaces or superclasses are sorted in alphabetical order. This is why we get the wrong inherited comments in some cases.

            jhosunw Jamie Ho (Inactive)
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: