diff --git a/src/corelib/time/qtimezoneprivate_android.cpp b/src/corelib/time/qtimezoneprivate_android.cpp index 9be5ea4a733..a82af07b582 100644 --- a/src/corelib/time/qtimezoneprivate_android.cpp +++ b/src/corelib/time/qtimezoneprivate_android.cpp @@ -95,10 +95,10 @@ static QJniObject getDisplayName(QJniObject zone, jint style, jboolean dst, QJniObject jvariant = QJniObject::fromString(QLocale::scriptToString(locale.script())); QJniObject jlocale("java.util.Locale", - "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", - static_cast(jlanguage.object()), - static_cast(jterritory.object()), - static_cast(jvariant.object())); + "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", + jlanguage.object(), + jterritory.object(), + jvariant.object()); return zone.callObjectMethod("getDisplayName", "(ZILjava/util/Locale;)Ljava/lang/String;", @@ -110,7 +110,7 @@ void QAndroidTimeZonePrivate::init(const QByteArray &ianaId) const QString iana = QString::fromUtf8(ianaId); androidTimeZone = QJniObject::callStaticObjectMethod( "java.util.TimeZone", "getTimeZone", "(Ljava/lang/String;)Ljava/util/TimeZone;", - static_cast(QJniObject::fromString(iana).object())); + QJniObject::fromString(iana).object()); // The ID or display name of the zone we've got, if it looks like what we asked for: const auto match = [iana](const QJniObject &jname) -> QByteArray { @@ -247,16 +247,16 @@ QList QAndroidTimeZonePrivate::availableTimeZoneIds() const QJniObject androidAvailableIdList = QJniObject::callStaticObjectMethod("java.util.TimeZone", "getAvailableIDs", "()[Ljava/lang/String;"); QJniEnvironment jniEnv; - int androidTZcount = jniEnv->GetArrayLength( static_cast(androidAvailableIdList.object()) ); + int androidTZcount = jniEnv->GetArrayLength(androidAvailableIdList.object()); // need separate jobject and QJniObject here so that we can delete (DeleteLocalRef) the reference to the jobject // (or else the JNI reference table fills after 512 entries from GetObjectArrayElement) jobject androidTZobject; QJniObject androidTZ; - for (int i=0; iGetObjectArrayElement( static_cast( androidAvailableIdList.object() ), i ); + for (int i = 0; i < androidTZcount; i++) { + androidTZobject = jniEnv->GetObjectArrayElement(androidAvailableIdList.object(), i); androidTZ = androidTZobject; - availableTimeZoneIdList.append( androidTZ.toString().toUtf8() ); + availableTimeZoneIdList.append(androidTZ.toString().toUtf8()); jniEnv->DeleteLocalRef(androidTZobject); } diff --git a/src/network/kernel/qnetworkproxy_android.cpp b/src/network/kernel/qnetworkproxy_android.cpp index d0bdfa5c4d9..f218eb9caae 100644 --- a/src/network/kernel/qnetworkproxy_android.cpp +++ b/src/network/kernel/qnetworkproxy_android.cpp @@ -91,7 +91,7 @@ QList QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro "()[Ljava/lang/String;"); bool exclude = false; if (exclusionList.isValid()) { - jobjectArray listObject = static_cast(exclusionList.object()); + jobjectArray listObject = exclusionList.object(); QJniEnvironment env; QJniObject entry; const int size = env->GetArrayLength(listObject); diff --git a/src/plugins/platforms/android/androidcontentfileengine.cpp b/src/plugins/platforms/android/androidcontentfileengine.cpp index 8ac950dbfea..2c47b71c88f 100644 --- a/src/plugins/platforms/android/androidcontentfileengine.cpp +++ b/src/plugins/platforms/android/androidcontentfileengine.cpp @@ -198,10 +198,10 @@ bool AndroidContentFileEngineIterator::hasNext() const QJniObject::fromString(path()).object()); if (objArray.isValid()) { QJniEnvironment env; - const jsize length = env->GetArrayLength(static_cast(objArray.object())); + const jsize length = env->GetArrayLength(objArray.object()); for (int i = 0; i != length; ++i) { m_entries << QJniObject(env->GetObjectArrayElement( - static_cast(objArray.object()), i)).toString(); + objArray.object(), i)).toString(); } } } diff --git a/src/plugins/platforms/android/androidjniclipboard.cpp b/src/plugins/platforms/android/androidjniclipboard.cpp index 597a56eb1ad..6178edd6754 100644 --- a/src/plugins/platforms/android/androidjniclipboard.cpp +++ b/src/plugins/platforms/android/androidjniclipboard.cpp @@ -114,7 +114,7 @@ namespace QtAndroidClipboard if (uris.isValid()) { QList urls; QJniEnvironment env; - jobjectArray juris = static_cast(uris.object()); + jobjectArray juris = uris.object(); const jint nUris = env->GetArrayLength(juris); urls.reserve(static_cast(nUris)); for (int i = 0; i < nUris; ++i) diff --git a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp index 2dbb1044f02..15c0aada954 100644 --- a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp +++ b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp @@ -147,7 +147,7 @@ class FolderIterator : public AssetItemList QtAndroid::assets(), QJniObject::fromString(path).object()); if (files.isValid()) { QJniEnvironment env; - jobjectArray jFiles = static_cast(files.object()); + jobjectArray jFiles = files.object(); const jint nFiles = env->GetArrayLength(jFiles); for (int i = 0; i < nFiles; ++i) { AssetItem item{QJniObject::fromLocalRef(env->GetObjectArrayElement(jFiles, i)).toString()}; diff --git a/src/plugins/tls/openssl/qsslsocket_openssl_android.cpp b/src/plugins/tls/openssl/qsslsocket_openssl_android.cpp index 7f7f067fa2b..1c11377c0e7 100644 --- a/src/plugins/tls/openssl/qsslsocket_openssl_android.cpp +++ b/src/plugins/tls/openssl/qsslsocket_openssl_android.cpp @@ -70,7 +70,7 @@ QList fetchSslCertificateData() return certificateData; QJniEnvironment env; - jobjectArray jcertificates = static_cast(certificates.object()); + jobjectArray jcertificates = certificates.object(); const jint nCertificates = env->GetArrayLength(jcertificates); certificateData.reserve(static_cast(nCertificates));