8168797: do not load any archived classes from a patched module

Add new runtime shared class visibility check to ensure shared classes from patched module are not loaded at runtime.

Reviewed-by: acorn, ccheung, hseigel, iklam, lfoltan
This commit is contained in:
Jiangli Zhou 2016-12-19 13:54:33 -05:00
parent a601028e0f
commit bae7bbd382
9 changed files with 31 additions and 210 deletions

View file

@ -52,7 +52,7 @@ public class PatchModuleCDS {
new OutputAnalyzer(pb.start())
.shouldContain("ro space:"); // Make sure archive got created.
// Case 2: Test that only jar file in --patch-module is supported for CDS dumping
// Case 2: Test that directory in --patch-module is supported for CDS dumping
// Create a class file in the module java.base.
String source = "package javax.naming.spi; " +
"public class NamingManager { " +
@ -73,7 +73,7 @@ public class PatchModuleCDS {
"-Xlog:class+path=info",
"-version");
new OutputAnalyzer(pb.start())
.shouldContain("--patch-module requires a regular file during dumping");
.shouldContain("ro space:"); // Make sure archive got created.
// Case 3a: Test CDS dumping with jar file in --patch-module
BasicJarBuilder.build("javanaming", "javax/naming/spi/NamingManager");