StdKeyDeserializer
can erroneously use a static factory method with more than one argument
#1429
Milestone
StdKeyDeserializer
can erroneously use a static factory method with more than one argument
#1429
While investigating an issue, I found that there was different behavior for normal deserializers and key deserializers where deserializing a value as a field works as expected, but as a map key fails with "not a valid representation: wrong number of arguments".
A basic example:
It looks like this is because in
BasicBeanDescriptor
,findFactoryMethod
has an incorrect assumption about the contents of_classInfo.getStaticMethods()
, which will have any method namedvalueOf
and static methods annotated with@JsonCreator
:This can be worked around by annotating static factory methods not intended to be used as
@JsonCreator
s with@JsonIgnore
, due to the resolution in_classInfo.getStaticMethods()
, so is not really urgent.Please let me know if you have any questions about the issue!
Thanks,
Chris
The text was updated successfully, but these errors were encountered: