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()
}
}

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