RFR: JDK-8299896: Reduce enum values of HtmlLinkInfo.Kind
Hannes Wallnöfer
hannesw at openjdk.org
Fri Jan 20 14:53:43 UTC 2023
On Thu, 12 Jan 2023 16:20:10 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:
> Please review this change to drastically reduce the number of enum values in `HtmlLinkInfo.Kind` used to describe the format of a JavaDoc link. Previously the enum values were specific to the context in which a link was used. The new values describe the link format, such as whether to include preview information or type parameters or bounds. Other link properties that previously depended on this enum were moved into separate boolean flags as they are orthogonal to the link format and would have needlessly inflated the enum class. In some other cases the calling code had to be adapted slightly to generate the desired output.
>
> Apart from passing the tests, I made sure the new code generates the exact same output for the JDK documentation as the old code. Doing so I noticed that some generated links were not previously covered by tests. I added tests for these in the existing `TestInterface.java`.
Thanks for the review. I agree there is more potential for future cleanup.
-------------
PR: https://git.openjdk.org/jdk/pull/11972
More information about the javadoc-dev
mailing list