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

Maurizio Cimadamore mcimadamore at openjdk.org
Wed Feb 4 19:38:18 UTC 2026


On Wed, 4 Feb 2026 19:31:22 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

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

Marked as reviewed by mcimadamore (Committer).

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

PR Review: https://git.openjdk.org/valhalla/pull/2039#pullrequestreview-3752980776


More information about the valhalla-dev mailing list