Tests to exercise non-null value class field layouts do so via the @jdk.internal.vm.annotation.NullRestricted annotation. Today, these fields must be marked with @Strict as well, and then javac gives them special treatment during compilation.
Eventually, these tests will be written with !, and javac will compile the fields using strict initialization rules. In the mean time, javac's behavior is ad hoc and inappropriate for a standard JDK release.
Until the language feature is ready, HotSpot should simply recognize that any field marked with @NullRestricted is implicitly ACC_STRICT_INIT, and validate the class accordingly. (HotSpot already recognizes @NullRestricted as a trigger for special behaviors, so this is just one more thing.)
This will free javac from the obligation to do anything special with the annotation, and (with some other changes) allow us to remove the @Strict annotation entirely.
Eventually, these tests will be written with !, and javac will compile the fields using strict initialization rules. In the mean time, javac's behavior is ad hoc and inappropriate for a standard JDK release.
Until the language feature is ready, HotSpot should simply recognize that any field marked with @NullRestricted is implicitly ACC_STRICT_INIT, and validate the class accordingly. (HotSpot already recognizes @NullRestricted as a trigger for special behaviors, so this is just one more thing.)
This will free javac from the obligation to do anything special with the annotation, and (with some other changes) allow us to remove the @Strict annotation entirely.
- blocks
-
JDK-8376046 [lworld] Adjust @NullRestricted tests for explicit early initialization
-
- New
-
- relates to
-
JDK-8376033 [lworld] Remove auto early construction from strict fields
-
- New
-