-
Notifications
You must be signed in to change notification settings - Fork 98
Description
When a client invokes method singleClass()
on org.jboss.jandex.Index
and provides an argument that represents module-info.class
, the method fails with NoSuchElements exception. This is caused by an assumption that a map holding known classes is never empty and therefore it is safe to call .iterator().next()
:
jandex/core/src/main/java/org/jboss/jandex/Index.java
Lines 278 to 283 in f8b6fa8
public static ClassInfo singleClass(Class<?> clazz) throws IOException { | |
Indexer indexer = new Indexer(); | |
indexer.indexClass(clazz); | |
Index index = indexer.complete(); | |
return index.getKnownClasses().iterator().next(); | |
} |
In my case it occurs in WildFly 33.0.1, while trying to examine bean archive candidate Wicket-CDI 10.1.0; the deployment attempt is immediately aborted. When I manually deleted module-info.class
from the Wicket-CDI JAR file, the deployment worked as expected. (The mentioned version of WildFly contains Jandex version 3.2.0 within its system modules.)
I believe the correct response would be to return null
.