On Wed, 12 Nov 2025 17:26:00 GMT, Jan Lahoda <[email protected]> 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`).

This pull request has now been integrated.

Changeset: 5d3e73b9
Author:    Jan Lahoda <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/5d3e73b9e512b55cdf554158b19a4ec642dc1f1a
Stats:     33 lines in 3 files changed: 30 ins; 0 del; 3 mod

8371248: Crash in -Xdoclint with invalid @link

Reviewed-by: hannesw, vromero

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

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

Reply via email to