JNI: Remove unused private constructor overloads

Those are never used, and removing this causes no problems.

Change-Id: Icae334d2d80197c4a416018e435e588a9c76d843
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
This commit is contained in:
Volker Hilsheimer 2023-09-22 17:28:46 +02:00
parent 980b86d09f
commit 4702208b40
2 changed files with 0 additions and 42 deletions

View File

@ -630,25 +630,6 @@ QJniObject::QJniObject(const char *className, const char *signature, ...)
\endcode
*/
QJniObject::QJniObject(const char *className, const char *signature, const QVaListPrivate &args)
: d(new QJniObjectPrivate())
{
QJniEnvironment env;
d->m_className = toBinaryEncClassName(className);
d->m_jclass = loadClass(d->m_className, env.jniEnv(), true);
d->m_own_jclass = false;
if (d->m_jclass) {
jmethodID constructorId = getCachedMethodID(env.jniEnv(), "<init>", signature);
if (constructorId) {
jobject obj = env->NewObjectV(d->m_jclass, constructorId, args);
if (obj) {
d->m_jobject = env->NewGlobalRef(obj);
env->DeleteLocalRef(obj);
}
}
}
}
/*!
Constructs a new JNI object from \a clazz by calling the constructor with
\a signature specifying the types of any subsequent arguments.
@ -722,25 +703,6 @@ QJniObject::QJniObject(jclass clazz)
}
}
QJniObject::QJniObject(jclass clazz, const char *signature, const QVaListPrivate &args)
: d(new QJniObjectPrivate())
{
QJniEnvironment env;
if (clazz) {
d->m_jclass = static_cast<jclass>(env->NewGlobalRef(clazz));
if (d->m_jclass) {
jmethodID constructorId = getMethodID(env.jniEnv(), d->m_jclass, "<init>", signature);
if (constructorId) {
jobject obj = env->NewObjectV(d->m_jclass, constructorId, args);
if (obj) {
d->m_jobject = env->NewGlobalRef(obj);
env->DeleteLocalRef(obj);
}
}
}
}
}
/*!
Constructs a new JNI object around the Java object \a object.

View File

@ -495,10 +495,6 @@ public:
}
private:
struct QVaListPrivate { operator va_list &() const { return m_args; } va_list &m_args; };
QJniObject(const char *className, const char *signature, const QVaListPrivate &args);
QJniObject(jclass clazz, const char *signature, const QVaListPrivate &args);
static jclass loadClass(const QByteArray &className, JNIEnv *env, bool binEncoded = false);
static QByteArray toBinaryEncClassName(const QByteArray &className);
static QJniObject getCleanJniObject(jobject obj);