RFR: 8281533: Odd "preview" label in link/linkplain
Jonathan Gibbons
jjg at openjdk.org
Mon Aug 19 17:40:48 UTC 2024
On Mon, 19 Aug 2024 14:39:36 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:
> Please review a patch to suppress the `PREVIEW` and `RESTRICTED` superscript labels for JavaDoc tags that generate plain links such as `{@linkplain ...}`. The rationale is that the purpose of plain links is usually to have the label not "stick out" of the local context, which makes the superscript label look odd.
>
> The fix itself consists of a single line in `LinkTaglet.java`. The major part of the changed lines is to clean up the generation of `PREVIEW` and `RESTRICTED` labels in `HtmlLinkFactory.java`, which I have wanted to do for a long time. Instead of generating internal and external links and plain-text labels in separate code, I have moved the code to a common method that will generate the appropriate link or label. It is a bit of a code smell that the `getSuperscript` method uses nullness of parameters to decide which link format to use, but I didn't know any reasonably simple better way to do this. I did add proper doc comments to explain what is returned even though the code is private.
LGTM
-------------
Marked as reviewed by jjg (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/20626#pullrequestreview-2246112144
More information about the javadoc-dev
mailing list