Fix Class_getDeclaredConstructorOrMethod to look at direct as well as virtual methods
Change-Id: Ibc34e3e55b408b2ef04e439960c63fb6e98d06eb
diff --git a/src/dex_file.cc b/src/dex_file.cc
index c17a225..7c54018 100644
--- a/src/dex_file.cc
+++ b/src/dex_file.cc
@@ -435,7 +435,6 @@
}
const DexFile::ClassDef* DexFile::FindClassDef(const StringPiece& descriptor) const {
- CHECK(!descriptor.empty());
Index::const_iterator it = index_.find(descriptor);
if (it == index_.end()) {
return NULL;
diff --git a/src/dex_verifier.cc b/src/dex_verifier.cc
index e0032b2..a800f20 100644
--- a/src/dex_verifier.cc
+++ b/src/dex_verifier.cc
@@ -3589,7 +3589,7 @@
}
DCHECK_LT(*start_guess, insns_size);
- DCHECK(InsnGetWidth(insn_flags, *start_guess) != 0);
+ DCHECK_NE(InsnGetWidth(insn_flags, *start_guess), 0);
return true;
}
diff --git a/src/java_lang_Class.cc b/src/java_lang_Class.cc
index 3e80c6b..8ad59b4 100644
--- a/src/java_lang_Class.cc
+++ b/src/java_lang_Class.cc
@@ -51,7 +51,7 @@
DCHECK(name->IsString());
Object* signature_obj = Decode<Object*>(env, jsignature);
DCHECK(signature_obj->IsArrayInstance());
- // check that this is a Class[] by checkin that component type is Class
+ // check that this is a Class[] by checking that component type is Class
// foo->GetClass()->GetClass() is an idiom for getting java.lang.Class from an arbitrary object
DCHECK(signature_obj->GetClass()->GetComponentType() == signature_obj->GetClass()->GetClass());
ObjectArray<Class>* signature = down_cast<ObjectArray<Class>*>(signature_obj);
@@ -80,8 +80,8 @@
return AddLocalReference<jobject>(env, method);
}
- for (size_t i = 0; i < klass->NumVirtualMethods(); ++i) {
- Method* method = klass->GetVirtualMethod(i);
+ for (size_t i = 0; i < klass->NumDirectMethods(); ++i) {
+ Method* method = klass->GetDirectMethod(i);
if (!method->GetName()->Equals(name)) {
continue;
}