/* XXX This should be done better. */
tc = resolve_classref_or_classinfo_eager(CLASSREF_OR_CLASSINFO(cr), false);
- if (tc == NULL)
+ if (tc == NULL) {
+ resolve_handle_pending_exception(true);
return false;
+ }
/* Detect circularity. */
class x extends y {}
class y {}
- public void test() {
+ public void testSuperClass() {
// Delete the class file which is extended.
new File("PR58$y.class").delete();
assertTrue(success.getCause() instanceof ClassNotFoundException);
}
}
+
+ interface i {}
+ class j implements i {}
+
+ public void testSuperInterface() {
+ // Delete the interface file which is implemented.
+ new File("PR58$i.class").delete();
+
+ try {
+ Class.forName("PR58$j");
+ fail("Should throw NoClassDefFoundError");
+ }
+ catch (ClassNotFoundException error) {
+ fail("Unexpected exception: " + error);
+ }
+ catch (NoClassDefFoundError success) {
+ // Check if the cause is correct.
+ assertTrue(success.getCause() instanceof ClassNotFoundException);
+ }
+ }
}