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

Javadoc omits summary entries and produces duplicate IDs, breaking links

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 21, 22
    • tools
    • None

      My colleague Chris Povirk discovered the following issue:

      In the following example the two methods are given the same ID by javadoc of "m(E)":

      ```
      $ cat JavadocSameSig.java
      public interface JavadocSameSig {
        <E extends Object> void m(E e);
        <E extends Comparable<? super E>> void m(E e);
      }

      $ java -fullversion
      openjdk full version "21+35"
      $ javadoc JavadocSameSig.java
      ...

      $ grep 'id="m(E)"' JavadocSameSig.html
      <section class="detail" id="m(E)">
      <section class="detail" id="m(E)">
      ```

      So, if you click a link for `m(E)` in the method summary, it takes you to one of those, no matter where the link is "supposed" to go.

      Plus, the method summary is actually showing only 1 method, rather than 2.

      (With JDK11, I see two methods in the summary, though there's still the problem that the links can lead to only one of the methods' details.)

            nbenalla Nizar Benalla
            cushon Liam Miller-Cushon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: