diff --git a/pom.xml b/pom.xml index 1ecac062..02120ab7 100644 --- a/pom.xml +++ b/pom.xml @@ -165,6 +165,10 @@ test-compile + + + + diff --git a/release-notes/CREDITS-2.x b/release-notes/CREDITS-2.x index 9fd401e2..ee83ac9d 100644 --- a/release-notes/CREDITS-2.x +++ b/release-notes/CREDITS-2.x @@ -17,6 +17,7 @@ Contributors: # 2.18.0 (not yet released) * #782: Organize deprecated contents +* #542: Remove meaningless checks and properties in KNAI # 2.17.2 (not yet released) diff --git a/release-notes/VERSION-2.x b/release-notes/VERSION-2.x index d04ad555..68a53975 100644 --- a/release-notes/VERSION-2.x +++ b/release-notes/VERSION-2.x @@ -23,6 +23,7 @@ Co-maintainers: #782: Content marked as deprecated has been reorganized. Several constructors and accessors to properties of KotlinModule.Builder that were marked as DeprecationLevel.ERROR have been removed. Also, the content marked as DeprecationLevel.WARNING is now DeprecationLevel.ERROR. +#542: Remove meaningless checks and properties in KNAI. 2.17.2 (not yet released) #799: Fixed problem with code compiled with 2.17.x losing backward compatibility. diff --git a/src/main/kotlin/tools/jackson/module/kotlin/KotlinModule.kt b/src/main/kotlin/tools/jackson/module/kotlin/KotlinModule.kt index 7cd5d3b3..cb15f231 100644 --- a/src/main/kotlin/tools/jackson/module/kotlin/KotlinModule.kt +++ b/src/main/kotlin/tools/jackson/module/kotlin/KotlinModule.kt @@ -84,8 +84,6 @@ class KotlinModule private constructor( builder.isEnabled(UseJavaDurationConversion), ) - private val ignoredClassesForImplyingJsonCreator = emptySet>() - override fun setupModule(context: SetupContext) { super.setupModule(context) @@ -110,12 +108,7 @@ class KotlinModule private constructor( nullIsSameAsDefault, useJavaDurationConversion )) - context.appendAnnotationIntrospector( - KotlinNamesAnnotationIntrospector( - cache, - ignoredClassesForImplyingJsonCreator, - kotlinPropertyNameAsImplicitName) - ) + context.appendAnnotationIntrospector(KotlinNamesAnnotationIntrospector(cache, kotlinPropertyNameAsImplicitName)) context.addDeserializers(KotlinDeserializers(cache, useJavaDurationConversion)) context.addKeyDeserializers(KotlinKeyDeserializers) diff --git a/src/main/kotlin/tools/jackson/module/kotlin/KotlinNamesAnnotationIntrospector.kt b/src/main/kotlin/tools/jackson/module/kotlin/KotlinNamesAnnotationIntrospector.kt index 7051c932..392638b6 100644 --- a/src/main/kotlin/tools/jackson/module/kotlin/KotlinNamesAnnotationIntrospector.kt +++ b/src/main/kotlin/tools/jackson/module/kotlin/KotlinNamesAnnotationIntrospector.kt @@ -23,7 +23,6 @@ import kotlin.reflect.jvm.javaType internal class KotlinNamesAnnotationIntrospector( private val cache: ReflectionCache, - private val ignoredClassesForImplyingJsonCreator: Set>, private val useKotlinPropertyNameForGetter: Boolean ) : NopAnnotationIntrospector() { private fun getterNameFromJava(member: AnnotatedMethod): String? { @@ -89,7 +88,6 @@ internal class KotlinNamesAnnotationIntrospector( // don't add a JsonCreator to any constructor if one is declared already val kClass = member.declaringClass.kotlin - .apply { if (this in ignoredClassesForImplyingJsonCreator) return false } val kConstructor = cache.kotlinFromJava(member.annotated) ?: return false // TODO: should we do this check or not? It could cause failures if we miss another way a property could be set