summaryrefslogtreecommitdiffstats
path: root/luni/src/main/native/java_net_InetAddress.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2010-01-28 13:43:39 -0800
committerElliott Hughes <enh@google.com>2010-01-28 13:43:39 -0800
commitda4f31de172364cfb3a20caed1784fa23b0510ca (patch)
tree8193ad1a81ce51bab2af642fc6cac52c7c7f4c87 /luni/src/main/native/java_net_InetAddress.cpp
parent230cc3ea6367b9819b20812026ffe52da873e23a (diff)
downloadlibcore-da4f31de172364cfb3a20caed1784fa23b0510ca.zip
libcore-da4f31de172364cfb3a20caed1784fa23b0510ca.tar.gz
libcore-da4f31de172364cfb3a20caed1784fa23b0510ca.tar.bz2
Fix jniThrowRuntimeException for C callers, add jniThrowNullPointerException.
...and switch all NPE throwers over to the helper.
Diffstat (limited to 'luni/src/main/native/java_net_InetAddress.cpp')
-rw-r--r--luni/src/main/native/java_net_InetAddress.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/luni/src/main/native/java_net_InetAddress.cpp b/luni/src/main/native/java_net_InetAddress.cpp
index 63053a8..04c18af 100644
--- a/luni/src/main/native/java_net_InetAddress.cpp
+++ b/luni/src/main/native/java_net_InetAddress.cpp
@@ -143,8 +143,7 @@ static jobjectArray InetAddress_getaddrinfoImpl(JNIEnv* env, const char* name) {
}
} else if (result == EAI_SYSTEM && errno == EACCES) {
/* No permission to use network */
- jniThrowException(
- env, "java/lang/SecurityException",
+ jniThrowException(env, "java/lang/SecurityException",
"Permission denied (maybe missing INTERNET permission)");
} else {
jniThrowException(env, "java/net/UnknownHostException",
@@ -160,7 +159,7 @@ static jobjectArray InetAddress_getaddrinfoImpl(JNIEnv* env, const char* name) {
jobjectArray InetAddress_getaddrinfo(JNIEnv* env, jobject obj, jstring javaName) {
if (javaName == NULL) {
- jniThrowException(env, "java/lang/NullPointerException", NULL);
+ jniThrowNullPointerException(env, NULL);
return NULL;
}
const char* name = env->GetStringUTFChars(javaName, NULL);
@@ -182,7 +181,7 @@ static jstring InetAddress_getnameinfo(JNIEnv* env, jobject obj,
jbyteArray javaAddress)
{
if (javaAddress == NULL) {
- jniThrowException(env, "java/lang/NullPointerException", NULL);
+ jniThrowNullPointerException(env, NULL);
return NULL;
}