You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A NullPointerException occurs parsing a (YAML) file to a Kotlin class. The object is created using a @JsonCreator that does not use all properties in the file.
Version information
2.15.0
To Reproduce
Have a data class SomeTaskListClass with a property that is a list of another class Task. The Task class has a @JsonCreator annotated static method to create it. It does not need/mention all properties of the file. The parser is configured to ignore those fields.
Parsing results in this error
com.fasterxml.jackson.databind.JsonMappingException: Cannot invoke "com.fasterxml.jackson.core.JsonParser.streamReadConstraints()" because "p" is null (through reference chain: SomeTaskListClass["tasks"]->java.util.ArrayList[0])
(...)
Caused by: java.lang.NullPointerException: Cannot invoke "com.fasterxml.jackson.core.JsonParser.streamReadConstraints()" because "p" is null
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handlePolymorphic(BeanDeserializerBase.java:1749)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:541)
Describe the bug
A NullPointerException occurs parsing a (YAML) file to a Kotlin class. The object is created using a @JsonCreator that does not use all properties in the file.
Version information
2.15.0
To Reproduce
Have a data class
SomeTaskListClass
with a property that is a list of another classTask
. TheTask
class has a@JsonCreator
annotated static method to create it. It does not need/mention all properties of the file. The parser is configured to ignore those fields.Parsing results in this error
The line casing the error in
handlePolymorphic
isa few lines later is a null check for
p
.Looking at the call-site in
_deserializeUsingPropertyBased
, that NPE makes senseExpected behavior
Parsing works without error.
The text was updated successfully, but these errors were encountered: