--- old/src/hotspot/share/classfile/classLoader.cpp 2018-04-08 23:07:21.967786888 -0700 +++ new/src/hotspot/share/classfile/classLoader.cpp 2018-04-08 23:07:21.705762197 -0700 @@ -1625,7 +1625,7 @@ break; } else { if ((i >= 1) && - (i < ClassLoaderExt::app_module_paths_start_index())) { + (i < ClassLoaderExt::app_class_paths_start_index())) { // The class must be from -Xbootclasspath/a assert(loader == NULL, "sanity"); classpath_index = i; --- old/src/hotspot/share/memory/filemap.cpp 2018-04-08 23:07:22.692855213 -0700 +++ new/src/hotspot/share/memory/filemap.cpp 2018-04-08 23:07:22.424829956 -0700 @@ -335,6 +335,7 @@ assert(i == num_entries, "number of shared path entry mismatch"); } +// This function should only be called during run time with UseSharedSpaces enabled. bool FileMapInfo::validate_shared_path_table() { _validating_shared_path_table = true; @@ -1009,6 +1010,7 @@ return crc; } +// This function should only be called during run time with UseSharedSpaces enabled. bool FileMapInfo::FileMapHeader::validate() { if (VerifySharedSpaces && compute_crc() != _crc) { fail_continue("Header checksum verification failed."); --- old/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/AppClassInCP.java 2018-04-08 23:07:23.456927214 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/AppClassInCP.java 2018-04-08 23:07:23.169900166 -0700 @@ -97,11 +97,6 @@ "--patch-module=java.naming=" + moduleJar, "-Xlog:class+load", "PatchMain", "javax.naming.spi.NamingManager", "mypackage.Hello") - .assertSilentlyDisabledCDS(out -> { - out.shouldHaveExitValue(0) - .shouldContain("CDS is disabled") - .shouldContain("I pass!") - .shouldContain("Hello!"); - }); + .assertSilentlyDisabledCDS(0, "I pass!", "Hello!"); } } --- old/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/CustomPackage.java 2018-04-08 23:07:24.167994220 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/CustomPackage.java 2018-04-08 23:07:23.881967267 -0700 @@ -79,9 +79,6 @@ "-Xlog:class+load", "-Xlog:class+path=info", "PatchMain", "javax.naming.myspi.NamingManager") - .assertSilentlyDisabledCDS(out -> { - out.shouldHaveExitValue(0) - .shouldContain("I pass!"); - }); + .assertSilentlyDisabledCDS(0, "I pass!"); } } --- old/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/MismatchedPatchModule.java 2018-04-08 23:07:24.879061226 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/MismatchedPatchModule.java 2018-04-08 23:07:24.588033801 -0700 @@ -87,9 +87,6 @@ "--patch-module=java.naming2=" + moduleJar, "-Xlog:class+path=info", "PatchMain", "javax.naming.spi.NamingManager") - .assertSilentlyDisabledCDS(out -> { - out.shouldHaveExitValue(0) - .shouldContain("I pass!"); - }); + .assertSilentlyDisabledCDS(0, "I pass!"); } } --- old/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/Simple.java 2018-04-08 23:07:25.562125592 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/Simple.java 2018-04-08 23:07:25.282099205 -0700 @@ -77,9 +77,6 @@ "-Xlog:class+load", "-Xlog:class+path=info", "PatchMain", "javax.naming.spi.NamingManager") - .assertSilentlyDisabledCDS(out -> { - out.shouldHaveExitValue(0) - .shouldContain("I pass!"); - }); + .assertSilentlyDisabledCDS(0, "I pass!"); } } --- old/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/SubClassOfPatchedClass.java 2018-04-08 23:07:26.289194106 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/SubClassOfPatchedClass.java 2018-04-08 23:07:26.018168567 -0700 @@ -99,10 +99,6 @@ "--patch-module=java.naming=" + moduleJar, "-Xlog:class+load", "PatchMain", "javax.naming.Reference", "mypackage.MyReference") - .assertSilentlyDisabledCDS(out -> { - out.shouldHaveExitValue(0) - .shouldContain("MyReference source: file:") - .shouldContain("I pass!"); - }); + .assertSilentlyDisabledCDS(0, "MyReference source: file:", "I pass!"); } } --- old/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/TwoJars.java 2018-04-08 23:07:27.019262903 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/jigsaw/PatchModule/TwoJars.java 2018-04-08 23:07:26.741236704 -0700 @@ -96,9 +96,6 @@ "-Xlog:class+load", "-Xlog:class+path=info", "PatchMain", "javax.naming.spi.NamingManager") - .assertSilentlyDisabledCDS(out -> { - out.shouldHaveExitValue(0) - .shouldContain("I pass!"); - }); + .assertSilentlyDisabledCDS(0, "I pass!"); } } --- old/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java 2018-04-08 23:07:27.725329437 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java 2018-04-08 23:07:27.442302767 -0700 @@ -90,10 +90,7 @@ opts = new String[argsList.size()]; opts = argsList.toArray(opts); TestCommon.run(opts) - .assertSilentlyDisabledCDS(out -> { - out.shouldHaveExitValue(0) - .shouldContain(EXPECTED_EXCEPTION); - }); + .assertSilentlyDisabledCDS(0, EXPECTED_EXCEPTION); // case 4: load class in bootclasspath using boot loader with '--limit-modules java.base' argsList.remove(argsList.size() - 1); @@ -101,9 +98,6 @@ opts = new String[argsList.size()]; opts = argsList.toArray(opts); TestCommon.run(opts) - .assertSilentlyDisabledCDS(out -> { - out.shouldHaveExitValue(0) - .shouldContain(EXPECTED_EXCEPTION); - }); + .assertSilentlyDisabledCDS(0, EXPECTED_EXCEPTION); } } --- old/test/hotspot/jtreg/runtime/appcds/jigsaw/limitmods/LimitModsTests.java 2018-04-08 23:07:28.423395218 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/jigsaw/limitmods/LimitModsTests.java 2018-04-08 23:07:28.148369302 -0700 @@ -157,9 +157,7 @@ "LimitModsHelper", BOOT_ARCHIVE_CLASS, PLATFORM_ARCHIVE_CLASS, APP_ARCHIVE_CLASS, Integer.toString(excludeModIdx)) // last 4 args passed to test - .assertSilentlyDisabledCDS(out -> { - out.shouldHaveExitValue(0); - }); + .assertSilentlyDisabledCDS(0); limitMods = null; } } --- old/test/lib/jdk/test/lib/cds/CDSTestUtils.java 2018-04-08 23:07:29.166465240 -0700 +++ new/test/lib/jdk/test/lib/cds/CDSTestUtils.java 2018-04-08 23:07:28.873437627 -0700 @@ -166,6 +166,13 @@ return this; } + public Result assertSilentlyDisabledCDS(int exitCode, String... matches) throws Exception { + return assertSilentlyDisabledCDS((out) -> { + out.shouldHaveExitValue(exitCode); + checkMatches(out, matches); + }); + } + public Result ifNormalExit(Checker checker) throws Exception { if (hasNormalExit) { checker.check(output);