From d7372053f0e3b6e91a8d5dcfbbfece3e135ff343 Mon Sep 17 00:00:00 2001 From: RicardoJiang <2868405029@qq.com> Date: Mon, 4 Dec 2023 18:42:03 +0800 Subject: [PATCH] Fix the problem that Java 1.7 does not support Type.getTypeName --- 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 cc3f493..dff53b3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ kotlin.code.style=official -VERSION_NAME=1.9.20-1.1.0 +VERSION_NAME=1.9.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()