diff options
author | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2021-05-04 20:02:22 +0300 |
---|---|---|
committer | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2021-05-05 16:28:27 +0300 |
commit | 45daea19c393259297973ce99ce8717965e62224 (patch) | |
tree | 2a87a6f218c11d461e2f643bb76f08bc5d1b4445 /src | |
parent | afd7460affa17b5f8aac9034b1b9c3b13dd115f7 (diff) |
Fix set*Field JNI template calls
The calls were trying to pass a JNIEnv* from a QJniEnvironment using
conversion operator which was removed, and weren't detected since they
are templates and were missing tests. This fix that and add test cases
for setField() and setStaticField() calls.
Pick-to: 6.1
Change-Id: I6e1e6b7f557bbc664248ad364c48d63f58b70756
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/kernel/qjniobject.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/corelib/kernel/qjniobject.h b/src/corelib/kernel/qjniobject.h index 187eccc35d..011a1c0185 100644 --- a/src/corelib/kernel/qjniobject.h +++ b/src/corelib/kernel/qjniobject.h @@ -381,7 +381,7 @@ public: constexpr const char *signature = getTypeSignature<T>(); jfieldID id = getCachedFieldID(env.jniEnv(), fieldName, signature); if (id) { - setFieldForType<T>(env, object(), id, value); + setFieldForType<T>(env.jniEnv(), object(), id, value); env.checkAndClearExceptions(); } } @@ -393,7 +393,7 @@ public: QJniEnvironment env; jfieldID id = getCachedFieldID(env.jniEnv(), fieldName, signature); if (id) { - setFieldForType<T>(env, object(), id, value); + setFieldForType<T>(env.jniEnv(), object(), id, value); env.checkAndClearExceptions(); } } @@ -413,7 +413,7 @@ public: if (!id) return; - setStaticFieldForType<T>(env, clazz, id, value); + setStaticFieldForType<T>(env.jniEnv(), clazz, id, value); env.checkAndClearExceptions(); } @@ -431,7 +431,7 @@ public: jfieldID id = getCachedFieldID(env.jniEnv(), clazz, className, fieldName, signature, true); if (id) { - setStaticFieldForType<T>(env, clazz, id, value); + setStaticFieldForType<T>(env.jniEnv(), clazz, id, value); env.checkAndClearExceptions(); } } @@ -445,7 +445,7 @@ public: jfieldID id = getFieldID(env.jniEnv(), clazz, fieldName, signature, true); if (id) { - setStaticFieldForType<T>(env, clazz, id, value); + setStaticFieldForType<T>(env.jniEnv(), clazz, id, value); env.checkAndClearExceptions(); } } @@ -458,7 +458,7 @@ public: constexpr const char *signature = getTypeSignature<T>(); jfieldID id = getFieldID(env.jniEnv(), clazz, fieldName, signature, true); if (id) { - setStaticFieldForType<T>(env, clazz, id, value); + setStaticFieldForType<T>(env.jniEnv(), clazz, id, value); env.checkAndClearExceptions(); } } |