Skip to content

Commit 21c7a00

Browse files
committed
Remove unused internal fun
1 parent 7919d04 commit 21c7a00

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@
222222
<!-- Cache removal from ReflectionCache; internal change
223223
-->
224224
<exclude>com.fasterxml.jackson.module.kotlin.ReflectionCache</exclude>
225+
<exclude>com.fasterxml.jackson.module.kotlin.TypesKt</exclude>
225226
</excludes>
226227
</parameter>
227228
</configuration>
Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,6 @@
11
package com.fasterxml.jackson.module.kotlin
22

3-
import java.lang.reflect.*
43
import kotlin.reflect.KType
54
import kotlin.reflect.jvm.jvmErasure
65

7-
@Suppress("UNCHECKED_CAST") internal fun Type.erasedType(): Class<Any> {
8-
return when (this) {
9-
is Class<*> -> this as Class<Any>
10-
is ParameterizedType -> this.getRawType().erasedType()
11-
is GenericArrayType -> {
12-
// getting the array type is a bit trickier
13-
val elementType = this.getGenericComponentType().erasedType()
14-
val testArray = java.lang.reflect.Array.newInstance(elementType, 0)
15-
testArray.javaClass
16-
}
17-
is TypeVariable<*> -> {
18-
// not sure yet
19-
throw IllegalStateException("Not sure what to do here yet")
20-
}
21-
is WildcardType -> {
22-
this.getUpperBounds()[0].erasedType()
23-
}
24-
else -> throw IllegalStateException("Should not get here.")
25-
}
26-
}
27-
28-
internal fun KType.erasedType(): Class<out Any> = this.jvmErasure.java
6+
internal fun KType.erasedType(): Class<out Any> = this.jvmErasure.java

0 commit comments

Comments
 (0)