--- old/test/hotspot/jtreg/runtime/cds/appcds/RewriteBytecodesTest.java 2019-08-09 10:19:50.777030370 -0700 +++ new/test/hotspot/jtreg/runtime/cds/appcds/RewriteBytecodesTest.java 2019-08-09 10:19:50.076004906 -0700 @@ -24,14 +24,14 @@ /* * @test - * @summary Use ClassLoader.defineClass() to load a class with rewritten bytecode. Make sure + * @summary Use Lookup.defineClass() to load a class with rewritten bytecode. Make sure * the archived class with the same name is not loaded. * @requires vm.cds * @library /test/lib * @modules java.base/jdk.internal.misc * java.management * jdk.jartool/sun.tools.jar - * @compile test-classes/RewriteBytecodes.java test-classes/Util.java test-classes/Super.java test-classes/Child.java + * @compile test-classes/RewriteBytecodes.java test-classes/Util.java test-classes/Super.java test-classes/Child.java test-classes/Hello.java * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver RewriteBytecodesTest @@ -45,7 +45,7 @@ String wbJar = JarBuilder.build(true, "WhiteBox", "sun/hotspot/WhiteBox"); String use_whitebox_jar = "-Xbootclasspath/a:" + wbJar; - String appJar = JarBuilder.build("dynamic_define", "RewriteBytecodes", "Util", "Super", "Child"); + String appJar = JarBuilder.build("dynamic_define", "RewriteBytecodes", "Util", "Super", "Child", "Hello"); String superClsFile = (new File(System.getProperty("test.classes", "."), "Super.class")).getPath(); TestCommon.dump(appJar, TestCommon.list("RewriteBytecodes", "Super", "Child"), @@ -54,7 +54,6 @@ OutputAnalyzer output = TestCommon.exec(appJar, // command-line arguments ... - "--add-opens=java.base/java.lang=ALL-UNNAMED", use_whitebox_jar, "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", --- old/test/hotspot/jtreg/runtime/cds/appcds/customLoader/LoaderSegregationTest.java 2019-08-09 10:19:52.467091758 -0700 +++ new/test/hotspot/jtreg/runtime/cds/appcds/customLoader/LoaderSegregationTest.java 2019-08-09 10:19:51.762066149 -0700 @@ -39,6 +39,7 @@ * test-classes/OnlyBuiltin.java * test-classes/OnlyUnregistered.java * ../test-classes/Util.java + * ../test-classes/Hello.java * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * @run driver LoaderSegregationTest @@ -74,7 +75,7 @@ String customJarPath = JarBuilder.build("LoaderSegregation_custom", "CustomLoadee", "CustomLoadee2", "CustomInterface2_ia", "CustomInterface2_ib", "CustomLoadee3", "CustomLoadee3Child", - "OnlyBuiltin", "OnlyUnregistered"); + "OnlyBuiltin", "OnlyUnregistered", "Hello"); // Dump the archive String classlist[] = new String[] { @@ -112,8 +113,6 @@ output = TestCommon.exec(TestCommon.concatPaths(appJar, app2Jar), // command-line arguments ... - "--add-opens=java.base/java.lang=ALL-UNNAMED", - "--add-opens=java.base/java.security=ALL-UNNAMED", use_whitebox_jar, "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", --- old/test/hotspot/jtreg/runtime/cds/appcds/test-classes/Util.java 2019-08-09 10:19:54.448163716 -0700 +++ new/test/hotspot/jtreg/runtime/cds/appcds/test-classes/Util.java 2019-08-09 10:19:53.747138253 -0700 @@ -23,21 +23,24 @@ */ import java.io.*; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodHandles.Lookup; +import static java.lang.invoke.MethodHandles.*; import java.lang.reflect.*; import java.util.jar.*; public class Util { /** - * Invoke the loader.defineClass() class method to define the class stored in clsFile, + * Invoke the lookup.defineClass() class method to define the class stored in clsFile, * with the following modification: *