In our scenario we get a NullPointerException in JBossClassLoaderHandler#findClasspathOrder
The moduleMap is null in our case, leading to an NPE in the next line, when accessing the entrySet.
|
final Map<Object, Object> moduleMap = (Map<Object, Object>) ReflectionUtils.getFieldVal(false, |
|
callerModuleLoader, "moduleMap"); |
|
for (final Entry<Object, Object> ent : moduleMap.entrySet()) { |
I was able to fix this with a simple null check. The scan returns the expected results.
Before:
for (final Entry<Object, Object> ent : moduleMap.entrySet() ) {
After:
Set<Entry<Object, Object>> moduleMapEntries = moduleMap != null ? moduleMap.entrySet() : Collections.emptySet(); for (final Entry<Object, Object> ent : moduleMapEntries) {
In our scenario we get a
NullPointerExceptioninJBossClassLoaderHandler#findClasspathOrderThe
moduleMapis null in our case, leading to an NPE in the next line, when accessing the entrySet.classgraph/src/main/java/nonapi/io/github/classgraph/classloaderhandler/JBossClassLoaderHandler.java
Lines 213 to 215 in f874380
I was able to fix this with a simple null check. The scan returns the expected results.
Before:
for (final Entry<Object, Object> ent : moduleMap.entrySet() ) {After:
Set<Entry<Object, Object>> moduleMapEntries = moduleMap != null ? moduleMap.entrySet() : Collections.emptySet(); for (final Entry<Object, Object> ent : moduleMapEntries) {