[lworld] Adjust @NullRestricted tests to remove @Strict

XMLWordPrintable

      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

      In this bug, we will replace the combinations of both @NR and @Strict to be @NR only.

      This requires both of the prerequisites to be completed.
      The remaining @Strict will be treated by JDK-8376043.

            Assignee:
            Chen Liang
            Reporter:
            Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: