File tree Expand file tree Collapse file tree 2 files changed +2
-23
lines changed
src/main/kotlin/com/fasterxml/jackson/module/kotlin Expand file tree Collapse file tree 2 files changed +2
-23
lines changed Original file line number Diff line number Diff line change 222
222
<!-- Cache removal from ReflectionCache; internal change
223
223
-->
224
224
<exclude >com.fasterxml.jackson.module.kotlin.ReflectionCache</exclude >
225
+ <exclude >com.fasterxml.jackson.module.kotlin.TypesKt</exclude >
225
226
</excludes >
226
227
</parameter >
227
228
</configuration >
Original file line number Diff line number Diff line change 1
1
package com.fasterxml.jackson.module.kotlin
2
2
3
- import java.lang.reflect.*
4
3
import kotlin.reflect.KType
5
4
import kotlin.reflect.jvm.jvmErasure
6
5
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
You can’t perform that action at this time.
0 commit comments