Skip to content

Commit

Permalink
Backported #1642 in 2.8.9
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jun 6, 2017
1 parent 752bb8a commit e2476e0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions release-notes/CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,10 @@ Andrew Joseph (apjoseph@github)
for `java.util.UUID`
(2.8.9)

Joe Littlejohn (joelittlejohn@github)
* Contributed #1642: Support `READ_UNKNOWN_ENUM_VALUES_AS_NULL` with `@JsonCreator`
(2.8.9)

Connor Kuhn (ckuhn@github)
* Contributed #1341: FAIL_ON_MISSING_EXTERNAL_TYPE_ID_PROPERTY
(2.9.0)
2 changes: 2 additions & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Project: jackson-databind
#1629: `FromStringDeserializer` ignores registered `DeserializationProblemHandler`
for `java.util.UUID`
(reported by Andrew J)
#1642: Support `READ_UNKNOWN_ENUM_VALUES_AS_NULL` with `@JsonCreator`
(contributed by Joe L)

2.8.8.1 (19-Apr-2017)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOEx
return _factory.callOnWith(_valueClass, value);
} catch (Exception e) {
Throwable t = ClassUtil.throwRootCauseIfIOE(e);
// [databind#1642]
if (ctxt.isEnabled(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL)
&& (t instanceof IllegalArgumentException)) {
return null;
}
return ctxt.handleInstantiationProblem(_valueClass, value, t);
}
}
Expand Down

0 comments on commit e2476e0

Please sign in to comment.