summaryrefslogtreecommitdiffstats
path: root/x-net
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 /x-net
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 'x-net')
-rw-r--r--x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLServerSocketImpl.cpp20
-rw-r--r--x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp4
2 files changed, 7 insertions, 17 deletions
diff --git a/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLServerSocketImpl.cpp b/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLServerSocketImpl.cpp
index bb5e3b7..2a55bbc 100644
--- a/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLServerSocketImpl.cpp
+++ b/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLServerSocketImpl.cpp
@@ -41,20 +41,10 @@
static jfieldID field_ssl_ctx;
/**
- * Throws java.io.IOexception with the provided message.
+ * Throws java.io.IOException with the provided message.
*/
-static void throwIOExceptionStr(JNIEnv* env, const char* message)
-{
- jclass exClass = env->FindClass("java/io/IOException");
-
- if (exClass == NULL)
- {
- LOGE("Unable to find class java/io/IOException");
- }
- else
- {
- env->ThrowNew(exClass, message);
- }
+static void throwIOExceptionStr(JNIEnv* env, const char* message) {
+ jniThrowException(env, "java/io/IOException", message);
}
/**
@@ -251,8 +241,8 @@ static void org_apache_harmony_xnet_provider_jsse_OpenSSLServerSocketImpl_setena
ret = SSL_CTX_set_cipher_list(ctx, str);
if(ret == 0) {
- jclass exClass = env->FindClass("java/lang/IllegalArgumentException");
- env->ThrowNew(exClass, "Illegal cipher suite strings.");
+ jniThrowException(env, "java/lang/IllegalArgumentException",
+ "Illegal cipher suite strings.");
}
}
diff --git a/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp b/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp
index 1b0feeb..2e1adb1 100644
--- a/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp
+++ b/x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl.cpp
@@ -1500,8 +1500,8 @@ static void org_apache_harmony_xnet_provider_jsse_OpenSSLSocketImpl_setenabledci
if (ret == 0) {
freeSslErrorState();
- jclass exClass = env->FindClass("java/lang/IllegalArgumentException");
- env->ThrowNew(exClass, "Illegal cipher suite strings.");
+ jniThrowException(env, "java/lang/IllegalArgumentException",
+ "Illegal cipher suite strings.");
}
}