BeanDeserializerModifier.modifyDeserializer()
not applied to custom bean deserializers
#2392
Milestone
BeanDeserializerModifier.modifyDeserializer()
not applied to custom bean deserializers
#2392
When trying to modify the default deserializer for
java.time.Instant
using a BeanDeserializerModifier, I noticed that the modifier is not actually applied. On the other hand, a BeanSerializerModifier works just fine.The issue seems to be the following: in
com.fasterxml.jackson.databind.ser.BeanSerializerFactory
, method_createSerializer2
first looks for a custom serializer, stores it in a local variableser
:and at the end tries looking for matching modifiers and applies them if available, before returning
ser
:The BeanDeserializerFactory on the other hand just looks for a custom deserializer, and if found, returns it immediately:
without passing throug the logic handling deserializer modifiers - this only happens in the method
findStdDeserializer
, which would be called further down but only if none of the early returns before its invocation happen.Shouldn't a deserializer modifier have a chance to be applied to a custom deserializer as well, just like a serializer modifier already is to a custom serializer? The way it currently is handled is kind of inconsistent.
Affected version: 2.9.9.1
(The reason that there is a custom serializer and deserializer registered for
java.time.Instant
by the way is that it comes fromcom.fasterxml.jackson.datatype.jsr310.JavaTimeModule
.)The text was updated successfully, but these errors were encountered: