Skip to content

Commit

Permalink
Merge remote-tracking branch 'FasterXML/2.18'
Browse files Browse the repository at this point in the history
  • Loading branch information
k163377 committed Jun 23, 2024
2 parents f4c3856 + 53d75aa commit 9622a71
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@
<goals>
<goal>test-compile</goal>
</goals>
<configuration>
<args>
</args>
</configuration>
</execution>
</executions>
</plugin>
Expand Down
1 change: 1 addition & 0 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 1 addition & 8 deletions src/main/kotlin/tools/jackson/module/kotlin/KotlinModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ class KotlinModule private constructor(
builder.isEnabled(UseJavaDurationConversion),
)

private val ignoredClassesForImplyingJsonCreator = emptySet<KClass<*>>()

override fun setupModule(context: SetupContext) {
super.setupModule(context)

Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import kotlin.reflect.jvm.javaType

internal class KotlinNamesAnnotationIntrospector(
private val cache: ReflectionCache,
private val ignoredClassesForImplyingJsonCreator: Set<KClass<*>>,
private val useKotlinPropertyNameForGetter: Boolean
) : NopAnnotationIntrospector() {
private fun getterNameFromJava(member: AnnotatedMethod): String? {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9622a71

Please sign in to comment.