RFR: JDK-8315464: Uncouple AllClassesIndexWriter from IndexBuilder

Hannes Wallnöfer hannesw at openjdk.org
Thu Sep 14 16:28:10 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.

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

Commit messages:
 - JDK-8315464: Uncouple AllClassesIndexWriter from IndexBuilder

Changes: https://git.openjdk.org/jdk/pull/15746/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15746&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8315464
  Stats: 136 lines in 13 files changed: 21 ins; 68 del; 47 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