From 381125287a985de594d7017d6328f2db8da6affb Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Sat, 31 May 2025 16:59:11 +0900 Subject: [PATCH] Added comments regarding Duration conversion --- .../jackson/module/kotlin/KotlinAnnotationIntrospector.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinAnnotationIntrospector.kt b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinAnnotationIntrospector.kt index 0054b3659..92533d559 100644 --- a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinAnnotationIntrospector.kt +++ b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinAnnotationIntrospector.kt @@ -68,7 +68,11 @@ internal class KotlinAnnotationIntrospector( override fun findSerializationConverter(a: Annotated): Converter<*, *>? = when (a) { // Find a converter to handle the case where the getter returns an unboxed value from the value class. is AnnotatedMethod -> a.findValueClassReturnType()?.let { + // To make annotations that process JavaDuration work, + // it is necessary to set up the conversion to JavaDuration here. + // This conversion will cause the deserialization settings for KotlinDuration to be ignored. if (useJavaDurationConversion && it == Duration::class) { + // For early return, the same process is placed as the branch regarding AnnotatedClass. if (a.rawReturnType == Duration::class.java) KotlinToJavaDurationConverter else