RFR: JDK-8315464: Uncouple AllClassesIndexWriter from IndexBuilder [v2]

Hannes Wallnöfer hannesw at openjdk.org
Fri Sep 15 16:04:28 UTC 2023


> My original intention with this cleanup was to keep using `[Html]IndexBuilder' for both the "All Classes" and the main index, but just improve separation of code and naming of classes. However, I then discovered two things:
> 
>  - The "All Classes" page is so simple to build that it doesn't justify using a complex builder class. In fact, moving the necessary functionality from `IndexBuilder` to `AllClassesIndexWriter` just added about a dozen lines of code to the latter, while making `IndexBuilder` much simpler by removing its dual purpose.
>  - The separation of code between `toolkit.util.IndexBuilder` and `formats.html.HtmlIndexBuilder`, although seemingly random at first sight, actually reflects the usage of functionality provided by the respective packages. Although with a single output format the separation between these packages is not as important as it used to be, it is still nice to keep things separated.
> 
> Based on these two findings, I decided to pull the "All Classes" code into "AllClassesIndexWriter", but maintain the implementation of `[Html]IndexBuilder` across the two classes/packages. Although the base `IndexBuilder` class is technically able to function on its own without the HTML-specific enhancements, I made the class abstract in order to point out that the HTML enhancements in `HtmlIndexBuilder` are actually essential for our us.

Hannes Wallnöfer has updated the pull request incrementally with one additional commit since the last revision:

  Update src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java
  
  Remove whitespace
  
  Co-authored-by: Andrey Turbanov <turbanoff at gmail.com>

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/15746/files
  - new: https://git.openjdk.org/jdk/pull/15746/files/9618be0a..f6e3d44c

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=15746&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15746&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/15746.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15746/head:pull/15746

PR: https://git.openjdk.org/jdk/pull/15746


More information about the javadoc-dev mailing list