Add classname to "Required class information is missing" error
vlsi opened this issue · comments
The error message is hard to understand, and the root cause is not clear.
What do you think if the error includes the class name or something else for making the exception actionable?
The current exception:
Caused by: java.lang.IllegalStateException: Required class information is missing
at org.jboss.jandex.Indexer.rebuildNestedType(Indexer.java:926)
at org.jboss.jandex.Indexer.resolveTypePath(Indexer.java:786)
at org.jboss.jandex.Indexer.resolveTypeAnnotation(Indexer.java:705)
at org.jboss.jandex.Indexer.resolveTypeAnnotations(Indexer.java:613)
at org.jboss.jandex.Indexer.index(Indexer.java:1602)
at org.hibernate.boot.archive.scan.spi.ClassFileArchiveEntryHandler.toClassDescriptor(ClassFileArchiveEntryHandler.java:64)
at org.hibernate.boot.archive.scan.spi.ClassFileArchiveEntryHandler.handleEntry(ClassFileArchiveEntryHandler.java:52)
Another exception:
Caused by: java.lang.IllegalStateException: Class extends type annotation appeared on a non class target
at org.jboss.jandex.Indexer.processTypeAnnotation(Indexer.java:538)
at org.jboss.jandex.Indexer.processTypeAnnotations(Indexer.java:515)
at org.jboss.jandex.Indexer.processAttributes(Indexer.java:355)
at org.jboss.jandex.Indexer.processMethodInfo(Indexer.java:306)
at org.jboss.jandex.Indexer.index(Indexer.java:1602)
thanks for the report
Reproducer:
public static class IteratorSupplier implements Supplier<Consumer<@Nullable Object[]>> {
@Override
public Consumer<@Nullable Object[]> get() {
return new Consumer<@Nullable Object[]>() {
@Override
public void accept(@Nullable Object[] objects) {
}
};
}
}
Then parse IteratorSupplier$1.class
(==class file for the anonymous new Consumer
)
Signature as compiled with javac
1.8u222:
Signature: #28 // Ljava/lang/Object;Ljava/util/function/Consumer<[Ljava/lang/Object;>;
SourceFile: "BridgeMethodTest.java"
RuntimeVisibleTypeAnnotations:
0: #25(): CLASS_EXTENDS, type_index=0, location=[INNER_TYPE, TYPE_ARGUMENT(0), ARRAY]
org.checkerframework.checker.nullness.qual.Nullable
This might be relevant: https://bugs.openjdk.java.net/browse/JDK-8198945, so it might be yet another javac
issue :-/