JDK-8376045 gives HotSpot the ability to infer ACC_STRICT_INIT from the @NullRestricted annotation, without it needing to be explicit in the class file.
With that change, tests that use @NullRestricted can stop using the @Strict annotation and prepare to adopt `!` in the future.
The language rules for `!` don't do anything to reorder field initializers. As a result, any tests with @NullRestricted fields in identity classes will have to be adjusted so that the field is initialized inside an explicit constructor, before an explicit super() call.
From a quick grep, here is where @NullRestricted gets used:
hotspot/jtreg/compiler: 203 uses
hotspot/jtreg/runtime: 125 uses
hotspot/jtreg/serviceability: 13 uses
micro: 38 uses
jdk: 23 uses
With that change, tests that use @NullRestricted can stop using the @Strict annotation and prepare to adopt `!` in the future.
The language rules for `!` don't do anything to reorder field initializers. As a result, any tests with @NullRestricted fields in identity classes will have to be adjusted so that the field is initialized inside an explicit constructor, before an explicit super() call.
From a quick grep, here is where @NullRestricted gets used:
hotspot/jtreg/compiler: 203 uses
hotspot/jtreg/runtime: 125 uses
hotspot/jtreg/serviceability: 13 uses
micro: 38 uses
jdk: 23 uses
- blocks
-
JDK-8376047 [lworld] Remove javac special treatment of @Strict
-
- Open
-
- is blocked by
-
JDK-8376045 [lworld] Treat @NullRestricted fields as ACC_STRICT_INIT on load
-
- New
-
- relates to
-
JDK-8376033 [lworld] Remove auto early construction from strict fields
-
- New
-