Skip to content

Commit 6c1fea7

Browse files
committed
Remove unnecessary property and check
from: FasterXML/jackson-module-kotlin#542
1 parent d5bfde2 commit 6c1fea7

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import com.fasterxml.jackson.module.kotlin.deser.value_instantiator.KotlinInstan
1414
import com.fasterxml.jackson.module.kotlin.ser.serializers.KotlinKeySerializers
1515
import com.fasterxml.jackson.module.kotlin.ser.serializers.KotlinSerializers
1616
import java.util.*
17-
import kotlin.reflect.KClass
1817

1918
/**
2019
* @param reflectionCacheSize Default: 512. Size, in items, of the caches used for mapping objects.
@@ -52,8 +51,6 @@ public class KotlinModule private constructor(
5251
private const val serialVersionUID = 1L
5352
}
5453

55-
private val ignoredClassesForImplyingJsonCreator = emptySet<KClass<*>>()
56-
5754
override fun setupModule(context: SetupContext) {
5855
super.setupModule(context)
5956

@@ -70,7 +67,7 @@ public class KotlinModule private constructor(
7067
}
7168

7269
context.insertAnnotationIntrospector(KotlinAnnotationIntrospector(context, cache, nullToEmptyCollection, nullToEmptyMap, nullIsSameAsDefault))
73-
context.appendAnnotationIntrospector(KotlinNamesAnnotationIntrospector(this, cache, ignoredClassesForImplyingJsonCreator))
70+
context.appendAnnotationIntrospector(KotlinNamesAnnotationIntrospector(this, cache))
7471

7572
context.addDeserializers(KotlinDeserializers())
7673
context.addKeyDeserializers(KotlinKeyDeserializers)

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import kotlin.reflect.full.memberProperties
2424
import kotlin.reflect.full.primaryConstructor
2525
import kotlin.reflect.jvm.javaType
2626

27-
internal class KotlinNamesAnnotationIntrospector(val module: KotlinModule, val cache: ReflectionCache, val ignoredClassesForImplyingJsonCreator: Set<KClass<*>>) : NopAnnotationIntrospector() {
27+
internal class KotlinNamesAnnotationIntrospector(val module: KotlinModule, val cache: ReflectionCache) : NopAnnotationIntrospector() {
2828
// since 2.4
2929
override fun findImplicitPropertyName(member: AnnotatedMember): String? = when (member) {
3030
is AnnotatedMethod -> member.annotated.declaringClass.toKmClass()?.let { kmClass ->
@@ -71,7 +71,6 @@ internal class KotlinNamesAnnotationIntrospector(val module: KotlinModule, val c
7171
// don't add a JsonCreator to any constructor if one is declared already
7272

7373
val kClass = cache.kotlinFromJava(member.declaringClass as Class<Any>)
74-
.apply { if (this in ignoredClassesForImplyingJsonCreator) return false }
7574
val kConstructor = cache.kotlinFromJava(member.annotated as Constructor<Any>) ?: return false
7675

7776
// 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)