RFR: JDK-8259283: use new HtmlId and HtmlIds classes [v2]

Jonathan Gibbons jjg at openjdk.java.net
Mon Jan 11 22:36:09 UTC 2021


> Please review this change to centralize the management of HTML ids used by the standard doclet in a single new factory class, `HtmlIds`, which utilizes a new type-safe wrapper class around `String` called `HtmlId`.
> 
> The new classes are used both when declaring ids (e.g. `HtmlTree.setId`) and when referencing them (e.g. `Links.createLink`).  The enum `SectionName`, which declared a set of standard ids, goes away, as do methods in `Links` and other places to create "anchors".
> 
> This is a simple refactoring: there is no intentional change of functionality, and no tests are affected or need to be updated. However, the changes do highlight the inconsistency of the use of ids: it would be good to rationalize these in separate, targeted follow-up work.

Jonathan Gibbons has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits:

 - Merge remote-tracking branch 'upstream/master' into htmlids, and resolve conflicts
   
   # Conflicts:
   #	src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DeprecatedListWriter.java
   #	src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
   #	src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Navigation.java
 - fix whitespace; add doc comments
 - JDK-8259283: use new HtmlId and HtmlIds classes

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

Changes: https://git.openjdk.java.net/jdk/pull/1951/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1951&range=01
  Stats: 1002 lines in 38 files changed: 552 ins; 275 del; 175 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1951.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1951/head:pull/1951

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


More information about the javadoc-dev mailing list