-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Currently deserialiazing a class that has multiple creators with available parameter names doesn't prioritize the creator annotated with @JsonCreator.
In the new java 8 ParameterNamesAnnotationIntrospector parameter names are resolved for every creator in a class that has been compiled with -parameters option. JacksonAnnotationIntrospector on the other hand, can resolve parameter names only by using @JsonProperty.
When there are multiple creators with parameter names available it seems that the creator with longest parameter list is the preffered one. In the case of JacksonAnnotationIntrospector this is not a problem since it wouldn't make sense for a client to annotate parameters with @JsonProperty on more than one creator.
I've made a test that isolates this issue in a fork. The mocked introspector mimics the behavior of the ParameterNamesAnnotationIntrospector in the new module and if you ignore the givenAnnotationIntrospectorFindsConstructorParameterNames in the test the test will pass.