summaryrefslogtreecommitdiffstats
path: root/sql/src
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2009-10-01 11:20:29 -0700
committerElliott Hughes <enh@google.com>2009-10-01 11:20:29 -0700
commit738f95037e3e00ec5ccb8686f7c4c5c2cc16e06a (patch)
treea803f5fda92fe4a84c6f00d76db4f8e20e4a61ae /sql/src
parent109fc1115e7afd2907544b805eaa2cc8a0e2635f (diff)
downloadlibcore-738f95037e3e00ec5ccb8686f7c4c5c2cc16e06a.zip
libcore-738f95037e3e00ec5ccb8686f7c4c5c2cc16e06a.tar.gz
libcore-738f95037e3e00ec5ccb8686f7c4c5c2cc16e06a.tar.bz2
Use jniThrowException instead of FindClass/ThrowNew.
Always use our best-of-breed code for throwing exceptions. The remaining callers of Throw have good reason, and the only caller of ThrowNew is now JNIHelp.c (jniThrowException) itself.
Diffstat (limited to 'sql/src')
-rw-r--r--sql/src/main/native/sqlite_jni.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/sql/src/main/native/sqlite_jni.c b/sql/src/main/native/sqlite_jni.c
index 82aa8a0..1a23769 100644
--- a/sql/src/main/native/sqlite_jni.c
+++ b/sql/src/main/native/sqlite_jni.c
@@ -1,3 +1,5 @@
+#include "JNIHelp.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -276,23 +278,13 @@ freep(char **strp)
static void
throwex(JNIEnv *env, const char *msg)
{
- jclass except = (*env)->FindClass(env, "SQLite/Exception");
-
- (*env)->ExceptionClear(env);
- if (except) {
- (*env)->ThrowNew(env, except, msg);
- }
+ jniThrowException(env, "SQLite/Exception", msg);
}
static void
throwoom(JNIEnv *env, const char *msg)
{
- jclass except = (*env)->FindClass(env, "java/lang/OutOfMemoryError");
-
- (*env)->ExceptionClear(env);
- if (except) {
- (*env)->ThrowNew(env, except, msg);
- }
+ jniThrowException(env, "java/lang/OutOfMemoryError", msg);
}
static void
@@ -305,12 +297,7 @@ throwclosed(JNIEnv *env)
static void
throwioex(JNIEnv *env, const char *msg)
{
- jclass except = (*env)->FindClass(env, "java/io/IOException");
-
- (*env)->ExceptionClear(env);
- if (except) {
- (*env)->ThrowNew(env, except, msg);
- }
+ jniThrowException(env, "java/io/IOException", msg);
}
#endif