RFR: 8338133: Cleanup direct use of `new HtmlTree`

Jonathan Gibbons jjg at openjdk.org
Tue Sep 3 18:43:20 UTC 2024


On Tue, 3 Sep 2024 17:58:13 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SearchWriter.java line 114:
>> 
>>> 112:                 .add(HtmlTree.of(HtmlTag.P)
>>> 113:                         .setId(HtmlId.of("page-search-notify"))
>>> 114:                         .add(contents.getContent("doclet.search.loading")))
>> 
>> We could combine `.of` and `.add` into `HtmlTree.P(Content)` here.
>
> will look at that

Yes, your suggestion matches the style of preceding usages.
I thought about adding a new overload for `HtmlTree.P` taking an `HtmlId`, but did not, because generally I think it uncommon to identify paragraphs, as compared to bigger elements like `DIV`, list, and tables.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20778#discussion_r1742512111


More information about the javadoc-dev mailing list