Skip to content

Commit

Permalink
Minor performance improvements to NullToEmptyCollection/Map
Browse files Browse the repository at this point in the history
  • Loading branch information
k163377 committed Dec 16, 2023
1 parent c53e606 commit 56f264c
Showing 1 changed file with 1 addition and 2 deletions.
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 56f264c

Please sign in to comment.