RFR: 8352740: Introduce new factory method HtmlTree.IMG [v3]

Nizar Benalla nbenalla at openjdk.org
Tue Mar 25 12:21:29 UTC 2025


> Please review this small patch to add a new factory method `HtmlTree IMG(DocPath src, String alt)`, to provide a convenient way to reliably create valid tree nodes.
> 
> Previously, all uses of `HtmlTag.IMG` followed a similar pattern :
> 
> HtmlTree.of(HtmlTag.IMG)
>                         .put(HtmlAttr.SRC, docpath)
>                         .put(HtmlAttr.ALT, alt)
> 
> 
> However, it was easy to forget to add the required "alt" attribute. Those have been replaced by the new factory method.
> 
> No tests are required as part of this change.
> 
> TIA

Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:

  feedback: document params of the factory method.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/24204/files
  - new: https://git.openjdk.org/jdk/pull/24204/files/fe9a7a58..383a4558

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

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

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


More information about the javadoc-dev mailing list