[lworld] RFR: 8376045: [lworld] Treat @NullRestricted fields as ACC_STRICT_INIT on load
Chen Liang
liach at openjdk.org
Thu Jan 22 23:56:25 UTC 2026
On Thu, 22 Jan 2026 21:40:30 GMT, Chen Liang <liach at openjdk.org> wrote:
> Automatically inject strict for NR annotations, and remove tests that previously kept them separate.
Currently `@NullRestricted` requires annotated field type to be a value class, which means the source code always uses preview features and would be marked as such, at least in our code base.
The non-preview class scenario is possible with users annotating a migrated value class field plus opening up jdk internals, don't know what we should do in this case - Given this annotation is expected to be revisited in bworld, wonder if it's worth adding extra checks.
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/1951#issuecomment-3787419362
More information about the valhalla-dev
mailing list