RFR: Support for transient jdk.internal.vm.annotation.NullRestricted.

Jan Lahoda jlahoda at openjdk.org
Wed Feb 4 19:38:17 UTC 2026


Please see:
https://mail.openjdk.org/pipermail/valhalla-dev/2026-February/018513.html

This is an interaction between how `--release` works, the source launcher's use of `--release` and the (I believe) temporary use of non-public `jdk.internal.vm.annotation.NullRestricted`.

- the source launcher will use an automatic `--release` parameter for the internal javac run.
- the `--release` data (mostly) do not contain non-exported, non-public types. There is a handful of exceptions that are needed to keep the semantics correct, like java.lang.AbstractStringBuilder and jdk.internal.event.Event.
- in bworld, javac will insert a synthetic annotation @jdk.internal.vm.annotation.NullRestricted, and since the annotation is not on the system path, as it is not in the `--release` data, the compilation will fail.

My understanding is that the use of @jdk.internal.vm.annotation.NullRestricted is temporary/transient. This PR adds a (transient) support for keeping the annotation in ct.sym, only for the current/development JDK version.

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

Commit messages:
 - Support for transient jdk.internal.vm.annotation.NullRestricted.

Changes: https://git.openjdk.org/valhalla/pull/2039/files
  Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=2039&range=00
  Stats: 66 lines in 2 files changed: 60 ins; 0 del; 6 mod
  Patch: https://git.openjdk.org/valhalla/pull/2039.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/2039/head:pull/2039

PR: https://git.openjdk.org/valhalla/pull/2039


More information about the valhalla-dev mailing list