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

Bad first sentence recognition with recursive {@inheritDoc}

XMLWordPrintable

    • b61
    • generic
    • generic

      If I inheritDoc once, it works.
      But if I inheritDoc again on a doc comment that has used that
      same mechanism in turn, the first sentence is incorrectly
      recognized -- it becomes the entire doc comment.
      The implementation of {@inheritDoc} must be able to handle
      arbitrary levels of recursive expansion.

      Self-explanatory shell transcript follows.
      (Note that the summary for C3 is different from C2,
      which is wrong.)

      $ cat C1.java
      public class C1 {
          /**
           * First sentence. Second sentence.
           */
          public void m() {}
      }
      $ cat C2.java
      public class C2 extends C1 {
          /**
           * {@inheritDoc}
           *
           * <p>Third sentence. Fourth sentence.
           */
          public void m() {}
      }
      $ cat C3.java
      public class C3 extends C2 {
          /**
           * {@inheritDoc}
           *
           * <p>Fifth sentence. Sixth sentence.
           */
          public void m() {}
      }
      $ javadoc C?.java >/dev/null && grep 'First sentence' C?.html
      C1.html:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;First sentence.</TD>
      C1.html:<DD>First sentence. Second sentence.
      C2.html:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;First sentence.</TD>
      C2.html:<DD>First sentence. Second sentence.
      C3.html:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;First sentence. Second sentence.</TD>
      C3.html:<DD>First sentence. Second sentence.

      ###@###.### 2005-04-11 21:49:25 GMT

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: