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
Found this in version 2.9.4 running some tests that go back and forth serializing with an XML mapper that uses annotations, and another one that ignores them. May be related to issue #171 and the cache of class annotations.
When running this code, the second print statement should use the annotation's localName but it instead uses the class name.
@JacksonXmlRootElement(localName = "myname")
public class XMLTest {
public static void main(String[] s) throws Exception {
final ObjectMapper xmlMapper = new XmlMapper();
final ObjectMapper noAnnotationsXmlMapper = xmlMapper.copy()
.configure(MapperFeature.USE_ANNOTATIONS, false)
.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
System.out.println(noAnnotationsXmlMapper.writeValueAsString(new XMLTest()));
System.out.println(xmlMapper.writeValueAsString(new XMLTest()));
}
}