-
-
Notifications
You must be signed in to change notification settings - Fork 181
Description
This is an issue regarding the following comment.
#806 (comment)
Currently KotlinValueInstantiator.createFromObjectWith
throws an exception directly if the input is an illegal null
.
https://github.com/FasterXML/jackson-module-kotlin/blob/9d4ad6a5e85bc5eb58f69700199c7cee776d2f86/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinValueInstantiator.kt
On the other hand, databind
calls DeserializationContext.handleInstantiationProblem
(DeserializationProblemHandler.handleInstantiationProblem
).
https://github.com/FasterXML/jackson-databind/blob/f624751d3c4c13405c8d07051b8954a691f265f7/src/main/java/com/fasterxml/jackson/databind/deser/std/StdValueInstantiator.java#L284-L295
Therefore, KotlinValueInstantiator
should be modified as follows
- If
paramVal
is an illegalnull
, callDeserializationContext.handleInstantiationProblem
- If not handled or if it is a custom error, throw and exit
- If the result of the call of 1 was a value, continue deserialization using that value
Note that the error caused by strictNullCheck
is assumed to be excluded from the correction because the process will be eliminated from KotlinValueInstantiator
when the #719 correction is made.