File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,23 @@ class ClassLoaderSupportImpl extends ClassLoaderSupport {
7676
7777 @ Override
7878 protected boolean isNativeImageClassLoaderImpl (ClassLoader loader ) {
79- return loader == imageClassLoader || loader instanceof NativeImageSystemClassLoader ;
79+ if (loader == imageClassLoader ) {
80+ /* Trivial case */
81+ return true ;
82+ }
83+ if (loader == classLoaderSupport .classPathClassLoader ) {
84+ /*
85+ * If imageClassLoader is a module classloader (building image with non-empty
86+ * NativeImageClassLoaderSupport.imagemp), the passed loader could also be our
87+ * classLoaderSupport.classPathClassLoader (building image with non-empty
88+ * NativeImageClassLoaderSupport.imagecp).
89+ */
90+ return true ;
91+ }
92+ if (loader instanceof NativeImageSystemClassLoader ) {
93+ return true ;
94+ }
95+ return false ;
8096 }
8197
8298 @ Override
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ public class NativeImageClassLoaderSupport {
9595 private final EconomicMap <URI , EconomicSet <String >> packages ;
9696 private final EconomicSet <String > emptySet ;
9797
98- private final URLClassLoader classPathClassLoader ;
98+ final URLClassLoader classPathClassLoader ;
9999 private final ClassLoader modulePathClassLoader ;
100100
101101 public final ModuleFinder upgradeAndSystemModuleFinder ;
You can’t perform that action at this time.
0 commit comments