Skip to content

Commit 380ff09

Browse files
committed
Fixed hasRequiredMarker to only process content defined in Kotlin
Processing efficiency has also been improved because the results of processing for Java are no longer cached.
1 parent 8038218 commit 380ff09

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinAnnotationIntrospector.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ internal class KotlinAnnotationIntrospector(
3636
// TODO: implement nullIsSameAsDefault flag, which represents when TRUE that if something has a default value, it can be passed a null to default it
3737
// this likely impacts this class to be accurate about what COULD be considered required
3838

39-
override fun hasRequiredMarker(m: AnnotatedMember): Boolean? {
40-
val hasRequired = cache.javaMemberIsRequired(m) {
39+
override fun hasRequiredMarker(
40+
m: AnnotatedMember
41+
): Boolean? = m.takeIf { it.member.declaringClass.isKotlinClass() }?.let { _ ->
42+
cache.javaMemberIsRequired(m) {
4143
try {
4244
when {
4345
nullToEmptyCollection && m.type.isCollectionLikeType -> false
@@ -54,7 +56,6 @@ internal class KotlinAnnotationIntrospector(
5456
null
5557
}
5658
}
57-
return hasRequired
5859
}
5960

6061
override fun findSerializationConverter(a: Annotated): Converter<*, *>? = when (a) {

0 commit comments

Comments
 (0)