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

Jonathan Gibbons jjg at openjdk.java.net
Wed Jan 13 16:59:14 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 six commits:

 - Address review comments
 - Merge remote-tracking branch 'upstream/master' into htmlids
 - tidy up merge
 - 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=03
  Stats: 1022 lines in 39 files changed: 553 ins; 293 del; 176 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