Skip to content

Commit

Permalink
Workaround for issue#3275
Browse files Browse the repository at this point in the history
See my comments in FasterXML#3275
  • Loading branch information
gsinghlulu authored May 24, 2022
1 parent 3be6147 commit edb5571
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public JsonDeserializer<Object> buildThrowableDeserializer(DeserializationContex
AnnotatedMethod am = beanDesc.findMethod("initCause", INIT_CAUSE_PARAMS);
if (am != null) { // should never be null
SimpleBeanPropertyDefinition propDef = SimpleBeanPropertyDefinition.construct(ctxt.getConfig(), am,
new PropertyName("cause"));
new PropertyName(getThrowableCausePropertyName(builder)));
SettableBeanProperty prop = constructSettableProperty(ctxt, beanDesc, propDef,
am.getParameterType(0));
if (prop != null) {
Expand Down Expand Up @@ -475,6 +475,15 @@ public JsonDeserializer<Object> buildThrowableDeserializer(DeserializationContex
/* Helper methods for Bean deserializer construction
/**********************************************************
*/

private String getThrowableCausePropertyName(BeanDeserializerBuilder builder) {
String propertyName = "cause";
if(builder._properties.containsKey("Cause")) {
propertyName = "Cause";
}
return propertyName;
}


/**
* Overridable method that constructs a {@link BeanDeserializerBuilder}
Expand Down

0 comments on commit edb5571

Please sign in to comment.