diff options
author | Andrei Vasiliu <[email protected]> | 2016-02-03 18:09:44 +0200 |
---|---|---|
committer | Andrei Vasiliu <[email protected]> | 2016-02-04 12:45:42 +0200 |
commit | 636680b1c451702431bd73db6c0d763ca102b61b (patch) | |
tree | 87721685c460ee9bf651458e39af7f2c923be571 | |
parent | 71da762d755c21ab6ae43fc5fc4db509c7f9c4ce (diff) |
java: Fixed class name runtime mismatch
Signed-off-by: Andrei Vasiliu <[email protected]>
-rw-r--r-- | java/jni/BluetoothAdapter.cxx | 2 | ||||
-rw-r--r-- | java/jni/BluetoothDevice.cxx | 2 | ||||
-rw-r--r-- | java/jni/BluetoothGattCharacteristic.cxx | 2 | ||||
-rw-r--r-- | java/jni/BluetoothGattDescriptor.cxx | 2 | ||||
-rw-r--r-- | java/jni/BluetoothGattService.cxx | 2 | ||||
-rw-r--r-- | java/jni/BluetoothObject.cxx | 2 | ||||
-rw-r--r-- | java/jni/helper.cxx | 2 | ||||
-rw-r--r-- | java/jni/helper.hpp | 4 |
8 files changed, 9 insertions, 9 deletions
diff --git a/java/jni/BluetoothAdapter.cxx b/java/jni/BluetoothAdapter.cxx index 8538ba8c..82e01cc2 100644 --- a/java/jni/BluetoothAdapter.cxx +++ b/java/jni/BluetoothAdapter.cxx @@ -41,7 +41,7 @@ jobject Java_tinyb_BluetoothAdapter_getBluetoothType(JNIEnv *env, jobject obj) jobject Java_tinyb_BluetoothAdapter_clone(JNIEnv *env, jobject obj) { - return generic_clone<BluetoothAdapter>(env, obj, "BluetoothAdapter"); + return generic_clone<BluetoothAdapter>(env, obj); } jboolean Java_tinyb_BluetoothAdapter_startDiscovery(JNIEnv *env, jobject obj) diff --git a/java/jni/BluetoothDevice.cxx b/java/jni/BluetoothDevice.cxx index da15cd00..033e53cf 100644 --- a/java/jni/BluetoothDevice.cxx +++ b/java/jni/BluetoothDevice.cxx @@ -42,7 +42,7 @@ jobject Java_tinyb_BluetoothAdapter_getBluetoothType(JNIEnv *env, jobject obj) jobject Java_tinyb_BluetoothDevice_clone(JNIEnv *env, jobject obj) { - return generic_clone<BluetoothDevice>(env, obj, "BluetoothDevice"); + return generic_clone<BluetoothDevice>(env, obj); } jboolean Java_tinyb_BluetoothDevice_disconnect(JNIEnv *env, jobject obj) diff --git a/java/jni/BluetoothGattCharacteristic.cxx b/java/jni/BluetoothGattCharacteristic.cxx index 0c7dfb74..f99f08fe 100644 --- a/java/jni/BluetoothGattCharacteristic.cxx +++ b/java/jni/BluetoothGattCharacteristic.cxx @@ -42,7 +42,7 @@ jobject Java_tinyb_BluetoothGattCharacteristic_getBluetoothType(JNIEnv *env, job jobject Java_tinyb_BluetoothGattCharacteristic_clone(JNIEnv *env, jobject obj) { - return generic_clone<BluetoothGattCharacteristic>(env, obj, "BluetoothGattCharacteristic"); + return generic_clone<BluetoothGattCharacteristic>(env, obj); } jbyteArray Java_tinyb_BluetoothGattCharacteristic_readValue(JNIEnv *env, jobject obj) diff --git a/java/jni/BluetoothGattDescriptor.cxx b/java/jni/BluetoothGattDescriptor.cxx index 05c45c3c..2fb4da25 100644 --- a/java/jni/BluetoothGattDescriptor.cxx +++ b/java/jni/BluetoothGattDescriptor.cxx @@ -41,7 +41,7 @@ jobject Java_tinyb_BluetoothGattDescriptor_getBluetoothType(JNIEnv *env, jobject jobject Java_tinyb_BluetoothGattDescriptor_clone(JNIEnv *env, jobject obj) { - return generic_clone<BluetoothGattDescriptor>(env, obj, "BluetoothGattDescriptor"); + return generic_clone<BluetoothGattDescriptor>(env, obj); } jbyteArray Java_tinyb_BluetoothGattDescriptor_readValue(JNIEnv *env, jobject obj) diff --git a/java/jni/BluetoothGattService.cxx b/java/jni/BluetoothGattService.cxx index c42e5c18..e7107b51 100644 --- a/java/jni/BluetoothGattService.cxx +++ b/java/jni/BluetoothGattService.cxx @@ -42,7 +42,7 @@ jobject Java_tinyb_BluetoothGattService_getBluetoothType(JNIEnv *env, jobject ob jobject Java_tinyb_BluetoothGattService_clone(JNIEnv *env, jobject obj) { - return generic_clone<BluetoothGattService>(env, obj, "BluetoothGattService"); + return generic_clone<BluetoothGattService>(env, obj); } jstring Java_tinyb_BluetoothGattService_getUuid(JNIEnv *env, jobject obj) diff --git a/java/jni/BluetoothObject.cxx b/java/jni/BluetoothObject.cxx index cdd51614..03029cca 100644 --- a/java/jni/BluetoothObject.cxx +++ b/java/jni/BluetoothObject.cxx @@ -39,7 +39,7 @@ jobject Java_tinyb_BluetoothObject_getBluetoothType(JNIEnv *env, jobject obj) jobject Java_tinyb_BluetoothObject_clone(JNIEnv *env, jobject obj) { - return generic_clone<BluetoothObject>(env, obj, "BluetoothObject"); + return generic_clone<BluetoothObject>(env, obj); } void Java_tinyb_BluetoothObject_delete(JNIEnv *env, jobject obj) diff --git a/java/jni/helper.cxx b/java/jni/helper.cxx index 3344ab85..2fd70fab 100644 --- a/java/jni/helper.cxx +++ b/java/jni/helper.cxx @@ -119,7 +119,7 @@ bool from_jboolean_to_bool(jboolean val) jobject get_bluetooth_type(JNIEnv *env, const char *field_name) { - jclass b_type_enum = search_class(env, "BluetoothType"); + jclass b_type_enum = search_class(env, JAVA_PACKAGE "/BluetoothType"); jfieldID b_type_field = search_field(env, b_type_enum, field_name, "l", true); diff --git a/java/jni/helper.hpp b/java/jni/helper.hpp index a6b698f1..3a7f1664 100644 --- a/java/jni/helper.hpp +++ b/java/jni/helper.hpp @@ -54,12 +54,12 @@ void setInstance(JNIEnv *env, jobject obj, T *t) } template <typename T> -jobject generic_clone(JNIEnv *env, jobject obj, const char *class_name) +jobject generic_clone(JNIEnv *env, jobject obj) { T *obj_generic = getInstance<T>(env, obj); T *copy_generic = new T(*obj_generic); - jclass generic_class = search_class(env, class_name); + jclass generic_class = search_class(env, *copy_generic); jmethodID generic_ctor = search_method(env, generic_class, "<init>", "(J)V", false); jobject result = env->NewObject(generic_class, generic_ctor, (jlong)copy_generic); |