diff options
author | Elliott Hughes <enh@google.com> | 2010-01-28 13:43:39 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2010-01-28 13:43:39 -0800 |
commit | da4f31de172364cfb3a20caed1784fa23b0510ca (patch) | |
tree | 8193ad1a81ce51bab2af642fc6cac52c7c7f4c87 /icu/src/main/native/NativeDecimalFormat.cpp | |
parent | 230cc3ea6367b9819b20812026ffe52da873e23a (diff) | |
download | libcore-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 'icu/src/main/native/NativeDecimalFormat.cpp')
-rw-r--r-- | icu/src/main/native/NativeDecimalFormat.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/icu/src/main/native/NativeDecimalFormat.cpp b/icu/src/main/native/NativeDecimalFormat.cpp index ba62726..9170f27 100644 --- a/icu/src/main/native/NativeDecimalFormat.cpp +++ b/icu/src/main/native/NativeDecimalFormat.cpp @@ -29,18 +29,13 @@ #include <stdlib.h> #include <string.h> -// FIXME: move to JNIHelp.h -static void jniThrowNullPointerException(JNIEnv* env) { - jniThrowException(env, "java/lang/NullPointerException", NULL); -} - static DecimalFormat* toDecimalFormat(jint addr) { return reinterpret_cast<DecimalFormat*>(static_cast<uintptr_t>(addr)); } static jint openDecimalFormatImpl(JNIEnv* env, jclass clazz, jstring pattern0) { if (pattern0 == NULL) { - jniThrowNullPointerException(env); + jniThrowNullPointerException(env, NULL); return 0; } @@ -218,7 +213,7 @@ static jstring getTextAttribute(JNIEnv *env, jclass clazz, jint addr, static void applyPatternImpl(JNIEnv *env, jclass clazz, jint addr, jboolean localized, jstring pattern0) { if (pattern0 == NULL) { - jniThrowNullPointerException(env); + jniThrowNullPointerException(env, NULL); return; } ScopedJavaUnicodeString pattern(env, pattern0); |