Skip to content

Commit 7369aad

Browse files
authored
Merge pull request #742 from k163377/empty-value
Minor performance improvements to NullToEmptyCollection/Map
2 parents c53e606 + 0714c3b commit 7369aad

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

release-notes/CREDITS-2.x

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Contributors:
1818
# 2.17.0 (not yet released)
1919

2020
WrongWrong (@k163377)
21+
* #742: Minor performance improvements to NullToEmptyCollection/Map.
2122
* #741: Changed to allow KotlinFeature to be set in the function that registers a KotlinModule.
2223
* #740: Reduce conversion cache from Executable to KFunction.
2324
* #738: Fix JacksonInject priority.

release-notes/VERSION-2.x

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Co-maintainers:
1818

1919
2.17.0 (not yet released)
2020

21+
#742: Minor performance improvements to NullToEmptyCollection/Map.
2122
#741: Changed to allow KotlinFeature to be set in the function that registers a KotlinModule.
2223
The `jacksonObjectMapper {}` and `registerKotlinModule {}` lambdas allow configuration for KotlinModule.
2324
#740: Reduce conversion cache from Executable to KFunction.

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import com.fasterxml.jackson.databind.JavaType
88
import com.fasterxml.jackson.databind.deser.SettableBeanProperty
99
import com.fasterxml.jackson.databind.deser.ValueInstantiator
1010
import com.fasterxml.jackson.databind.deser.ValueInstantiators
11-
import com.fasterxml.jackson.databind.deser.impl.NullsAsEmptyProvider
1211
import com.fasterxml.jackson.databind.deser.impl.PropertyValueBuffer
1312
import com.fasterxml.jackson.databind.deser.std.StdValueInstantiator
1413
import java.lang.reflect.TypeVariable
@@ -89,7 +88,7 @@ internal class KotlinValueInstantiator(
8988

9089
if (paramVal == null) {
9190
if (propType.requireEmptyValue()) {
92-
paramVal = NullsAsEmptyProvider(jsonProp.valueDeserializer).getNullValue(ctxt)
91+
paramVal = jsonProp.valueDeserializer!!.getEmptyValue(ctxt)
9392
} else {
9493
val isMissingAndRequired = isMissing && jsonProp.isRequired
9594

0 commit comments

Comments
 (0)