Skip to content

Commit

Permalink
[LOGMGR-336] Merge pull request #426 from geoand/quarkus-#33318
Browse files Browse the repository at this point in the history
Introduce extra indirection in `ObjectBuilder$ModuleFinder`
  • Loading branch information
jamezp committed Aug 8, 2023
2 parents bd5bdd6 + 7afd61a commit 7124ec2
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,18 @@ private ModuleFinder() {
}

static ClassLoader getClassLoader(final String moduleName) throws Exception {
ModuleLoader moduleLoader = ModuleLoader.forClass(ModuleFinder.class);
if (moduleLoader == null) {
moduleLoader = Module.getBootModuleLoader();
return Holder.getClassLoader(moduleName);
}

private static class Holder {

static ClassLoader getClassLoader(final String moduleName) throws Exception {
ModuleLoader moduleLoader = ModuleLoader.forClass(ModuleFinder.class);
if (moduleLoader == null) {
moduleLoader = Module.getBootModuleLoader();
}
return moduleLoader.loadModule(moduleName).getClassLoader();
}
return moduleLoader.loadModule(moduleName).getClassLoader();
}
}

Expand Down

0 comments on commit 7124ec2

Please sign in to comment.