summaryrefslogtreecommitdiffstats
path: root/core/jni/android_pim_EventRecurrence.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2011-04-12 11:28:59 -0700
committerElliott Hughes <enh@google.com>2011-04-12 11:28:59 -0700
commitdd66bcbf9d6ef0c50a18d9c4b1b39ce7ef7afcc4 (patch)
treed44c2b9758436b189a2091297fa1e22d350da4a3 /core/jni/android_pim_EventRecurrence.cpp
parentae447967b5f07dd789a7488aa9e190637478a97c (diff)
downloadframeworks_base-dd66bcbf9d6ef0c50a18d9c4b1b39ce7ef7afcc4.zip
frameworks_base-dd66bcbf9d6ef0c50a18d9c4b1b39ce7ef7afcc4.tar.gz
frameworks_base-dd66bcbf9d6ef0c50a18d9c4b1b39ce7ef7afcc4.tar.bz2
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
Diffstat (limited to 'core/jni/android_pim_EventRecurrence.cpp')
-rw-r--r--core/jni/android_pim_EventRecurrence.cpp6
1 files changed, 2 insertions, 4 deletions
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;