diff --git a/pom.xml b/pom.xml
index 9c4789863..fe25f3bfa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -271,6 +271,9 @@
com.fasterxml.jackson.module.kotlin.KotlinModule$Builder#reflectionCacheSize(int)
+
+ com.fasterxml.jackson.module.kotlin.KotlinNamesAnnotationIntrospector#KotlinNamesAnnotationIntrospector(com.fasterxml.jackson.module.kotlin.ReflectionCache,java.util.Set,boolean)
+
diff --git a/release-notes/CREDITS-2.x b/release-notes/CREDITS-2.x
index 9fd401e26..ee83ac9da 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 d04ad5553..68a53975a 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/com/fasterxml/jackson/module/kotlin/KotlinModule.kt b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinModule.kt
index e6c327a67..3ddc3dd10 100644
--- a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinModule.kt
+++ b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinModule.kt
@@ -89,8 +89,6 @@ class KotlinModule private constructor(
builder.isEnabled(UseJavaDurationConversion),
)
- private val ignoredClassesForImplyingJsonCreator = emptySet>()
-
override fun setupModule(context: SetupContext) {
super.setupModule(context)
@@ -114,12 +112,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/com/fasterxml/jackson/module/kotlin/KotlinNamesAnnotationIntrospector.kt b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinNamesAnnotationIntrospector.kt
index d0ed21472..665f57b5b 100644
--- a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinNamesAnnotationIntrospector.kt
+++ b/src/main/kotlin/com/fasterxml/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