Skip to content

Commit 35a917a

Browse files
committed
Remove pointless checks and properties.
Since the ignoredClassesForImplyingJsonCreator was always emptySet, there was no point in checking it.
1 parent 99389f3 commit 35a917a

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ class KotlinModule @Deprecated(
9898
const val serialVersionUID = 1L
9999
}
100100

101-
private val ignoredClassesForImplyingJsonCreator = emptySet<KClass<*>>()
102-
103101
override fun setupModule(context: SetupContext) {
104102
super.setupModule(context)
105103

@@ -119,7 +117,7 @@ class KotlinModule @Deprecated(
119117
}
120118

121119
context.insertAnnotationIntrospector(KotlinAnnotationIntrospector(context, cache, nullToEmptyCollection, nullToEmptyMap, nullIsSameAsDefault))
122-
context.appendAnnotationIntrospector(KotlinNamesAnnotationIntrospector(this, cache, ignoredClassesForImplyingJsonCreator))
120+
context.appendAnnotationIntrospector(KotlinNamesAnnotationIntrospector(this, cache))
123121

124122
context.addDeserializers(KotlinDeserializers())
125123
context.addKeyDeserializers(KotlinKeyDeserializers)

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import kotlin.reflect.jvm.internal.KotlinReflectionInternalError
2727
import kotlin.reflect.jvm.javaType
2828
import kotlin.reflect.jvm.kotlinFunction
2929

30-
internal class KotlinNamesAnnotationIntrospector(val module: KotlinModule, val cache: ReflectionCache, val ignoredClassesForImplyingJsonCreator: Set<KClass<*>>) : NopAnnotationIntrospector() {
30+
internal class KotlinNamesAnnotationIntrospector(val module: KotlinModule, val cache: ReflectionCache) : NopAnnotationIntrospector() {
3131
// since 2.4
3232
override fun findImplicitPropertyName(member: AnnotatedMember): String? = when (member) {
3333
is AnnotatedMethod -> if (member.name.contains('-') && member.parameterCount == 0) {
@@ -64,7 +64,6 @@ internal class KotlinNamesAnnotationIntrospector(val module: KotlinModule, val c
6464
// don't add a JsonCreator to any constructor if one is declared already
6565

6666
val kClass = cache.kotlinFromJava(member.declaringClass as Class<Any>)
67-
.apply { if (this in ignoredClassesForImplyingJsonCreator) return false }
6867
val kConstructor = cache.kotlinFromJava(member.annotated as Constructor<Any>) ?: return false
6968

7069
// TODO: should we do this check or not? It could cause failures if we miss another way a property could be set

0 commit comments

Comments
 (0)