Closed pfumagalli closed 10 years ago
Patch against 2.3.3:
--- ./orig/com/fasterxml/jackson/databind/deser/BeanDeserializer.java 2014-04-10 09:54:44.000000000 +0900
+++ ./fix/main/com/fasterxml/jackson/databind/deser/BeanDeserializer.java 2014-05-26 15:07:43.000000000 +0900
@@ -263,11 +273,22 @@
return deserializeWithUnwrapped(jp, ctxt);
}
if (_externalTypeIdHandler != null) {
return deserializeWithExternalTypeId(jp, ctxt);
}
- return deserializeFromObjectUsingNonDefault(jp, ctxt);
+
+ Object bean = deserializeFromObjectUsingNonDefault(jp, ctxt);
+ if (_injectables != null) {
+ injectValues(ctxt, bean);
+ }
+ if (_needViewProcesing) {
+ Class<?> view = ctxt.getActiveView();
+ if (view != null) {
+ return deserializeWithView(jp, ctxt, bean, view);
+ }
+ }
+ return bean;
}
final Object bean = _valueInstantiator.createUsingDefault(ctxt);
if (jp.canReadObjectId()) {
Object id = jp.getObjectId();
if (id != null) {
Whops, sorry for the duplicate issue.
See the pull request.
See discussion on the mailing list.
Basically, when a constructor is annotated with
@JsonCreator
, any field or method annotated with@JacksonInject
gets ignored.In version 2.3.3 this happens because at line 268 the
deserializeFromObject(...)
method simply returns:I fixed it locally by copying some code from below: