RFR: Support for transient jdk.internal.vm.annotation.NullRestricted.
Jan Lahoda
jlahoda at openjdk.org
Thu Feb 5 07:25:20 UTC 2026
On Wed, 4 Feb 2026 21:48:23 GMT, Chen Liang <liach 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.
>
> I have created a VM-side fix in #2041, we don't need to hack CreateSymbols and javac any more.
Thanks @liach - seems to work well!
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/2039#issuecomment-3851507936
More information about the valhalla-dev
mailing list