From ed39b02924748201bc92ad92de61985a5c151b00 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 5 Sep 2019 15:36:20 +0200 Subject: [PATCH] Avoid using keyword for variable names --- .../api/pushrules/RoomMemberCountCondition.kt | 6 +++--- .../vector/riotx/features/rageshake/BugReporter.kt | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/pushrules/RoomMemberCountCondition.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/pushrules/RoomMemberCountCondition.kt index 1c02d63d..d0b76fba 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/pushrules/RoomMemberCountCondition.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/pushrules/RoomMemberCountCondition.kt @@ -21,14 +21,14 @@ import timber.log.Timber private val regex = Regex("^(==|<=|>=|<|>)?(\\d*)$") -class RoomMemberCountCondition(val `is`: String) : Condition(Kind.room_member_count) { +class RoomMemberCountCondition(val iz: String) : Condition(Kind.room_member_count) { override fun isSatisfied(conditionResolver: ConditionResolver): Boolean { return conditionResolver.resolveRoomMemberCountCondition(this) } override fun technicalDescription(): String { - return "Room member count is $`is`" + return "Room member count is $iz" } fun isSatisfied(event: Event, session: RoomService?): Boolean { @@ -55,7 +55,7 @@ class RoomMemberCountCondition(val `is`: String) : Condition(Kind.room_member_co */ private fun parseIsField(): Pair? { try { - val match = regex.find(`is`) ?: return null + val match = regex.find(iz) ?: return null val (prefix, count) = match.destructured return prefix to count.toInt() } catch (t: Throwable) { diff --git a/vector/src/main/java/im/vector/riotx/features/rageshake/BugReporter.kt b/vector/src/main/java/im/vector/riotx/features/rageshake/BugReporter.kt index c678f47d..39a57b87 100755 --- a/vector/src/main/java/im/vector/riotx/features/rageshake/BugReporter.kt +++ b/vector/src/main/java/im/vector/riotx/features/rageshake/BugReporter.kt @@ -349,20 +349,20 @@ class BugReporter @Inject constructor(private val activeSessionHolder: ActiveSes } else if (null == response || null == response.body()) { serverError = "Failed with error $responseCode" } else { - var `is`: InputStream? = null + var inputStream: InputStream? = null try { - `is` = response.body()!!.byteStream() + inputStream = response.body()!!.byteStream() - if (null != `is`) { - var ch = `is`.read() + if (null != inputStream) { + var ch = inputStream.read() val b = StringBuilder() while (ch != -1) { b.append(ch.toChar()) - ch = `is`.read() + ch = inputStream.read() } serverError = b.toString() - `is`.close() + inputStream.close() // check if the error message try { @@ -381,7 +381,7 @@ class BugReporter @Inject constructor(private val activeSessionHolder: ActiveSes Timber.e(e, "## sendBugReport() : failed to parse error " + e.message) } finally { try { - `is`?.close() + inputStream?.close() } catch (e: Exception) { Timber.e(e, "## sendBugReport() : failed to close the error stream " + e.message) }