Skip to content

Commit a9017ec

Browse files
committed
Fix #2560
1 parent f229cb0 commit a9017ec

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

release-notes/CREDITS-2.x

+4
Original file line numberDiff line numberDiff line change
@@ -1006,3 +1006,7 @@ Mark Schäfer (mark--@github)
10061006
Fabian Lange (CodingFabian@github)
10071007
* Reported #2556: Contention in `TypeNameIdResolver.idFromClass()`
10081008
(2.10.2)
1009+
1010+
Stefan Wendt (stewe@github)
1011+
* Reported #2560: Check `WRAP_EXCEPTIONS` in `CollectionDeserializer.handleNonArray()`
1012+
(2.10.2)

release-notes/VERSION-2.x

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Project: jackson-databind
1212
(reported by cpopp@github)
1313
#2556: Contention in `TypeNameIdResolver.idFromClass()`
1414
(reported by Fabian L)
15+
#2560: Check `WRAP_EXCEPTIONS` in `CollectionDeserializer.handleNonArray()`
16+
(reported by Stefan W)
1517

1618
2.10.1 (09-Nov-2019)
1719

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

+4
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,10 @@ protected final Collection<Object> handleNonArray(JsonParser p, DeserializationC
349349
value = valueDes.deserializeWithType(p, ctxt, typeDeser);
350350
}
351351
} catch (Exception e) {
352+
boolean wrap = (ctxt == null) || ctxt.isEnabled(DeserializationFeature.WRAP_EXCEPTIONS);
353+
if (!wrap) {
354+
ClassUtil.throwIfRTE(e);
355+
}
352356
// note: pass Object.class, not Object[].class, as we need element type for error info
353357
throw JsonMappingException.wrapWithPath(e, Object.class, result.size());
354358
}

0 commit comments

Comments
 (0)