From 6c514dcf31302c6186f634a5b13337247298d35b Mon Sep 17 00:00:00 2001 From: RicardoJiang <2868405029@qq.com> Date: Mon, 4 Dec 2023 18:02:56 +0800 Subject: [PATCH] Fix the problem that Java 1.7 does not support Type.getTypeName (#17) --- gradle.properties | 2 +- .../com/kanyun/kudos/json/reader/adapter/KudosJsonAdapter.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 891cce7..3c7b0c2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ kotlin.code.style=official -VERSION_NAME=1.8.20-1.1.0 +VERSION_NAME=1.8.20-1.1.1 GROUP=com.kanyun.kudos diff --git a/kudos-android-json-reader/src/main/java/com/kanyun/kudos/json/reader/adapter/KudosJsonAdapter.kt b/kudos-android-json-reader/src/main/java/com/kanyun/kudos/json/reader/adapter/KudosJsonAdapter.kt index 2a0abba..2e6284d 100644 --- a/kudos-android-json-reader/src/main/java/com/kanyun/kudos/json/reader/adapter/KudosJsonAdapter.kt +++ b/kudos-android-json-reader/src/main/java/com/kanyun/kudos/json/reader/adapter/KudosJsonAdapter.kt @@ -113,7 +113,7 @@ private fun parseKudosObjectSpecial( type: Type, typeArguments: Array, ): Any { - return if (type.typeName.endsWith("[]")) { + return if (type.toString().startsWith("class [")) { parseKudosArray(jsonReader, typeArguments) } else if (type is Class<*>) { val adapter = type.getDeclaredConstructor().newInstance()