Skip to content

Commit 7e669e7

Browse files
committed
Merge branch '2.x' into 3.x
2 parents 23a2a0d + 64b491d commit 7e669e7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/kotlin/tools/jackson/module/kotlin/KotlinAnnotationIntrospector.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ internal class KotlinAnnotationIntrospector(
1717
override fun findSerializationConverter(config: MapperConfig<*>?, a: Annotated): Converter<*, *>? = when (a) {
1818
// Find a converter to handle the case where the getter returns an unboxed value from the value class.
1919
is AnnotatedMethod -> a.findValueClassReturnType()?.let {
20+
// To make annotations that process JavaDuration work,
21+
// it is necessary to set up the conversion to JavaDuration here.
22+
// This conversion will cause the deserialization settings for KotlinDuration to be ignored.
2023
if (useJavaDurationConversion && it == Duration::class) {
24+
// For early return, the same process is placed as the branch regarding AnnotatedClass.
2125
if (a.rawReturnType == Duration::class.java)
2226
KotlinToJavaDurationConverter
2327
else

0 commit comments

Comments
 (0)