Fix bugs detected by Sonar

This commit is contained in:
Benoit Marty 2019-07-03 15:40:31 +02:00
parent e9eada77f9
commit 1ee1c31b9c
3 changed files with 20 additions and 28 deletions

View File

@ -181,10 +181,6 @@ public class MXUsersDevicesMap<E> implements Serializable {
@Override
public String toString() {
if (null != mMap) {
return "MXUsersDevicesMap " + mMap.toString();
} else {
return "MXDeviceInfo : null map";
}
}
}

View File

@ -16,9 +16,9 @@
package im.vector.matrix.android.internal.crypto.store.db.model
import io.realm.RealmObject
import im.vector.matrix.android.internal.crypto.IncomingRoomKeyRequest
import im.vector.matrix.android.internal.crypto.model.rest.RoomKeyRequestBody
import io.realm.RealmObject
internal open class IncomingRoomKeyRequestEntity(
var requestId: String? = null,
@ -32,11 +32,11 @@ internal open class IncomingRoomKeyRequestEntity(
) : RealmObject() {
fun toIncomingRoomKeyRequest(): IncomingRoomKeyRequest {
return IncomingRoomKeyRequest().apply {
requestId = requestId
userId = userId
deviceId = deviceId
requestBody = RoomKeyRequestBody().apply {
return IncomingRoomKeyRequest().also {
it.requestId = requestId
it.userId = userId
it.deviceId = deviceId
it.requestBody = RoomKeyRequestBody().apply {
algorithm = requestBodyAlgorithm
roomId = requestBodyRoomId
senderKey = requestBodySenderKey

View File

@ -63,6 +63,7 @@ class NotifiableEventResolver @Inject constructor(private val stringProvider: St
else -> {
//If the event can be displayed, display it as is
Timber.w("NotifiableEventResolver Received an unsupported event matching a bing rule")
//TODO Better event text display
val bodyPreview = event.type
@ -75,11 +76,6 @@ class NotifiableEventResolver @Inject constructor(private val stringProvider: St
title = stringProvider.getString(R.string.notification_unknown_new_event),
soundName = null,
type = event.type)
//Unsupported event
Timber.w("NotifiableEventResolver Received an unsupported event matching a bing rule")
return null
}
}
}