Use the adapter lookup hint API in the Kotlin reflection adapter.

This commit is contained in:
Eric Cochran 2018-09-18 18:00:22 -07:00 committed by GitHub
parent e0cdcd4ff8
commit 05cfb77430
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -229,7 +229,7 @@ class KotlinJsonAdapterFactory : JsonAdapter.Factory {
val name = jsonAnnotation?.name ?: property.name val name = jsonAnnotation?.name ?: property.name
val resolvedPropertyType = resolve(type, rawType, property.returnType.javaType) val resolvedPropertyType = resolve(type, rawType, property.returnType.javaType)
val adapter = moshi.adapter<Any>( val adapter = moshi.adapter<Any>(
resolvedPropertyType, Util.jsonAnnotations(allAnnotations.toTypedArray())) resolvedPropertyType, Util.jsonAnnotations(allAnnotations.toTypedArray()), property.name)
bindingsByName[property.name] = KotlinJsonAdapter.Binding(name, adapter, bindingsByName[property.name] = KotlinJsonAdapter.Binding(name, adapter,
property as KProperty1<Any, Any?>, parameter) property as KProperty1<Any, Any?>, parameter)