JDK-8195805 : Doclet incorrectly updates all attributes in tags when relocating links
  • Type: Bug
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-01-19
  • Updated: 2018-02-16
  • Resolved: 2018-01-22
JDK 11
11 b01Fixed
Related Reports
Relates :  
Description
The doclet tries to update `<a ...>` tags in doc comments when copying the comment for use in another file in another directory.

But, it updates ANY/ALL attribute in the `<a...>` tag, and not just the href attribute, which is what the correct behavior would be.

In particular, it modifies any `name=...` attribute that it finds, as exemplified in this test ... (TestRelativeLinks.java)  ... see line 71 and weep.


  64         // INDEX PAGE
  65         checkOutput("index-all.html", true,
  66             "<a href=\"./pkg/relative-class-link.html\">relative class link</a>",
  67             "<a href=\"./pkg/relative-field-link.html\">relative field link</a>",
  68             "<a href=\"./pkg/relative-method-link.html\">relative method link</a>",
  69             "<a href=\"./pkg/relative-package-link.html\">relative package link</a>",
  70             " <a href=\"./pkg/relative-multi-line-link.html\">relative-multi-line-link</a>.",
  71             "<div class=\"block\"><a name=\"./pkg/masters\"></a>");