[lworld] Adjust @NullRestricted tests for explicit early initialization

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: repo-valhalla
    • Component/s: hotspot
    • None

      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

            Assignee:
            Dan Smith
            Reporter:
            Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: