From f9c30bf1194e7243cc5b5a50f45b1aa313c11da6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Pich?= Date: Fri, 10 Jan 2020 15:10:01 +0100 Subject: [PATCH] Avoid deprecated newInstance() call on Class --- .../io/github/wulkanowy/sdk/scrapper/grades/DateDeserializer.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk-scrapper/src/main/kotlin/io/github/wulkanowy/sdk/scrapper/grades/DateDeserializer.kt b/sdk-scrapper/src/main/kotlin/io/github/wulkanowy/sdk/scrapper/grades/DateDeserializer.kt index 41f67a88..678ef903 100644 --- a/sdk-scrapper/src/main/kotlin/io/github/wulkanowy/sdk/scrapper/grades/DateDeserializer.kt +++ b/sdk-scrapper/src/main/kotlin/io/github/wulkanowy/sdk/scrapper/grades/DateDeserializer.kt @@ -13,7 +13,7 @@ class DateDeserializer(private val mClazz: Class) : JsonDeserialize override fun deserialize(element: JsonElement, arg1: Type, context: JsonDeserializationContext): T { val dateString = element.asString return try { - mClazz.newInstance().apply { + mClazz.getDeclaredConstructor().newInstance().apply { time = dateString.toDate(GradeDate.FORMAT).time } } catch (e: Throwable) {