ClassListParser::load_current_class() tries to archive a boot class from -Xbootclasspath/a into the unnamed package, even if the module system forbids this class from being defined in the unnamed package.
https://github.com/openjdk/jdk/blob/b482733f94a46f4d0984de7ba55ddb52ad6db34c/src/hotspot/share/classfile/classListParser.cpp#L598
Such classes, even if archived, won't be usable at runtime anyway. The only test case affected by the above code is test/hotspot/jtreg/runtime/cds/appcds/jigsaw/classpathtests/BootAppendTests.java, which asserts that such class must be archived, but also asserts that such archived classes cannot be used at runtime. So the first assert seems unnecessary and should be removed.
=======
Details: BootAppendTests.java tries to archive the class com/sun/tools/javac/MyMain from -Xbootclasspath/a into the unnamed module, but this package is part of the jdk.compiler module, so the module system correctly refuses to load MyMain into the unnamed module. The above referenced line will call into a low level API to force MyMain to be loaded by the boot loader, circumventing the module system.
https://github.com/openjdk/jdk/blob/b482733f94a46f4d0984de7ba55ddb52ad6db34c/src/hotspot/share/classfile/classListParser.cpp#L598
Such classes, even if archived, won't be usable at runtime anyway. The only test case affected by the above code is test/hotspot/jtreg/runtime/cds/appcds/jigsaw/classpathtests/BootAppendTests.java, which asserts that such class must be archived, but also asserts that such archived classes cannot be used at runtime. So the first assert seems unnecessary and should be removed.
=======
Details: BootAppendTests.java tries to archive the class com/sun/tools/javac/MyMain from -Xbootclasspath/a into the unnamed module, but this package is part of the jdk.compiler module, so the module system correctly refuses to load MyMain into the unnamed module. The above referenced line will call into a low level API to force MyMain to be loaded by the boot loader, circumventing the module system.
- relates to
-
JDK-8261480 MetaspaceShared::preload_and_dump should check exceptions
-
- Resolved
-