In the last spec: https://cr.openjdk.org/~dlsmith/jep401/jep401-20230428/specs/flattened-heap-jvms.html, a NullRestricted attribute is introduced.
It indicates that the field cannot be null. putfield and putstatic will throw NPE if there is an attempt to assigned null to such fields. The null restricted field needs to be initialized to the default instance.
In the last spec: https://cr.openjdk.org/~dlsmith/jep401/jep401-20230428/specs/flattened-heap-jvms.html, a NullRestricted attribute is introduced.
It indicates that the field cannot be null.
putfieldandputstaticwill throw NPE if there is an attempt to assigned null to such fields. The null restricted field needs to be initialized to the default instance.