Skip to content

Commit

Permalink
Fix #462 for 2.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed May 20, 2014
1 parent 4adfcbb commit f5485d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ Project: jackson-databind
Version: 2.3.4 (xx-xxx-2014)

#459: BeanDeserializerBuilder copy constructor not copying `_injectables`
#462: Annotation-provided Deserializers are not contextualized inside CreatorProperties
(reported by aarondav@github)

------------------------------------------------------------------------
=== History: ===
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,12 @@ protected CreatorProperty constructCreatorProperty(DeserializationContext ctxt,
property = property.withType(type);
}
// Is there an annotation that specifies exact deserializer?
JsonDeserializer<Object> deser = findDeserializerFromAnnotation(ctxt, param);
JsonDeserializer<?> deser = findDeserializerFromAnnotation(ctxt, param);
// As per [Issue#462] need to ensure we contextualize deserializer too
if (deser != null) {
deser = ctxt.handlePrimaryContextualization(deser, property);
}

// If yes, we are mostly done:
type = modifyTypeByAnnotation(ctxt, param, type);

Expand All @@ -690,7 +695,8 @@ protected CreatorProperty constructCreatorProperty(DeserializationContext ctxt,
if (typeDeser == null) {
typeDeser = findTypeDeserializer(config, type);
}

// Note: contextualization of typeDeser _should_ occur in constructor of CreatorProperty
// so it is not called directly here
CreatorProperty prop = new CreatorProperty(name, type, property.getWrapperName(),
typeDeser, beanDesc.getClassAnnotations(), param, index, injectableValueId,
metadata);
Expand Down

0 comments on commit f5485d3

Please sign in to comment.