Avoid deprecated newInstance() call on Class
This commit is contained in:
parent
2574f94cda
commit
f9c30bf119
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ class DateDeserializer<T : Date>(private val mClazz: Class<T>) : 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) {
|
||||
|
|
Loading…
Reference in a new issue