[Leyden] Class is not initialized with ArchiveLoaderLookupCache optimization

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • repo-leyden
    • Affects Version/s: repo-leyden
    • Component/s: core-libs
    • None

      When running with an AOT cache created with the ArchiveLoaderLookupCache optimization, the following AOTJCK tests fail because Class.forName() does not initialize the class that it returns.

      lang/STMT/stmt311/stmt31101/stmt31101_rt.html
      vm/constantpool/Initialization/Initialization008/Initialization00801m025/Initialization00801m025.html
      vm/instr/getfield/getfield013/getfield01306m001/getfield01306m001.html
      api/java_lang/Class/ForName1.html
      vm/constantpool/Initialization/Initialization008/Initialization00801m025/Initialization00801m025.html
      vm/constantpool/Initialization/Initialization008/Initialization00801m026/Initialization00801m026.html
      vm/constantpool/Initialization/Initialization008/Initialization00801m027/Initialization00801m027.html
      vm/constantpool/Initialization/Initialization008/Initialization00801m028/Initialization00801m028.html
      vm/constantpool/Initialization/Initialization008/Initialization00801m029/Initialization00801m029.html
      vm/constantpool/Initialization/Initialization008/Initialization00801m030/Initialization00801m030.html
      vm/instr/getfield/getfield013/getfield01306m001/getfield01306m001.html
      vm/instr/getfield/getfield013/getfield01306m002/getfield01306m002.html

      The fix is to call Unsafe.getUnsafe().ensureClassInitialized(...) when required by the Class.forName() API.

            Assignee:
            Unassigned
            Reporter:
            Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: