--- old/test/hotspot/jtreg/runtime/appcds/UseAppCDS.java 2018-04-24 20:05:19.504755888 -0400 +++ new/test/hotspot/jtreg/runtime/appcds/UseAppCDS.java 2018-04-24 20:05:17.836659845 -0400 @@ -74,36 +74,33 @@ pb = new ProcessBuilder(jar.getCommand()); TestCommon.executeAndLog(pb, "jar02").shouldHaveExitValue(0); - // In all tests the BOOTCLASS should be loaded/dumped/used + // In all tests the BOOTCLASS and TESTNAME should be loaded/dumped/used - // Test 1: No AppCDS - dumping loaded classes excludes the "test" classes - dumpLoadedClasses(false, new String[] { BOOTCLASS }, - new String[] { TESTNAME }); + // Test 1: -XX:-UseAppCDS - No effect, dumping loaded classes includes "test" classes + dumpLoadedClasses(false, new String[] { BOOTCLASS, TESTNAME }, + new String[0]); - // Test 2: AppCDS - dumping loaded classes includes "test" classes + // Test 2: -XX:+UseAppCDS - dumping loaded classes includes "test" classes dumpLoadedClasses(true, new String[] { BOOTCLASS, TESTNAME }, new String[0]); // Next tests rely on the classlist we just dumped - // Test 3: No AppCDS - "test" classes in classlist ignored when dumping - // Although AppCDS isn't used, all classes will be found during dumping - // after the fix for JDK-8193434. Classes which are not in the boot - // loader dictionary will not be saved into the archive. - dumpArchive(false, new String[] { BOOTCLASS }, + // Test 3: -XX:-UseAppCDS - No effect, "test" classes in classlist are dumped + dumpArchive(false, new String[] { BOOTCLASS, TESTNAME }, new String[0]); - // Test 4: AppCDS - "test" classes in classlist are dumped + // Test 4: -XX:+UseAppCDS - "test" classes in classlist are dumped dumpArchive(true, new String[] { BOOTCLASS, TESTNAME }, new String[0]); // Next tests rely on the archive we just dumped - // Test 5: No AppCDS - Using archive containing "test" classes ignores them - useArchive(false, new String[] { BOOTCLASS }, - new String[] { TESTNAME }); + // Test 5: -XX:-UseAppCDS - No effect, using archive containing "test" loads them + useArchive(false, new String[] { BOOTCLASS, TESTNAME }, + new String[0]); - // Test 6: AppCDS - Using archive containing "test" classes loads them + // Test 6: -XX:+UseAppCDS - Using archive containing "test" classes loads them useArchive(true, new String[] { BOOTCLASS, TESTNAME }, new String[0]); } @@ -129,7 +126,7 @@ "-XX:DumpLoadedClassList=" + CLASSLIST_FILE, "-cp", TESTJAR, - useAppCDS ? "-XX:+UseAppCDS" : "-XX:-UseAppCDS", + (useAppCDS) ? "-XX:+UseAppCDS" : "-XX:-UseAppCDS", TESTNAME, TEST_OUT)); @@ -156,8 +153,6 @@ String[] unexpectedClasses) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, TestCommon.makeCommandLineForAppCDS( - useAppCDS ? "-XX:-UnlockDiagnosticVMOptions" : - "-XX:+UnlockDiagnosticVMOptions", "-cp", TESTJAR, useAppCDS ? "-XX:+UseAppCDS" : "-XX:-UseAppCDS", @@ -183,8 +178,6 @@ String[] unexpectedClasses) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, TestCommon.makeCommandLineForAppCDS( - useAppCDS ? "-XX:-UnlockDiagnosticVMOptions" : - "-XX:+UnlockDiagnosticVMOptions", "-cp", TESTJAR, useAppCDS ? "-XX:+UseAppCDS" : "-XX:-UseAppCDS",