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
{{ message }}
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.
This code fail on deserialization, because it's try to check the Leaf class, which should be ignored.
Caused by: java.lang.IllegalArgumentException: Conflicting setter definitions for property "test": org.l6m.Leaf#setTest(1 params) vs org.l6m.Leaf#setTest(1 params)
at com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.getSetter(POJOPropertyBuilder.java:293)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.filterBeanProps(BeanDeserializerFactory.java:583)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.addBeanProps(BeanDeserializerFactory.java:479)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.buildBeanDeserializer(BeanDeserializerFactory.java:220)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:143)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:409)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:358)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:265)
... 19 more
Jackson does not take into account the Leaf class if :
The abstract class is annoted with @JsonIgnoreProperties, with the leaf property as value
If the class used for the root property in IgnoreBugTest is Root and not AbstractRoot
The text was updated successfully, but these errors were encountered:
Your test has a bug in that setLeaf is static method. Static methods are never considered to relate to properties, and as such annotations have no effect (setter is not used at all). But since there is leaf field, that is considered to be usable for deserialization.
But beyond this, would the test pass without mrbean module?
Hmmh. I am still not sure I fully understand. As I pointed out, any annotation associated with a static field or method will be ignored by default, regardless of mrbean module: they are not related to class instances, only class. As such it does not matter what annotations you do or do not add.
But perhaps you are saying that mrbean module is accidentally looking at static methods, where it should not? If so, that would be a bug indeed.
Ok, yes indeed. So mrbean was accidentally considering static methods, mistaking that setLeaf as real setter. Fixed this for 2.5(.5) and 2.6(.3). Unfortunately this did not quite make it in 2.6.2, as it was just released earlier today.
Thank you for reporting this.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When deserialising, the MrBean module seems to not preserve the @JsonIgnore Annotation.
Test code following :
This code fail on deserialization, because it's try to check the Leaf class, which should be ignored.
Jackson does not take into account the Leaf class if :
The text was updated successfully, but these errors were encountered: