FasterXML/jackson-module-jaxb-annotations — pull request #32 by q3aiml (2014-10-09 04:09:42+00:00)
Title: fix deserialization of Collection with @XmlJavaTypeAdapter on method

Fixes a bug (regression, I think?) where an @XmlJavaTypeAdapter applied to a method (getter or setter) for a collection type is applied only during serialization but not deserialization. A unit test is included demonstrating the issue and the fix.

The fix involves two small parts.

First, it changes findDeserializationContentConverter to call _findContentAdapter with forSerialization = false. This causes _findContentAdapter to look at the parameter of the setter as the expected type of the adapter, rather than incorrectly using the return value which is often or always void.

Second, it also changes checkAdapter to always check the second adapter type parameter, which is the bound type (the type used in the java representation). Using the value type, as the previous behavior did based on forSerialization, does not seem correct: the java
code, both for serialization and deserialization, for getter and for setter and field, is always using the
bound type. This wasn't an issue before as all the call sites (ignoring potential external subclasses) used forSerialization = true.

I did not dig into why the non-collection annotated method deserialization paths still work when calling _findContentAdapter with forSerialization = true, but the existing tests show they work.

Thanks for looking and all your work on jackson,
Andy