From: Elliott Hughes Date: Thu, 17 Sep 2009 18:33:21 +0000 (-0700) Subject: Don't throw OutOfMemoryError if it's already been thrown. X-Git-Tag: android-x86-2.2~658^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=b0c23325609fbe2b955ace9a17aae7f8c2687a7d;p=android-x86%2Fdalvik.git Don't throw OutOfMemoryError if it's already been thrown. If GetPrimitiveArrayCritical fails, it throws a suitable exception for us. Also remove dead code. --- diff --git a/libcore/archive/src/main/native/java_util_zip_Deflater.c b/libcore/archive/src/main/native/java_util_zip_Deflater.c index 47347e60b..af0bfcce9 100644 --- a/libcore/archive/src/main/native/java_util_zip_Deflater.c +++ b/libcore/archive/src/main/native/java_util_zip_Deflater.c @@ -199,7 +199,6 @@ Java_java_util_zip_Deflater_deflateImpl (JNIEnv * env, jobject recv, sout = stream->stream->total_out; out = ((*env)->GetPrimitiveArrayCritical (env, buf, 0)); if (out == NULL) { - throwNewOutOfMemoryError(env, ""); return -1; } stream->stream->next_out = (Bytef *) out + off; diff --git a/libcore/openssl/src/main/native/BNInterface.c b/libcore/openssl/src/main/native/BNInterface.c index 755a93b90..1a3eb1690 100644 --- a/libcore/openssl/src/main/native/BNInterface.c +++ b/libcore/openssl/src/main/native/BNInterface.c @@ -33,12 +33,6 @@ static void -throwOutOfMemoryException(JNIEnv* env, const char* message) -{ - jniThrowException(env, "java/lang/OutOfMemoryError", message); -} - -static void throwNewNullPointerException (JNIEnv* env, const char* message) { jniThrowException(env, "java/lang/NullPointerException", message);