Class_newInstanceImpl should use FindDeclaredDirectMethod
Otherwise it will find Object.<init>()
Change-Id: I35cd12100c641fd9c8b729f27ac3f1dd1cdf4f86
diff --git a/src/java_lang_Class.cc b/src/java_lang_Class.cc
index 8d1a173..c2cca5b 100644
--- a/src/java_lang_Class.cc
+++ b/src/java_lang_Class.cc
@@ -352,7 +352,7 @@
return NULL;
}
- Method* init = c->FindDirectMethod("<init>", "()V");
+ Method* init = c->FindDeclaredDirectMethod("<init>", "()V");
if (init == NULL) {
Thread::Current()->ThrowNewExceptionF("Ljava/lang/InstantiationException;",
"Class %s has no default <init>()V constructor", PrettyDescriptor(ClassHelper(c).GetDescriptor()).c_str());