diff options
| -rw-r--r-- | src/java_lang_Class.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/java_lang_Class.cc b/src/java_lang_Class.cc index 0ed6ceaad6..9d48edeb96 100644 --- a/src/java_lang_Class.cc +++ b/src/java_lang_Class.cc @@ -116,21 +116,21 @@ jobjectArray Class_getDeclaredFields(JNIEnv* env, jclass, jclass javaClass, jboo std::vector<Field*> fields; for (size_t i = 0; i < c->NumInstanceFields(); ++i) { Field* f = c->GetInstanceField(i); - if (env->ExceptionOccurred()) { - return NULL; - } if (IsVisibleField(f, publicOnly)) { fields.push_back(f); } - } - for (size_t i = 0; i < c->NumStaticFields(); ++i) { - Field* f = c->GetStaticField(i); if (env->ExceptionOccurred()) { return NULL; } + } + for (size_t i = 0; i < c->NumStaticFields(); ++i) { + Field* f = c->GetStaticField(i); if (IsVisibleField(f, publicOnly)) { fields.push_back(f); } + if (env->ExceptionOccurred()) { + return NULL; + } } return ToArray(env, "java/lang/reflect/Field", fields); @@ -153,21 +153,21 @@ jobjectArray Class_getDeclaredMethods(JNIEnv* env, jclass, jclass javaClass, jbo std::vector<Method*> methods; for (size_t i = 0; i < c->NumVirtualMethods(); ++i) { Method* m = c->GetVirtualMethod(i); - if (env->ExceptionOccurred()) { - return NULL; - } if (IsVisibleMethod(m, publicOnly)) { methods.push_back(m); } - } - for (size_t i = 0; i < c->NumDirectMethods(); ++i) { - Method* m = c->GetDirectMethod(i); if (env->ExceptionOccurred()) { return NULL; } + } + for (size_t i = 0; i < c->NumDirectMethods(); ++i) { + Method* m = c->GetDirectMethod(i); if (IsVisibleMethod(m, publicOnly)) { methods.push_back(m); } + if (env->ExceptionOccurred()) { + return NULL; + } } return ToArray(env, "java/lang/reflect/Method", methods); |