Skip to content

Commit

Permalink
Merge pull request #742 from k163377/empty-value
Browse files Browse the repository at this point in the history
Minor performance improvements to NullToEmptyCollection/Map
  • Loading branch information
k163377 authored Dec 16, 2023
2 parents c53e606 + 0714c3b commit 7369aad
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 7369aad

Please sign in to comment.