File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/main/kotlin/com/fasterxml/jackson/module/kotlin/deser/value_instantiator Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package com.fasterxml.jackson.module.kotlin.deser.value_instantiator
3
3
import com.fasterxml.jackson.databind.BeanDescription
4
4
import com.fasterxml.jackson.databind.DeserializationConfig
5
5
import com.fasterxml.jackson.databind.DeserializationContext
6
+ import com.fasterxml.jackson.databind.JavaType
6
7
import com.fasterxml.jackson.databind.deser.SettableBeanProperty
7
8
import com.fasterxml.jackson.databind.deser.ValueInstantiator
8
9
import com.fasterxml.jackson.databind.deser.ValueInstantiators
@@ -28,6 +29,9 @@ internal class KotlinValueInstantiator(
28
29
// @see com.fasterxml.jackson.module.kotlin._ported.test.StrictNullChecksTest#testListOfGenericWithNullValue
29
30
private fun ValueParameter.isNullishTypeAt(index: Int) = arguments.getOrNull(index)?.isNullable ?: true
30
31
32
+ private fun JavaType.requireEmptyValue() =
33
+ (nullToEmptyCollection && this.isCollectionLikeType) || (nullToEmptyMap && this.isMapLikeType)
34
+
31
35
private fun strictNullCheck(
32
36
ctxt: DeserializationContext,
33
37
jsonProp: SettableBeanProperty,
@@ -87,7 +91,7 @@ internal class KotlinValueInstantiator(
87
91
}
88
92
}
89
93
90
- if (paramVal == null && ((nullToEmptyCollection && jsonProp.type.isCollectionLikeType) || (nullToEmptyMap && jsonProp.type.isMapLikeType) )) {
94
+ if (paramVal == null && jsonProp.type.requireEmptyValue( )) {
91
95
paramVal = NullsAsEmptyProvider(jsonProp.valueDeserializer).getNullValue(ctxt)
92
96
}
93
97
You can’t perform that action at this time.
0 commit comments