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

Chen Liang liach at openjdk.org
Wed Feb 4 20:51:21 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.

Before we proceed, let me see if we can patch classFileParser to detect ACC_NULL_CHECKED and make it behave like NullRestricted.

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

PR Comment: https://git.openjdk.org/valhalla/pull/2039#issuecomment-3849675257


More information about the valhalla-dev mailing list