Run ktlintFormat

This commit is contained in:
Benoit Marty 2022-04-12 16:09:56 +02:00
parent 23d2a290ab
commit bfbcef60e9
3 changed files with 9 additions and 11 deletions

View File

@ -77,4 +77,3 @@ data class MegolmBackupAuthData(
.signalableJSONDictionary() .signalableJSONDictionary()
} }
} }

View File

@ -88,4 +88,3 @@ internal data class AuthParams(
} }
} }
} }

View File

@ -77,8 +77,8 @@ internal class RuntimeJsonAdapterFactory<T>(
override fun fromJson(reader: JsonReader): Any? { override fun fromJson(reader: JsonReader): Any? {
val peekedToken = reader.peek() val peekedToken = reader.peek()
if (peekedToken != JsonReader.Token.BEGIN_OBJECT) { if (peekedToken != JsonReader.Token.BEGIN_OBJECT) {
throw JsonDataException("Expected BEGIN_OBJECT but was " + peekedToken throw JsonDataException("Expected BEGIN_OBJECT but was " + peekedToken +
+ " at path " + reader.path) " at path " + reader.path)
} }
val jsonValue = reader.readJsonValue() val jsonValue = reader.readJsonValue()
val jsonObject = jsonValue as Map<String, Any>? val jsonObject = jsonValue as Map<String, Any>?
@ -91,13 +91,13 @@ internal class RuntimeJsonAdapterFactory<T>(
override fun toJson(writer: JsonWriter, value: Any?) { override fun toJson(writer: JsonWriter, value: Any?) {
val type: Class<*> = value!!.javaClass val type: Class<*> = value!!.javaClass
val label = typeToLabel[type] val label = typeToLabel[type]
?: throw IllegalArgumentException("Expected one of " ?: throw IllegalArgumentException("Expected one of " +
+ typeToLabel.keys typeToLabel.keys +
+ " but found " " but found " +
+ value value +
+ ", a " ", a " +
+ value.javaClass value.javaClass +
+ ". Register this subtype.") ". Register this subtype.")
val adapter = labelToAdapter[label]!! val adapter = labelToAdapter[label]!!
val jsonValue = adapter.toJsonValue(value) as Map<String, Any>? val jsonValue = adapter.toJsonValue(value) as Map<String, Any>?
val valueWithLabel: MutableMap<String, Any> = LinkedHashMap(1 + jsonValue!!.size) val valueWithLabel: MutableMap<String, Any> = LinkedHashMap(1 + jsonValue!!.size)