mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8237878: Improve ModuleLoaderMap datastructures
Reviewed-by: alanb, forax
This commit is contained in:
parent
c23d1de2f8
commit
326a939e1b
5 changed files with 104 additions and 81 deletions
|
@ -1094,13 +1094,14 @@ public final class Module implements AnnotatedElement {
|
|||
|
||||
// map each module to a class loader
|
||||
ClassLoader pcl = ClassLoaders.platformClassLoader();
|
||||
boolean isModuleLoaderMapper = ModuleLoaderMap.isBuiltinMapper(clf);
|
||||
|
||||
for (int index = 0; index < numModules; index++) {
|
||||
String name = resolvedModules[index].name();
|
||||
ClassLoader loader = clf.apply(name);
|
||||
|
||||
if (loader == null || loader == pcl) {
|
||||
if (!(clf instanceof ModuleLoaderMap.Mapper)) {
|
||||
if (!isModuleLoaderMapper) {
|
||||
throw new IllegalArgumentException("loader can't be 'null'"
|
||||
+ " or the platform class loader");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue