< prev index next >

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/LambdaForOldInfInBaseArchive.java

Print this page
*** 59,11 ***
      private static void doTestCustomBase(String topArchiveName) throws Exception {
          String appJar = ClassFileInstaller.getJarPath("old-inf-base-archive.jar");
  
          // create a custom base archive containing and old interface
          OutputAnalyzer output = TestCommon.dump(appJar,
!             TestCommon.list("OldProvider"), "-Xlog:class+load,cds+class=debug");
          TestCommon.checkDump(output);
          // Check that the OldProvider is being dumped into the base archive.
          output.shouldMatch(".cds,class.*klass.*0x.*app.*OldProvider.*unlinked");
  
          String baseArchiveName = TestCommon.getCurrentArchiveName();
--- 59,12 ---
      private static void doTestCustomBase(String topArchiveName) throws Exception {
          String appJar = ClassFileInstaller.getJarPath("old-inf-base-archive.jar");
  
          // create a custom base archive containing and old interface
          OutputAnalyzer output = TestCommon.dump(appJar,
!             TestCommon.list("OldProvider"), "-Xlog:class+load,cds+class=debug",
+             "-XX:-PreloadSharedClasses");
          TestCommon.checkDump(output);
          // Check that the OldProvider is being dumped into the base archive.
          output.shouldMatch(".cds,class.*klass.*0x.*app.*OldProvider.*unlinked");
  
          String baseArchiveName = TestCommon.getCurrentArchiveName();

*** 73,10 ***
--- 74,11 ---
          // accessed using a lambda expression of LambdaContainsOldInfApp.
          // The lambda proxy class and the app class will be archived in the dynamic archive.
          dump2(baseArchiveName, topArchiveName,
                "-Xlog:cds,cds+dynamic,class+load,cds+class=debug",
                "-cp", appJar,
+               "-XX:-PreloadSharedClasses",
                appClass)
              .assertNormalExit(out -> {
                      out.shouldContain("OldProvider source: shared objects file")
                         .shouldMatch("Archiving hidden LambdaContainsOldInfApp[$][$]Lambda*");
                  });
< prev index next >