From cdbc83eab83de50947ef574af37ee76b516e34b0 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 15 Dec 2022 13:06:52 +0100 Subject: [PATCH] QJniObject: fix binary compatibility breakage Amends 601dbd64993fcbbb2ce6aaa95ef153ffd4f852b9, which changed the signature of the private callVoidMethodV function. However, that function got called in a public template member function, so callsites depended on the private function to be present. By changing the function signature, we broke binary compatibility. Bring the original function back and implement the variadic overload through it. Fixes: QTBUG-109428 Change-Id: Ie2297e120fbeb146089c0fbe8f91f8b8d3c79713 Reviewed-by: Marc Mutz (cherry picked from commit f2b49789b2f9f9145d318a00868d2f054052aee4) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/kernel/qjniobject.cpp | 7 ++++++- src/corelib/kernel/qjniobject.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/corelib/kernel/qjniobject.cpp b/src/corelib/kernel/qjniobject.cpp index 62a5993559b..df4335092e4 100644 --- a/src/corelib/kernel/qjniobject.cpp +++ b/src/corelib/kernel/qjniobject.cpp @@ -393,10 +393,15 @@ void QJniObject::callVoidMethodV(JNIEnv *env, jmethodID id, ...) const { va_list args; va_start(args, id); - env->CallVoidMethodV(d->m_jobject, id, args); + callVoidMethodV(env, id, args); va_end(args); } +void QJniObject::callVoidMethodV(JNIEnv *env, jmethodID id, va_list args) const +{ + env->CallVoidMethodV(d->m_jobject, id, args); +} + jmethodID QJniObject::getCachedMethodID(JNIEnv *env, jclass clazz, const QByteArray &className, diff --git a/src/corelib/kernel/qjniobject.h b/src/corelib/kernel/qjniobject.h index 2ae4c03dca0..56dfdabf5e0 100644 --- a/src/corelib/kernel/qjniobject.h +++ b/src/corelib/kernel/qjniobject.h @@ -434,6 +434,8 @@ private: const char *signature, bool isStatic = false); void callVoidMethodV(JNIEnv *env, jmethodID id, ...) const; + // ### Qt 7: merge into ... overload + void callVoidMethodV(JNIEnv *env, jmethodID id, va_list args) const; QJniObject callObjectMethodV(const char *methodName, const char *signature, va_list args) const;