Fix recursive static field lookup.
Change-Id: I892696e6e98be9f31a7900d10130cae204f9127a
diff --git a/src/object.cc b/src/object.cc
index 6dda684..9724e42 100644
--- a/src/object.cc
+++ b/src/object.cc
@@ -753,10 +753,10 @@
if (IsArrayClass()) {
os << " componentType=" << PrettyClass(GetComponentType()) << "\n";
}
- if (kh.NumInterfaces() > 0) {
- os << " interfaces (" << kh.NumInterfaces() << "):\n";
- for (size_t i = 0; i < kh.NumInterfaces(); ++i) {
- Class* interface = kh.GetInterface(i);
+ if (kh.NumDirectInterfaces() > 0) {
+ os << " interfaces (" << kh.NumDirectInterfaces() << "):\n";
+ for (size_t i = 0; i < kh.NumDirectInterfaces(); ++i) {
+ Class* interface = kh.GetDirectInterface(i);
const ClassLoader* cl = interface->GetClassLoader();
os << StringPrintf(" %2zd: %s (cl=%p)\n", i, PrettyClass(interface).c_str(), cl);
}
@@ -1174,9 +1174,9 @@
}
// Is this field in any of this class' interfaces?
kh.ChangeClass(k);
- for (uint32_t i = 0; i < kh.NumInterfaces(); ++i) {
- Class* interface = kh.GetInterface(i);
- f = interface->FindDeclaredStaticField(name, type);
+ for (uint32_t i = 0; i < kh.NumDirectInterfaces(); ++i) {
+ Class* interface = kh.GetDirectInterface(i);
+ f = interface->FindStaticField(name, type);
if (f != NULL) {
return f;
}
@@ -1195,9 +1195,9 @@
}
// Is this field in any of this class' interfaces?
kh.ChangeClass(k);
- for (uint32_t i = 0; i < kh.NumInterfaces(); ++i) {
- Class* interface = kh.GetInterface(i);
- f = interface->FindDeclaredStaticField(dex_cache, dex_field_idx);
+ for (uint32_t i = 0; i < kh.NumDirectInterfaces(); ++i) {
+ Class* interface = kh.GetDirectInterface(i);
+ f = interface->FindStaticField(dex_cache, dex_field_idx);
if (f != NULL) {
return f;
}
@@ -1221,9 +1221,9 @@
}
// Is this field in any of this class' interfaces?
kh.ChangeClass(k);
- for (uint32_t i = 0; i < kh.NumInterfaces(); ++i) {
- Class* interface = kh.GetInterface(i);
- f = interface->FindDeclaredStaticField(name, type);
+ for (uint32_t i = 0; i < kh.NumDirectInterfaces(); ++i) {
+ Class* interface = kh.GetDirectInterface(i);
+ f = interface->FindStaticField(name, type);
if (f != NULL) {
return f;
}