From 56f264c2f96101f55c218afea5d4105f854f9afd Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Sun, 17 Dec 2023 01:44:07 +0900 Subject: [PATCH 1/2] Minor performance improvements to NullToEmptyCollection/Map from https://github.com/ProjectMapK/jackson-module-kogera/pull/195/commits/997a5369c245045d98d5cd0444d0a3581c669cb1 --- .../fasterxml/jackson/module/kotlin/KotlinValueInstantiator.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinValueInstantiator.kt b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinValueInstantiator.kt index 5c37848b..06086531 100644 --- a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinValueInstantiator.kt +++ b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinValueInstantiator.kt @@ -8,7 +8,6 @@ import com.fasterxml.jackson.databind.JavaType import com.fasterxml.jackson.databind.deser.SettableBeanProperty import com.fasterxml.jackson.databind.deser.ValueInstantiator import com.fasterxml.jackson.databind.deser.ValueInstantiators -import com.fasterxml.jackson.databind.deser.impl.NullsAsEmptyProvider import com.fasterxml.jackson.databind.deser.impl.PropertyValueBuffer import com.fasterxml.jackson.databind.deser.std.StdValueInstantiator import java.lang.reflect.TypeVariable @@ -89,7 +88,7 @@ internal class KotlinValueInstantiator( if (paramVal == null) { if (propType.requireEmptyValue()) { - paramVal = NullsAsEmptyProvider(jsonProp.valueDeserializer).getNullValue(ctxt) + paramVal = jsonProp.valueDeserializer!!.getEmptyValue(ctxt) } else { val isMissingAndRequired = isMissing && jsonProp.isRequired From 0714c3bca509dac46cba9ef7ffe51a4f555e34c4 Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Sun, 17 Dec 2023 01:48:25 +0900 Subject: [PATCH 2/2] Update release notes wrt #742 --- release-notes/CREDITS-2.x | 1 + release-notes/VERSION-2.x | 1 + 2 files changed, 2 insertions(+) diff --git a/release-notes/CREDITS-2.x b/release-notes/CREDITS-2.x index add6d3d2..76d1c3d4 100644 --- a/release-notes/CREDITS-2.x +++ b/release-notes/CREDITS-2.x @@ -18,6 +18,7 @@ Contributors: # 2.17.0 (not yet released) WrongWrong (@k163377) +* #742: Minor performance improvements to NullToEmptyCollection/Map. * #741: Changed to allow KotlinFeature to be set in the function that registers a KotlinModule. * #740: Reduce conversion cache from Executable to KFunction. * #738: Fix JacksonInject priority. diff --git a/release-notes/VERSION-2.x b/release-notes/VERSION-2.x index 35f1d542..d9d7dc4b 100644 --- a/release-notes/VERSION-2.x +++ b/release-notes/VERSION-2.x @@ -18,6 +18,7 @@ Co-maintainers: 2.17.0 (not yet released) +#742: Minor performance improvements to NullToEmptyCollection/Map. #741: Changed to allow KotlinFeature to be set in the function that registers a KotlinModule. The `jacksonObjectMapper {}` and `registerKotlinModule {}` lambdas allow configuration for KotlinModule. #740: Reduce conversion cache from Executable to KFunction.