diff options
author | Elliott Hughes <enh@google.com> | 2011-04-08 10:08:19 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-04-08 10:08:19 -0700 |
commit | fbb0788463c17fd2d718cefc11474357d3433dcb (patch) | |
tree | eb31fb4eac45c245198a6dc4b85eaedf65ebac35 /graphics | |
parent | 2915875fb635f9c17441e181481938255aa4cfc6 (diff) | |
parent | 8451b25a4422656bbd6657a5855e69c0f4d53c74 (diff) | |
download | frameworks_base-fbb0788463c17fd2d718cefc11474357d3433dcb.zip frameworks_base-fbb0788463c17fd2d718cefc11474357d3433dcb.tar.gz frameworks_base-fbb0788463c17fd2d718cefc11474357d3433dcb.tar.bz2 |
Merge "Use jniThrowException for exception throwing from native code."
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/jni/android_renderscript_RenderScript.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp index 12c5940..c6c86b2 100644 --- a/graphics/jni/android_renderscript_RenderScript.cpp +++ b/graphics/jni/android_renderscript_RenderScript.cpp @@ -72,12 +72,6 @@ private: // --------------------------------------------------------------------------- -static void doThrow(JNIEnv* env, const char* exc, const char* msg = NULL) -{ - jclass npeClazz = env->FindClass(exc); - env->ThrowNew(npeClazz, msg); -} - static jfieldID gContextId = 0; static jfieldID gNativeBitmapID = 0; static jfieldID gTypeNativeCache = 0; @@ -858,24 +852,24 @@ nScriptCCreate(JNIEnv *_env, jobject _this, RsContext con, AutoJavaStringToUTF8 resNameUTF(_env, resName); AutoJavaStringToUTF8 cacheDirUTF(_env, cacheDir); jint ret = 0; - + jbyte* script_ptr = NULL; jint _exception = 0; jint remaining; - jbyte* script_ptr; if (!scriptRef) { _exception = 1; - //_env->ThrowNew(IAEClass, "script == null"); + //jniThrowException(_env, "java/lang/IllegalArgumentException", "script == null"); goto exit; } if (length < 0) { _exception = 1; - //_env->ThrowNew(IAEClass, "length < 0"); + //jniThrowException(_env, "java/lang/IllegalArgumentException", "length < 0"); goto exit; } remaining = _env->GetArrayLength(scriptRef); if (remaining < length) { _exception = 1; - //_env->ThrowNew(IAEClass, "length > script.length - offset"); + //jniThrowException(_env, "java/lang/IllegalArgumentException", + // "length > script.length - offset"); goto exit; } script_ptr = (jbyte *) |