RFR: 8283269: Improve definition and use of jdk.javadoc.internal.doclets.toolkit.Content

Pavel Rappo prappo at openjdk.java.net
Fri Mar 25 14:09:17 UTC 2022


On Wed, 16 Mar 2022 16:32:09 GMT, Pavel Rappo <prappo at openjdk.org> wrote:

> This PR started in a draft mode as a refactoring effort. After a few commits and chats with Jonathan Gibbons, I decided that further refactoring belongs to follow-up PRs and that this PR could be marked as "Ready for review".
> 
> The motivation for the initial refactoring effort was as follows. The word "tree" is heavily overloaded in the JavaDoc codebase, both in comments and code. Here are some of the contexts this word appears in:  
> 
>   * Hierarchy Tree (i.e. overview-tree.html and package-tree.html)
>   * DocTree (AST nodes)
>   * ClassTree, *TreeWriter (data structures and entities related to supertype-subtype relationship)
>   * HtmlTree (HTML nodes) and specifically UL/OL elements which are nested lists
> 
> Sometimes contexts overlap, making the word "tree" ambiguous. To reduce this ambiguity, the word "tree" should be dropped in favor of a more specific word of phrase where possible.
> 
> In the case where the context is `jdk.javadoc.internal.doclets.toolkit.Content`, the programmer is already aware that they are dealing with trees in the sense that `Content` objects support recursive composition. There's no need to have the phrase "content tree" where "content" would do. Moreover, in the context that is exclusively about `Content` objects, the word "content" can be dropped too, since the type information is assumed.
> 
> As an example of content overlap, have a look at the source of `jdk.javadoc.internal.doclets.toolkit.builders.MemberSummaryBuilder::buildSummary`. This method used to needlessly mix DocTree with Content tree.

Thanks for your many useful comments, Jon.

General comment from me. I would prefer to minimize changes at this time: anything unrelated to getting rid of the word "tree" in the context of Content should be off the table. Except for maybe related typos and affected indentation.

Don't get me wrong, everything you suggest here is valuable; but given the size of the change, the future PR could really benefit from being extremely focused. We could fix the "leftovers" in a follow-up PR. I'm talking about removing trailing periods, adding "s" to the opening verbs, etc.

I'll update the branch shortly with the changes suggested by some of your comments.

Jon, just to clarify: the most recent commit (601a17c) does not address any of your earlier comments. They are still to be addressed.

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

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


More information about the javadoc-dev mailing list