Skip to content

Commit c92a5cd

Browse files
authored
Merge pull request #652 from k163377/fix-#508
Deletion of unused methods.
2 parents f66f8c4 + 21c7a00 commit c92a5cd

File tree

3 files changed

+2
-29
lines changed

3 files changed

+2
-29
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>

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinNamesAnnotationIntrospector.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,6 @@ internal class KotlinNamesAnnotationIntrospector(val module: KotlinModule, val c
137137
}
138138
}
139139

140-
@Deprecated(
141-
"To be removed in 2.14",
142-
ReplaceWith("with(receiver) { declaringClass.declaredMethods.any { it.name.contains('-') } }")
143-
)
144-
private fun AnnotatedMethod.isInlineClass() = declaringClass.declaredMethods.any { it.name.contains('-') }
145-
146140
// if has parameters, is a Kotlin class, and the parameters all have parameter annotations, then pretend we have a JsonCreator
147141
private fun AnnotatedConstructor.isKotlinConstructorWithParameters(): Boolean =
148142
parameterCount > 0 && declaringClass.isKotlinClass() && !declaringClass.isEnum
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)