RFR: 8371248: Crash in -Xdoclint with invalid @link [v4]

Vicente Romero vromero at openjdk.org
Fri Nov 14 22:17:07 UTC 2025


On Thu, 13 Nov 2025 14:25:04 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

>> The attribution of javadoc links fails with an NPE if the link is like `{@link double.NAN Bad}` - it tries to dereference the `double`, which obviously cannot work.
>> 
>> This PR mostly just adds checks that will stop the attribution, and return `null`.
>> 
>> Note that for `{@link double Class}` the existing code does not crash and returns the internal a `TypeElement` corresponding to the `double`. This is a weird quirk of this API, and is preserved with this PR (although a test is added for it into `test/langtools/tools/javac/doctree/ReferenceTest.java`).
>
> Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Removing unnecessary imports as suggested.

lgtm

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

Marked as reviewed by vromero (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28272#pullrequestreview-3467035920


More information about the javadoc-dev mailing list