Stop saying "clazz".
Change-Id: I569a3d29f6a394ee40e6dbdb8f76ae9a60348b65
diff --git a/src/check_jni.cc b/src/check_jni.cc
index b39b521..c724eb2 100644
--- a/src/check_jni.cc
+++ b/src/check_jni.cc
@@ -310,13 +310,13 @@
}
/*
- * Verify that "mid" is appropriate for "clazz".
+ * Verify that "mid" is appropriate for "java_class".
*
* A mismatch isn't dangerous, because the jmethodID defines the class. In
- * fact, jclazz is unused in the implementation. It's best if we don't
+ * fact, java_class is unused in the implementation. It's best if we don't
* allow bad code in the system though.
*
- * Instances of "jclazz" must be instances of the method's declaring class.
+ * Instances of "java_class" must be instances of the method's declaring class.
*/
void CheckStaticMethod(jclass java_class, jmethodID mid) {
ScopedJniThreadState ts(env_);
@@ -1170,14 +1170,14 @@
return CHECK_JNI_EXIT("c", baseEnv(env)->FindClass(env, name));
}
- static jclass GetSuperclass(JNIEnv* env, jclass clazz) {
- CHECK_JNI_ENTRY(kFlag_Default, "Ec", env, clazz);
- return CHECK_JNI_EXIT("c", baseEnv(env)->GetSuperclass(env, clazz));
+ static jclass GetSuperclass(JNIEnv* env, jclass c) {
+ CHECK_JNI_ENTRY(kFlag_Default, "Ec", env, c);
+ return CHECK_JNI_EXIT("c", baseEnv(env)->GetSuperclass(env, c));
}
- static jboolean IsAssignableFrom(JNIEnv* env, jclass clazz1, jclass clazz2) {
- CHECK_JNI_ENTRY(kFlag_Default, "Ecc", env, clazz1, clazz2);
- return CHECK_JNI_EXIT("b", baseEnv(env)->IsAssignableFrom(env, clazz1, clazz2));
+ static jboolean IsAssignableFrom(JNIEnv* env, jclass c1, jclass c2) {
+ CHECK_JNI_ENTRY(kFlag_Default, "Ecc", env, c1, c2);
+ return CHECK_JNI_EXIT("b", baseEnv(env)->IsAssignableFrom(env, c1, c2));
}
static jmethodID FromReflectedMethod(JNIEnv* env, jobject method) {
@@ -1208,9 +1208,9 @@
return CHECK_JNI_EXIT("I", baseEnv(env)->Throw(env, obj));
}
- static jint ThrowNew(JNIEnv* env, jclass clazz, const char* message) {
- CHECK_JNI_ENTRY(kFlag_NullableUtf, "Ecu", env, clazz, message);
- return CHECK_JNI_EXIT("I", baseEnv(env)->ThrowNew(env, clazz, message));
+ static jint ThrowNew(JNIEnv* env, jclass c, const char* message) {
+ CHECK_JNI_ENTRY(kFlag_NullableUtf, "Ecu", env, c, message);
+ return CHECK_JNI_EXIT("I", baseEnv(env)->ThrowNew(env, c, message));
}
static jthrowable ExceptionOccurred(JNIEnv* env) {
@@ -1299,28 +1299,28 @@
return CHECK_JNI_EXIT("b", baseEnv(env)->IsSameObject(env, ref1, ref2));
}
- static jobject AllocObject(JNIEnv* env, jclass clazz) {
- CHECK_JNI_ENTRY(kFlag_Default, "Ec", env, clazz);
- return CHECK_JNI_EXIT("L", baseEnv(env)->AllocObject(env, clazz));
+ static jobject AllocObject(JNIEnv* env, jclass c) {
+ CHECK_JNI_ENTRY(kFlag_Default, "Ec", env, c);
+ return CHECK_JNI_EXIT("L", baseEnv(env)->AllocObject(env, c));
}
- static jobject NewObject(JNIEnv* env, jclass clazz, jmethodID mid, ...) {
- CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, clazz, mid);
+ static jobject NewObject(JNIEnv* env, jclass c, jmethodID mid, ...) {
+ CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, c, mid);
va_list args;
va_start(args, mid);
- jobject result = baseEnv(env)->NewObjectV(env, clazz, mid, args);
+ jobject result = baseEnv(env)->NewObjectV(env, c, mid, args);
va_end(args);
return CHECK_JNI_EXIT("L", result);
}
- static jobject NewObjectV(JNIEnv* env, jclass clazz, jmethodID mid, va_list args) {
- CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, clazz, mid);
- return CHECK_JNI_EXIT("L", baseEnv(env)->NewObjectV(env, clazz, mid, args));
+ static jobject NewObjectV(JNIEnv* env, jclass c, jmethodID mid, va_list args) {
+ CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, c, mid);
+ return CHECK_JNI_EXIT("L", baseEnv(env)->NewObjectV(env, c, mid, args));
}
- static jobject NewObjectA(JNIEnv* env, jclass clazz, jmethodID mid, jvalue* args) {
- CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, clazz, mid);
- return CHECK_JNI_EXIT("L", baseEnv(env)->NewObjectA(env, clazz, mid, args));
+ static jobject NewObjectA(JNIEnv* env, jclass c, jmethodID mid, jvalue* args) {
+ CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, c, mid);
+ return CHECK_JNI_EXIT("L", baseEnv(env)->NewObjectA(env, c, mid, args));
}
static jclass GetObjectClass(JNIEnv* env, jobject obj) {
@@ -1328,48 +1328,48 @@
return CHECK_JNI_EXIT("c", baseEnv(env)->GetObjectClass(env, obj));
}
- static jboolean IsInstanceOf(JNIEnv* env, jobject obj, jclass clazz) {
- CHECK_JNI_ENTRY(kFlag_Default, "ELc", env, obj, clazz);
- return CHECK_JNI_EXIT("b", baseEnv(env)->IsInstanceOf(env, obj, clazz));
+ static jboolean IsInstanceOf(JNIEnv* env, jobject obj, jclass c) {
+ CHECK_JNI_ENTRY(kFlag_Default, "ELc", env, obj, c);
+ return CHECK_JNI_EXIT("b", baseEnv(env)->IsInstanceOf(env, obj, c));
}
- static jmethodID GetMethodID(JNIEnv* env, jclass clazz, const char* name, const char* sig) {
- CHECK_JNI_ENTRY(kFlag_Default, "Ecuu", env, clazz, name, sig);
- return CHECK_JNI_EXIT("m", baseEnv(env)->GetMethodID(env, clazz, name, sig));
+ static jmethodID GetMethodID(JNIEnv* env, jclass c, const char* name, const char* sig) {
+ CHECK_JNI_ENTRY(kFlag_Default, "Ecuu", env, c, name, sig);
+ return CHECK_JNI_EXIT("m", baseEnv(env)->GetMethodID(env, c, name, sig));
}
- static jfieldID GetFieldID(JNIEnv* env, jclass clazz, const char* name, const char* sig) {
- CHECK_JNI_ENTRY(kFlag_Default, "Ecuu", env, clazz, name, sig);
- return CHECK_JNI_EXIT("f", baseEnv(env)->GetFieldID(env, clazz, name, sig));
+ static jfieldID GetFieldID(JNIEnv* env, jclass c, const char* name, const char* sig) {
+ CHECK_JNI_ENTRY(kFlag_Default, "Ecuu", env, c, name, sig);
+ return CHECK_JNI_EXIT("f", baseEnv(env)->GetFieldID(env, c, name, sig));
}
- static jmethodID GetStaticMethodID(JNIEnv* env, jclass clazz, const char* name, const char* sig) {
- CHECK_JNI_ENTRY(kFlag_Default, "Ecuu", env, clazz, name, sig);
- return CHECK_JNI_EXIT("m", baseEnv(env)->GetStaticMethodID(env, clazz, name, sig));
+ static jmethodID GetStaticMethodID(JNIEnv* env, jclass c, const char* name, const char* sig) {
+ CHECK_JNI_ENTRY(kFlag_Default, "Ecuu", env, c, name, sig);
+ return CHECK_JNI_EXIT("m", baseEnv(env)->GetStaticMethodID(env, c, name, sig));
}
- static jfieldID GetStaticFieldID(JNIEnv* env, jclass clazz, const char* name, const char* sig) {
- CHECK_JNI_ENTRY(kFlag_Default, "Ecuu", env, clazz, name, sig);
- return CHECK_JNI_EXIT("f", baseEnv(env)->GetStaticFieldID(env, clazz, name, sig));
+ static jfieldID GetStaticFieldID(JNIEnv* env, jclass c, const char* name, const char* sig) {
+ CHECK_JNI_ENTRY(kFlag_Default, "Ecuu", env, c, name, sig);
+ return CHECK_JNI_EXIT("f", baseEnv(env)->GetStaticFieldID(env, c, name, sig));
}
#define FIELD_ACCESSORS(_ctype, _jname, _type) \
- static _ctype GetStatic##_jname##Field(JNIEnv* env, jclass clazz, jfieldID fid) { \
- CHECK_JNI_ENTRY(kFlag_Default, "Ecf", env, clazz, fid); \
- sc.CheckStaticFieldID(clazz, fid); \
- return CHECK_JNI_EXIT(_type, baseEnv(env)->GetStatic##_jname##Field(env, clazz, fid)); \
+ static _ctype GetStatic##_jname##Field(JNIEnv* env, jclass c, jfieldID fid) { \
+ CHECK_JNI_ENTRY(kFlag_Default, "Ecf", env, c, fid); \
+ sc.CheckStaticFieldID(c, fid); \
+ return CHECK_JNI_EXIT(_type, baseEnv(env)->GetStatic##_jname##Field(env, c, fid)); \
} \
static _ctype Get##_jname##Field(JNIEnv* env, jobject obj, jfieldID fid) { \
CHECK_JNI_ENTRY(kFlag_Default, "ELf", env, obj, fid); \
sc.CheckInstanceFieldID(obj, fid); \
return CHECK_JNI_EXIT(_type, baseEnv(env)->Get##_jname##Field(env, obj, fid)); \
} \
- static void SetStatic##_jname##Field(JNIEnv* env, jclass clazz, jfieldID fid, _ctype value) { \
- CHECK_JNI_ENTRY(kFlag_Default, "Ecf" _type, env, clazz, fid, value); \
- sc.CheckStaticFieldID(clazz, fid); \
+ static void SetStatic##_jname##Field(JNIEnv* env, jclass c, jfieldID fid, _ctype value) { \
+ CHECK_JNI_ENTRY(kFlag_Default, "Ecf" _type, env, c, fid, value); \
+ sc.CheckStaticFieldID(c, fid); \
/* "value" arg only used when type == ref */ \
sc.CheckFieldType((jobject)(uint32_t)value, fid, _type[0], true); \
- baseEnv(env)->SetStatic##_jname##Field(env, clazz, fid, value); \
+ baseEnv(env)->SetStatic##_jname##Field(env, c, fid, value); \
CHECK_JNI_EXIT_VOID(); \
} \
static void Set##_jname##Field(JNIEnv* env, jobject obj, jfieldID fid, _ctype value) { \
@@ -1428,70 +1428,67 @@
} \
/* Non-virtual... */ \
static _ctype CallNonvirtual##_jname##Method(JNIEnv* env, \
- jobject obj, jclass clazz, jmethodID mid, ...) \
+ jobject obj, jclass c, jmethodID mid, ...) \
{ \
- CHECK_JNI_ENTRY(kFlag_Default, "ELcm.", env, obj, clazz, mid); /* TODO: args! */ \
+ CHECK_JNI_ENTRY(kFlag_Default, "ELcm.", env, obj, c, mid); /* TODO: args! */ \
sc.CheckSig(mid, _retsig, false); \
sc.CheckVirtualMethod(obj, mid); \
_retdecl; \
va_list args; \
va_start(args, mid); \
- _retasgn(baseEnv(env)->CallNonvirtual##_jname##MethodV(env, obj, clazz, mid, args)); \
+ _retasgn(baseEnv(env)->CallNonvirtual##_jname##MethodV(env, obj, c, mid, args)); \
va_end(args); \
_retok; \
} \
static _ctype CallNonvirtual##_jname##MethodV(JNIEnv* env, \
- jobject obj, jclass clazz, jmethodID mid, va_list args) \
+ jobject obj, jclass c, jmethodID mid, va_list args) \
{ \
- CHECK_JNI_ENTRY(kFlag_Default, "ELcm.", env, obj, clazz, mid); /* TODO: args! */ \
+ CHECK_JNI_ENTRY(kFlag_Default, "ELcm.", env, obj, c, mid); /* TODO: args! */ \
sc.CheckSig(mid, _retsig, false); \
sc.CheckVirtualMethod(obj, mid); \
_retdecl; \
- _retasgn(baseEnv(env)->CallNonvirtual##_jname##MethodV(env, obj, clazz, mid, args)); \
+ _retasgn(baseEnv(env)->CallNonvirtual##_jname##MethodV(env, obj, c, mid, args)); \
_retok; \
} \
static _ctype CallNonvirtual##_jname##MethodA(JNIEnv* env, \
- jobject obj, jclass clazz, jmethodID mid, jvalue* args) \
+ jobject obj, jclass c, jmethodID mid, jvalue* args) \
{ \
- CHECK_JNI_ENTRY(kFlag_Default, "ELcm.", env, obj, clazz, mid); /* TODO: args! */ \
+ CHECK_JNI_ENTRY(kFlag_Default, "ELcm.", env, obj, c, mid); /* TODO: args! */ \
sc.CheckSig(mid, _retsig, false); \
sc.CheckVirtualMethod(obj, mid); \
_retdecl; \
- _retasgn(baseEnv(env)->CallNonvirtual##_jname##MethodA(env, obj, clazz, mid, args)); \
+ _retasgn(baseEnv(env)->CallNonvirtual##_jname##MethodA(env, obj, c, mid, args)); \
_retok; \
} \
/* Static... */ \
- static _ctype CallStatic##_jname##Method(JNIEnv* env, \
- jclass clazz, jmethodID mid, ...) \
+ static _ctype CallStatic##_jname##Method(JNIEnv* env, jclass c, jmethodID mid, ...) \
{ \
- CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, clazz, mid); /* TODO: args! */ \
+ CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, c, mid); /* TODO: args! */ \
sc.CheckSig(mid, _retsig, true); \
- sc.CheckStaticMethod(clazz, mid); \
+ sc.CheckStaticMethod(c, mid); \
_retdecl; \
va_list args; \
va_start(args, mid); \
- _retasgn(baseEnv(env)->CallStatic##_jname##MethodV(env, clazz, mid, args)); \
+ _retasgn(baseEnv(env)->CallStatic##_jname##MethodV(env, c, mid, args)); \
va_end(args); \
_retok; \
} \
- static _ctype CallStatic##_jname##MethodV(JNIEnv* env, \
- jclass clazz, jmethodID mid, va_list args) \
+ static _ctype CallStatic##_jname##MethodV(JNIEnv* env, jclass c, jmethodID mid, va_list args) \
{ \
- CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, clazz, mid); /* TODO: args! */ \
+ CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, c, mid); /* TODO: args! */ \
sc.CheckSig(mid, _retsig, true); \
- sc.CheckStaticMethod(clazz, mid); \
+ sc.CheckStaticMethod(c, mid); \
_retdecl; \
- _retasgn(baseEnv(env)->CallStatic##_jname##MethodV(env, clazz, mid, args)); \
+ _retasgn(baseEnv(env)->CallStatic##_jname##MethodV(env, c, mid, args)); \
_retok; \
} \
- static _ctype CallStatic##_jname##MethodA(JNIEnv* env, \
- jclass clazz, jmethodID mid, jvalue* args) \
+ static _ctype CallStatic##_jname##MethodA(JNIEnv* env, jclass c, jmethodID mid, jvalue* args) \
{ \
- CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, clazz, mid); /* TODO: args! */ \
+ CHECK_JNI_ENTRY(kFlag_Default, "Ecm.", env, c, mid); /* TODO: args! */ \
sc.CheckSig(mid, _retsig, true); \
- sc.CheckStaticMethod(clazz, mid); \
+ sc.CheckStaticMethod(c, mid); \
_retdecl; \
- _retasgn(baseEnv(env)->CallStatic##_jname##MethodA(env, clazz, mid, args)); \
+ _retasgn(baseEnv(env)->CallStatic##_jname##MethodA(env, c, mid, args)); \
_retok; \
}
@@ -1685,14 +1682,14 @@
PRIMITIVE_ARRAY_FUNCTIONS(jfloat, Float, 'F');
PRIMITIVE_ARRAY_FUNCTIONS(jdouble, Double, 'D');
- static jint RegisterNatives(JNIEnv* env, jclass clazz, const JNINativeMethod* methods, jint nMethods) {
- CHECK_JNI_ENTRY(kFlag_Default, "EcpI", env, clazz, methods, nMethods);
- return CHECK_JNI_EXIT("I", baseEnv(env)->RegisterNatives(env, clazz, methods, nMethods));
+ static jint RegisterNatives(JNIEnv* env, jclass c, const JNINativeMethod* methods, jint nMethods) {
+ CHECK_JNI_ENTRY(kFlag_Default, "EcpI", env, c, methods, nMethods);
+ return CHECK_JNI_EXIT("I", baseEnv(env)->RegisterNatives(env, c, methods, nMethods));
}
- static jint UnregisterNatives(JNIEnv* env, jclass clazz) {
- CHECK_JNI_ENTRY(kFlag_Default, "Ec", env, clazz);
- return CHECK_JNI_EXIT("I", baseEnv(env)->UnregisterNatives(env, clazz));
+ static jint UnregisterNatives(JNIEnv* env, jclass c) {
+ CHECK_JNI_ENTRY(kFlag_Default, "Ec", env, c);
+ return CHECK_JNI_EXIT("I", baseEnv(env)->UnregisterNatives(env, c));
}
static jint MonitorEnter(JNIEnv* env, jobject obj) {