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

javadoc -private creates broken links to enum constructors

XMLWordPrintable

      FULL PRODUCT VERSION :
      Reproduced on 1.8.0_101, 1.8.0_102, and 1.9.0 early access

      openjdk version "1.8.0_101"
      OpenJDK Runtime Environment (build 1.8.0_101-b13)
      OpenJDK 64-Bit Server VM (build 25.101-b13, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Reproducible on multiple OSes. For example:

      Linux mdet430s 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

      and also

      Linux godwit.cs.washington.edu 4.4.19-1.el7.elrepo.x86_64 #1 SMP Sat Aug 20 17:07:51 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux

      and also MacOS

      A DESCRIPTION OF THE PROBLEM :
      Consider this file, MyEnum.java:

      package mypackage;
      public enum MyEnum {
        A, B
      }

      Run
        javadoc -private MyEnum.java

      The javadoc command a file creates a file index-all.html whose contents include the following HTML:

      <dt><span class="memberNameLink"><a href="MyEnum.html#MyEnum--">MyEnum()</a></span> - Constructor for enum <a href="MyEnum.html" title="enum in &lt;Unnamed&gt;">MyEnum</a></dt>

      That HTML includes the link "MyEnum.html#MyEnum--", which is illegal because the file MyEnum.html does not have an anchor named "MyEnum--".

      The enum constructor is not documented in Javadoc HTML output even if the -private flag is supplied, and therefore it should not be listed in the index-all.html file either.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      See "Description" for detailed reproduction steps.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I expect the generated HTML not to have broken links.
      ACTUAL -
      The generated HTML has broken links.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package mypackage;
      public enum MyEnum {
        A, B
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      It is necessary to postprocess the generated HTML to search and replace links to enum constructors.

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: