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

Jan Lahoda jlahoda at openjdk.org
Thu Nov 13 07:52:19 UTC 2025


> 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:

  More appropriate handling of parameterized types in Attr.attribIdent.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/28272/files
  - new: https://git.openjdk.org/jdk/pull/28272/files/ea99a0f1..3a6f37e2

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

  Stats: 27 lines in 2 files changed: 27 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/28272.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28272/head:pull/28272

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


More information about the javadoc-dev mailing list