summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-10-08 14:29:37 -0400
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-10-08 14:29:37 -0400
commit0141848387e6d359b660ad05086e7d8030af1568 (patch)
tree91506c05bc094fdeac41a4071627faa3f87ca481
parent64aa4e60f58a4d5b0b1b1a95e14c1370049c790e (diff)
parent44199d249d6ec0af62477a095eae9818bcb00d3f (diff)
downloadlibcore-0141848387e6d359b660ad05086e7d8030af1568.zip
libcore-0141848387e6d359b660ad05086e7d8030af1568.tar.gz
libcore-0141848387e6d359b660ad05086e7d8030af1568.tar.bz2
Merge change I685130ae
* changes: JNI Delete* and Release* _are_ allowed while an exception is pending.
-rw-r--r--xml/src/main/native/org_apache_harmony_xml_ExpatParser.cpp44
1 files changed, 3 insertions, 41 deletions
diff --git a/xml/src/main/native/org_apache_harmony_xml_ExpatParser.cpp b/xml/src/main/native/org_apache_harmony_xml_ExpatParser.cpp
index 15f1d28..9192b1a 100644
--- a/xml/src/main/native/org_apache_harmony_xml_ExpatParser.cpp
+++ b/xml/src/main/native/org_apache_harmony_xml_ExpatParser.cpp
@@ -790,18 +790,7 @@ static void processingInstruction(void* data, const char* target,
env->CallVoidMethod(javaParser, processingInstructionMethod, javaTarget,
javaInstructionData);
- // We have to temporarily clear an exception before we can release local
- // references.
- jthrowable exception = env->ExceptionOccurred();
- if (exception != NULL) {
- env->ExceptionClear();
- }
-
env->DeleteLocalRef(javaInstructionData);
-
- if (exception != NULL) {
- env->Throw(exception);
- }
}
/**
@@ -998,16 +987,7 @@ static void appendString(JNIEnv* env, jobject object, jint pointer, jstring xml,
jniThrowExpatException(env, XML_GetErrorCode(parser));
}
- // We have to temporarily clear an exception before we can release local
- // references.
- jthrowable exception = env->ExceptionOccurred();
- if (exception) {
- env->ExceptionClear();
- env->ReleaseStringChars(xml, characters);
- env->Throw(exception);
- } else {
- env->ReleaseStringChars(xml, characters);
- }
+ env->ReleaseStringChars(xml, characters);
context->object = NULL;
context->env = NULL;
@@ -1036,16 +1016,7 @@ static void appendCharacters(JNIEnv* env, jobject object, jint pointer,
jniThrowExpatException(env, XML_GetErrorCode(parser));
}
- // We have to temporarily clear an exception before we can release local
- // references.
- jthrowable exception = env->ExceptionOccurred();
- if (exception) {
- env->ExceptionClear();
- env->ReleaseCharArrayElements(xml, characters, JNI_ABORT);
- env->Throw(exception);
- } else {
- env->ReleaseCharArrayElements(xml, characters, JNI_ABORT);
- }
+ env->ReleaseCharArrayElements(xml, characters, JNI_ABORT);
context->object = NULL;
context->env = NULL;
@@ -1074,16 +1045,7 @@ static void appendBytes(JNIEnv* env, jobject object, jint pointer,
jniThrowExpatException(env, XML_GetErrorCode(parser));
}
- // We have to temporarily clear an exception before we can release local
- // references.
- jthrowable exception = env->ExceptionOccurred();
- if (exception) {
- env->ExceptionClear();
- env->ReleaseByteArrayElements(xml, bytes, JNI_ABORT);
- env->Throw(exception);
- } else {
- env->ReleaseByteArrayElements(xml, bytes, JNI_ABORT);
- }
+ env->ReleaseByteArrayElements(xml, bytes, JNI_ABORT);
context->object = NULL;
context->env = NULL;