Skip to content

Commit 1ce6a0a

Browse files
committed
Fix #1907
1 parent 2430e96 commit 1ce6a0a

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

release-notes/CREDITS renamed to release-notes/CREDITS-2.x

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,3 +738,7 @@ Alexander Skvortcov (askvortcov@github)
738738
* Reported #1853: Deserialise from Object (using Creator methods) returns field name
739739
instead of value
740740
(2.9.4)
741+
742+
Joe Schafer (jschaf@github)
743+
* Reported #1907: Remove `getClass()` from `_valueType` argument for error reporting
744+
(2.9.4)

release-notes/VERSION-2.x

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Project: jackson-databind
2-
------------------------------------------------------------------------
1+
Project: jackson-databin------------------------------------------------------------------------
32
=== Releases ===
43
------------------------------------------------------------------------
54

@@ -28,6 +27,8 @@ Project: jackson-databind
2827
(reported by mcortella@github)
2928
#1899: Another two gadgets to exploit default typing issue in jackson-databind
3029
(reported by OneSourceCat@github)
30+
#1907: Remove `getClass()` from `_valueType` argument for error reporting
31+
(reported by Joe S)
3132

3233
2.9.3 (09-Dec-2017)
3334

src/main/java/com/fasterxml/jackson/databind/deser/std/FactoryBasedEnumDeserializer.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,17 @@ protected Object deserializeEnumUsingPropertyBased(final JsonParser p, final Des
177177
// ************ Got the below methods from BeanDeserializer ********************//
178178

179179
protected final Object _deserializeWithErrorWrapping(JsonParser p, DeserializationContext ctxt,
180-
SettableBeanProperty prop) throws IOException {
181-
try {
182-
return prop.deserialize(p, ctxt);
183-
} catch (Exception e) {
184-
wrapAndThrow(e, _valueClass.getClass(), prop.getName(), ctxt);
185-
// never gets here, unless caller declines to throw an exception
186-
return null;
187-
}
180+
SettableBeanProperty prop) throws IOException
181+
{
182+
try {
183+
return prop.deserialize(p, ctxt);
184+
} catch (Exception e) {
185+
return wrapAndThrow(e, handledType(), prop.getName(), ctxt);
186+
}
188187
}
189188

190-
public void wrapAndThrow(Throwable t, Object bean, String fieldName, DeserializationContext ctxt)
191-
throws IOException
189+
protected Object wrapAndThrow(Throwable t, Object bean, String fieldName, DeserializationContext ctxt)
190+
throws IOException
192191
{
193192
throw JsonMappingException.wrapWithPath(throwOrReturnThrowable(t, ctxt), bean, fieldName);
194193
}
@@ -209,4 +208,4 @@ private Throwable throwOrReturnThrowable(Throwable t, DeserializationContext ctx
209208
}
210209
return t;
211210
}
212-
}
211+
}

0 commit comments

Comments
 (0)