-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Milestone
Description
We recently moved from Jackson 2.8.x to 2.9.0.
Since then we started to experiment a new problematic behaviour.
Now a property annotated with @JsonBackReference
is NEVER deserialized, while before it was sometimes the case.
I think it is linked to e088920.
The property is removed in BeanDeserializerBuilder#addBackReferenceProperty()
:
/**
* Method called to add a property that represents so-called back reference;
* reference that "points back" to object that has forward reference to
* currently built bean.
*/
public void addBackReferenceProperty(String referenceName, SettableBeanProperty prop)
{
if (_backRefProperties == null) {
_backRefProperties = new HashMap<String, SettableBeanProperty>(4);
}
// 15-Sep-2016, tatu: For some reason fixing access at point of `build()` does
// NOT work (2 failing unit tests). Not 100% clear why, but for now force
// access set early; unfortunate, but since it works....
prop.fixAccess(_config);
_backRefProperties.put(referenceName, prop);
// also: if we had property with same name, actually remove it
if (_properties != null) {
_properties.remove(prop.getName());
}
// ??? 23-Jul-2012, tatu: Should it be included in list of all properties?
// For now, won't add, since it is inferred, not explicit...
}
Since 2.9.x (tested on 2.9.0 and 2.9.3), BeanDeserializerFactory.addBackReferenceProperties
passes a SettableBeanProperty
named as the annotated property.
In 2.8.x, the prop.getName()
returns defaultReference
.
Because of that, the property is always removed from the property map.
I am creating a PR with at least unit test to reproduce.
Metadata
Metadata
Assignees
Labels
No labels