From 52ea59275e80d004d2e5972efd367a9d6fc9a547 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 27 May 2021 04:31:31 +0530 Subject: openpgp-ktx: fix compilation warnings Signed-off-by: Harsh Shandilya --- .../src/main/java/me/msfjarvis/openpgpktx/AutocryptPeerUpdate.kt | 6 ++++-- .../src/main/java/me/msfjarvis/openpgpktx/util/OpenPgpUtils.kt | 2 +- .../src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.kt | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'openpgp-ktx') diff --git a/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/AutocryptPeerUpdate.kt b/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/AutocryptPeerUpdate.kt index 45ee5755..6690fe35 100644 --- a/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/AutocryptPeerUpdate.kt +++ b/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/AutocryptPeerUpdate.kt @@ -25,6 +25,7 @@ public class AutocryptPeerUpdate() : Parcelable { this.preferEncrypt = preferEncrypt } + @Suppress("UNUSED_PARAMETER") private constructor(source: Parcel, version: Int) : this() { keyData = source.createByteArray() effectiveDate = if (source.readInt() != 0) Date(source.readLong()) else null @@ -85,7 +86,8 @@ public class AutocryptPeerUpdate() : Parcelable { public companion object CREATOR : Creator { private const val PARCELABLE_VERSION = 1 - override fun createFromParcel(source: Parcel): AutocryptPeerUpdate? { + + override fun createFromParcel(source: Parcel): AutocryptPeerUpdate { val version = source.readInt() // parcelableVersion val parcelableSize = source.readInt() val startPosition = source.dataPosition() @@ -95,7 +97,7 @@ public class AutocryptPeerUpdate() : Parcelable { return vr } - override fun newArray(size: Int): Array? { + override fun newArray(size: Int): Array { return arrayOfNulls(size) } } diff --git a/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/util/OpenPgpUtils.kt b/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/util/OpenPgpUtils.kt index c70d9c3c..aee5babe 100644 --- a/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/util/OpenPgpUtils.kt +++ b/openpgp-ktx/src/main/java/me/msfjarvis/openpgpktx/util/OpenPgpUtils.kt @@ -64,7 +64,7 @@ public object OpenPgpUtils { if (userId.isNotEmpty()) { val matcher = USER_ID_PATTERN.matcher(userId) if (matcher.matches()) { - var name = if (matcher.group(1).isEmpty()) null else matcher.group(1) + var name = if (matcher.group(1)?.isEmpty() == true) null else matcher.group(1) val comment = matcher.group(2) var email = matcher.group(3) if (email != null && name != null) { diff --git a/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.kt b/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.kt index 68a542a8..a310b3c9 100644 --- a/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.kt +++ b/openpgp-ktx/src/main/java/org/openintents/openpgp/OpenPgpSignatureResult.kt @@ -23,6 +23,7 @@ public class OpenPgpSignatureResult : Parcelable { private val signatureTimestamp: Date? private val autocryptPeerentityResult: AutocryptPeerResult? + @Suppress("UNUSED_PARAMETER") private constructor( signatureStatus: Int, signatureUserId: String?, -- cgit v1.2.3