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

anchors need to be updated when copied to index-all.html

    Details

      Description

      (From Martin Buchholz)

      Hi javadoc team,

      This is a bug report.
      If javadoc contains something like this:
       * <p id="bitEquals">This class compares primitive {@code double}
      then links like <a href="filename#bitEquals" ... work fine in the generated javadoc.
      However, when this text is copied to index-all.html by javadoc, I see in the generated javadoc
      <a href="./jsr166e/extra/#bitEquals">bitwise equal</a>
      which is a broken link because it is missing the filename.
      (javadoc obviously has code to handle this because the directory was added, but what about the filename? oughttabe easy to fix)
      If multiple such links are defined in multiple files, you will have a name clash.

      Repro using jsr166 CVS:

      (rm -rf /tmp/t8 && mkdir -p /tmp/t8 && cd /tmp/t8 && cvs -d ':pserver:anonymous@gee.cs.oswego.edu/home/jsr166/jsr166' checkout jsr166 && cd jsr166/src/jsr166e && { ~/jdk/jdk8/bin/javadoc extra/AtomicDouble*.java; find -name '*.html' | xargs grep -w bitEquals ; })
      ...
      Generating ./jsr166e/extra/AtomicDouble.html...
      ...
      Generating ./jsr166e/extra/AtomicDoubleArray.html...
      extra/AtomicDoubleArray.java:17: error: anchor already defined: bitEquals
       * <p id="bitEquals">This class compares primitive {@code double}
      ...
      ./index-all.html: if the current value is <a href="./jsr166e/extra/#bitEquals">bitwise equal</a>
      ./index-all.html: if the current value is <a href="./jsr166e/extra/#bitEquals">bitwise equal</a>
      ./jsr166e/extra/AtomicDoubleArray.html: <p id="bitEquals">This class compares primitive <code>double</code>
      ./jsr166e/extra/AtomicDouble.html: <p id

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jjg Jonathan Gibbons
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: