From dd66bcbf9d6ef0c50a18d9c4b1b39ce7ef7afcc4 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 12 Apr 2011 11:28:59 -0700 Subject: More native code cleanup. Don't keep unused global references to classes, don't throw exceptions when an exception is already pending, and fix a (harmless) misunderstanding about how GetStringChars works. Change-Id: Ie445036f057daa8a1c76aceb7bad2a84fb81d820 --- core/jni/android_pim_EventRecurrence.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'core/jni/android_pim_EventRecurrence.cpp') diff --git a/core/jni/android_pim_EventRecurrence.cpp b/core/jni/android_pim_EventRecurrence.cpp index 9056c90..44e898d 100644 --- a/core/jni/android_pim_EventRecurrence.cpp +++ b/core/jni/android_pim_EventRecurrence.cpp @@ -28,7 +28,6 @@ struct cached_array_fields_t jfieldID count; }; -static jclass clazz; static jfieldID freq_field; static jfieldID until_field; static jfieldID count_field; @@ -87,8 +86,7 @@ EventRecurrence_parse(JNIEnv* env, jobject This, jstring jstr) jniThrowNullPointerException(env, "EventRecurrence.parse str parameter null"); return ; } - jboolean isCopy; - const jchar* jchars = env->GetStringChars(jstr, &isCopy); + const jchar* jchars = env->GetStringChars(jstr, NULL); jsize len = env->GetStringLength(jstr); String16 str(jchars, len); env->ReleaseStringChars(jstr, jchars); @@ -156,7 +154,7 @@ static const char*const CLASS_NAME = "android/pim/EventRecurrence"; int register_android_pim_EventRecurrence(JNIEnv* env) { - clazz = env->FindClass(CLASS_NAME); + jclass clazz = env->FindClass(CLASS_NAME); if (clazz == NULL) { LOGE("Field lookup unable to find class '%s'\n", CLASS_NAME); return -1; -- cgit v1.1