RFR: JDK-8261263: Simplify javadoc link code

Hannes Wallnöfer hannesw at openjdk.java.net
Fri Feb 5 21:10:54 UTC 2021


This is a cleanup of the javadoc link generating code.

There is a simple "horizontal" component to this change that removes the `strong` parameters from most `HtmlDocletWriter#getDocLink` methods which where the value used was always `false`, and related changes in all the code using these methods. 

The slightly more complex part of this change are changes in `LinkInfo[Impl]` and `LinkFactory[Impl]`. Here the target was to reduce the number of booean fields in `LinkInfo` and their interaction with the code, which was quite hard to grasp. I managed to replace several fields controlling generation of type parameter links with a single `includeTypeParameterLinks()` method. The use of this method and the remaining boolean fields in the code is quite straightforward. 

I also removed some bits of dead code and simplified the control flow a bit by trying to do things only in one place and one way when possible.

The code passes all javadoc tests and generates documentation identical to the old code.

-------------

Commit messages:
 - JDK-8261263: Reformat and rephrase comments
 - JDK-8261263: Simplify javadoc link code

Changes: https://git.openjdk.java.net/jdk/pull/2437/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2437&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8261263
  Stats: 257 lines in 15 files changed: 41 ins; 153 del; 63 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2437.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2437/head:pull/2437

PR: https://git.openjdk.java.net/jdk/pull/2437


More information about the javadoc-dev mailing list