QJniObject: remove unused private methods

These three private methods were introduced in
4e60681c879a54cf5b34862a30e27c492ed36363 together with the QJniObject
class.
Digging through the whole git log for the qjniobject.h header shows
that the functions were never used. Not in template or inline methods,
and not even in the out-of-line methods.
Considering all the above, removing these methods would not cause BiC
or SiC issues, so just do it.

Pick-to: 6.6
Change-Id: Iaeeefbc2f1002e9413fd16651abd71381362a536
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Ivan Solovev 2023-07-21 16:29:55 +02:00
parent 32e8b27285
commit f50e295680
2 changed files with 0 additions and 67 deletions

View File

@ -864,64 +864,6 @@ QByteArray QJniObject::className() const
return d->m_className;
}
QJniObject QJniObject::callObjectMethodV(const char *methodName,
const char *signature,
va_list args) const
{
QJniEnvironment env;
jobject res = nullptr;
jmethodID id = getCachedMethodID(env.jniEnv(), methodName, signature);
if (id) {
res = env->CallObjectMethodV(d->m_jobject, id, args);
if (env.checkAndClearExceptions()) {
env->DeleteLocalRef(res);
res = nullptr;
}
}
QJniObject obj(res);
env->DeleteLocalRef(res);
return obj;
}
QJniObject QJniObject::callStaticObjectMethodV(const char *className,
const char *methodName,
const char *signature,
va_list args)
{
QJniEnvironment env;
jobject res = nullptr;
jclass clazz = loadClass(className, env.jniEnv());
if (clazz) {
jmethodID id = QJniObject::getCachedMethodID(env.jniEnv(), clazz, toBinaryEncClassName(className),
methodName, signature, true);
if (id) {
res = env->CallStaticObjectMethodV(clazz, id, args);
if (env.checkAndClearExceptions()) {
env->DeleteLocalRef(res);
res = nullptr;
}
}
}
QJniObject obj(res);
env->DeleteLocalRef(res);
return obj;
}
QJniObject QJniObject::callStaticObjectMethodV(jclass clazz,
const char *methodName,
const char *signature,
va_list args)
{
QJniEnvironment env;
jmethodID id = getMethodID(env.jniEnv(), clazz, methodName, signature, true);
if (!id)
return QJniObject();
return getCleanJniObject(env->CallStaticObjectMethodV(clazz, id, args));
}
/*!
\fn template <typename Ret, typename ...Args> auto QJniObject::callMethod(const char *methodName, const char *signature, Args &&...args) const
\since 6.4

View File

@ -436,15 +436,6 @@ private:
void callVoidMethodV(JNIEnv *env, jmethodID id, ...) const;
// ### Qt 7: merge into ... overload
void callVoidMethodV(JNIEnv *env, jmethodID id, va_list args) const;
// ### Qt 7: remove unused
QJniObject callObjectMethodV(const char *methodName, const char *signature,
va_list args) const;
// ### Qt 7: remove unused
static QJniObject callStaticObjectMethodV(const char *className, const char *methodName,
const char *signature, va_list args);
// ### Qt 7: remove unused
static QJniObject callStaticObjectMethodV(jclass clazz, const char *methodName,
const char *signature, va_list args);
bool isSameObject(jobject obj) const;
bool isSameObject(const QJniObject &other) const;