diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/OutgoingRoomKeyRequestManager.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/OutgoingRoomKeyRequestManager.kt index 9436a39873..a13ae75bca 100755 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/OutgoingRoomKeyRequestManager.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/OutgoingRoomKeyRequestManager.kt @@ -31,7 +31,6 @@ import im.vector.matrix.android.internal.task.TaskThread import im.vector.matrix.android.internal.task.configureWith import im.vector.matrix.android.internal.util.createBackgroundHandler import timber.log.Timber -import java.util.* import java.util.concurrent.atomic.AtomicBoolean import javax.inject.Inject @@ -185,9 +184,9 @@ internal class OutgoingRoomKeyRequestManager @Inject constructor( Timber.v("## sendOutgoingRoomKeyRequests() : Looking for queued outgoing room key requests") val outgoingRoomKeyRequest = cryptoStore.getOutgoingRoomKeyRequestByState( - HashSet(Arrays.asList(OutgoingRoomKeyRequest.RequestState.UNSENT, + setOf(OutgoingRoomKeyRequest.RequestState.UNSENT, OutgoingRoomKeyRequest.RequestState.CANCELLATION_PENDING, - OutgoingRoomKeyRequest.RequestState.CANCELLATION_PENDING_AND_WILL_RESEND))) + OutgoingRoomKeyRequest.RequestState.CANCELLATION_PENDING_AND_WILL_RESEND)) if (null == outgoingRoomKeyRequest) { Timber.e("## sendOutgoingRoomKeyRequests() : No more outgoing room key requests") diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/state/DefaultStateService.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/state/DefaultStateService.kt index 053bf7f7a6..e51f9b466a 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/state/DefaultStateService.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/state/DefaultStateService.kt @@ -30,9 +30,9 @@ internal class DefaultStateService @Inject constructor(private val roomId: Strin override fun updateTopic(topic: String, callback: MatrixCallback) { val params = SendStateTask.Params(roomId, EventType.STATE_ROOM_TOPIC, - HashMap().apply { - put("topic", topic) - }) + mapOf( + "topic" to topic + )) sendStateTask.configureWith(params) diff --git a/tools/check/forbidden_strings_in_code.txt b/tools/check/forbidden_strings_in_code.txt index 08e2e0d08e..7361e5f8a2 100644 --- a/tools/check/forbidden_strings_in_code.txt +++ b/tools/check/forbidden_strings_in_code.txt @@ -50,7 +50,7 @@ succes[^s] ### Use int instead of Integer protected Integer -### Use the interface declaration. Example: use type "Map" instead of type "HashMap" to declare variable or parameter +### Use the interface declaration. Example: use type "Map" instead of type "HashMap" to declare variable or parameter. For Kotlin, use mapOf, setOf, ... (private|public|protected| ) (static )?(final )?(HashMap|HashSet|ArrayList)< ### Use int instead of short