Fail to spot NoClassDefFound error for supertype
pettermahlen opened this issue · comments
Petter Måhlén commented
I haven't got the exact example in front of me, but it was similar to:
String something = SomeClass.class.toString();
public class SomeClass implements InterfaceNotOnClassPath {}
The SomeClass.class.toString()
invocation throws a NoClassDefFoundError because SomeClass
fails to load since the interface is not on the class path.
Petter Måhlén commented
This seems to be a case of the following byte code being issued:
LDC LSomeClass;.class
INVOKEVIRTUAL java/lang/Class.getCanonicalName ()Ljava/lang/String;
LDC with a symbolic reference to a class causes that class to be resolved, and it's that resolution that's failing. We should possibly/probably add checks for that kind of class resolution.