Skip to content

Commit 1fc4d88

Browse files
committed
jni: Remove duplicated jniThrowException()
Change-Id: I73a910e4efbf84393b3ce5d7f6e58e61ca88d484
1 parent fdb39fe commit 1fc4d88

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

core/jni/android_text_AndroidBidi.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,14 @@
1717

1818
#define LOG_TAG "AndroidUnicode"
1919

20-
#include <jni.h>
20+
#include "JNIHelp.h"
2121
#include <android_runtime/AndroidRuntime.h>
2222
#include "utils/misc.h"
2323
#include "utils/Log.h"
2424
#include "unicode/ubidi.h"
2525

2626
namespace android {
2727

28-
static void jniThrowException(JNIEnv* env, const char* exc, const char* msg = NULL)
29-
{
30-
jclass excClazz = env->FindClass(exc);
31-
LOG_ASSERT(excClazz, "Unable to find class %s", exc);
32-
33-
env->ThrowNew(excClazz, msg);
34-
}
35-
3628
static jint runBidi(JNIEnv* env, jobject obj, jint dir, jcharArray chsArray,
3729
jbyteArray infoArray, int n, jboolean haveInfo)
3830
{

core/jni/android_text_AndroidCharacter.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#define LOG_TAG "AndroidUnicode"
1919

20-
#include <jni.h>
20+
#include "JNIHelp.h"
2121
#include <android_runtime/AndroidRuntime.h>
2222
#include "utils/misc.h"
2323
#include "utils/Log.h"
@@ -50,14 +50,6 @@ static int directionality_map[U_CHAR_DIRECTION_COUNT] = {
5050

5151
namespace android {
5252

53-
static void jniThrowException(JNIEnv* env, const char* exc, const char* msg = NULL)
54-
{
55-
jclass excClazz = env->FindClass(exc);
56-
LOG_ASSERT(excClazz, "Unable to find class %s", exc);
57-
58-
env->ThrowNew(excClazz, msg);
59-
}
60-
6153
static void getDirectionalities(JNIEnv* env, jobject obj, jcharArray srcArray, jbyteArray destArray, int count)
6254
{
6355
jchar* src = env->GetCharArrayElements(srcArray, NULL);

0 commit comments

Comments
 (0)