Convert Moshi.java to Kotlin (#1462)

* Rename .java to .kt

* Migrate Moshi.java to Moshi.kt

* Idiomatic cleanups

* Move comments down

* Apply suggestions from code review

Co-authored-by: Egor Andreevich <egor@squareup.com>

* Small little cleanups

Co-authored-by: Egor Andreevich <egor@squareup.com>
This commit is contained in:
Zac Sweers
2021-12-26 15:49:52 -06:00
committed by GitHub
parent ae421b1909
commit f3d2103ffb
4 changed files with 386 additions and 443 deletions

View File

@@ -289,7 +289,7 @@ public class KotlinJsonAdapterFactory : JsonAdapter.Factory {
else -> error("Not possible!")
}
val resolvedPropertyType = resolve(type, rawType, propertyType)
val adapter = moshi.adapter<Any>(
val adapter = moshi.adapter<Any?>(
resolvedPropertyType,
Util.jsonAnnotations(allAnnotations.toTypedArray()),
property.name