Fix for test 069.
Can't throw exception in fast interface lookup. Extra debugging that
methods look sane when creating native to managed records.
Change-Id: If0b970c418db5ff075334af8359541a94e8680b7
diff --git a/src/object.cc b/src/object.cc
index 558978c..281f685 100644
--- a/src/object.cc
+++ b/src/object.cc
@@ -990,7 +990,7 @@
new_class_loader, false);
}
-Method* Class::FindVirtualMethodForInterface(Method* method) {
+Method* Class::FindVirtualMethodForInterface(Method* method, bool can_throw) {
Class* declaring_class = method->GetDeclaringClass();
DCHECK(declaring_class != NULL) << PrettyClass(this);
DCHECK(declaring_class->IsInterface()) << PrettyMethod(method);
@@ -1003,10 +1003,12 @@
return interface_entry->GetMethodArray()->Get(method->GetMethodIndex());
}
}
- Thread::Current()->ThrowNewExceptionF("Ljava/lang/IncompatibleClassChangeError;",
- "Class %s does not implement interface %s",
- PrettyDescriptor(GetDescriptor()).c_str(),
- PrettyDescriptor(declaring_class->GetDescriptor()).c_str());
+ if (can_throw) {
+ Thread::Current()->ThrowNewExceptionF("Ljava/lang/IncompatibleClassChangeError;",
+ "Class %s does not implement interface %s",
+ PrettyDescriptor(GetDescriptor()).c_str(),
+ PrettyDescriptor(declaring_class->GetDescriptor()).c_str());
+ }
return NULL;
}