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
Affected version: all versions (up to jackson-dataformat-xml-2.9.0.pr3)
Currently, if you create an instance of XmlMapper and register a module with it, any copies of that mapper will not contain the registered module. This behavior is different from the behavior of ObjectMapper, which retains all other configurations, such as modules, serialization/deserialization configs, etc.
final XmlMapper mapper = new XmlMapper();
mapper.registerModule(new JaxbAnnotationModule());
final XmlMapper mapperWithoutModule = mapper.copy();
I think this could be easily resolved by following the same copy-constructor pattern that ObjectMapper uses to copy itself, and then just invoking super's constructor in XmlMapper's copy constructor.
I'll have a PR up shortly.
The text was updated successfully, but these errors were encountered:
gtrog
changed the title
XmlMapper.copy() doesn't properly copy internal configurations
XmlMapper.copy() doesn't properly copy internal configurations
May 16, 2017
Affected version: all versions (up to jackson-dataformat-xml-2.9.0.pr3)
Currently, if you create an instance of XmlMapper and register a module with it, any copies of that mapper will not contain the registered module. This behavior is different from the behavior of
ObjectMapper
, which retains all other configurations, such as modules, serialization/deserialization configs, etc.I think this could be easily resolved by following the same copy-constructor pattern that
ObjectMapper
uses to copy itself, and then just invoking super's constructor inXmlMapper
's copy constructor.I'll have a PR up shortly.
The text was updated successfully, but these errors were encountered: