diff --git a/release-notes/CREDITS-2.x b/release-notes/CREDITS-2.x index 786ee539d8..9202c22415 100644 --- a/release-notes/CREDITS-2.x +++ b/release-notes/CREDITS-2.x @@ -1006,3 +1006,7 @@ Mark Schäfer (mark--@github) Fabian Lange (CodingFabian@github) * Reported #2556: Contention in `TypeNameIdResolver.idFromClass()` (2.10.2) + +Stefan Wendt (stewe@github) + * Reported #2560: Check `WRAP_EXCEPTIONS` in `CollectionDeserializer.handleNonArray()` + (2.10.2) diff --git a/release-notes/VERSION-2.x b/release-notes/VERSION-2.x index dfc39f7e08..2c913841e7 100644 --- a/release-notes/VERSION-2.x +++ b/release-notes/VERSION-2.x @@ -12,6 +12,8 @@ Project: jackson-databind (reported by cpopp@github) #2556: Contention in `TypeNameIdResolver.idFromClass()` (reported by Fabian L) +#2560: Check `WRAP_EXCEPTIONS` in `CollectionDeserializer.handleNonArray()` + (reported by Stefan W) 2.10.1 (09-Nov-2019) diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/CollectionDeserializer.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/CollectionDeserializer.java index 7ce48509a8..9b37ecb1d3 100644 --- a/src/main/java/com/fasterxml/jackson/databind/deser/std/CollectionDeserializer.java +++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/CollectionDeserializer.java @@ -349,6 +349,10 @@ protected final Collection handleNonArray(JsonParser p, DeserializationC value = valueDes.deserializeWithType(p, ctxt, typeDeser); } } catch (Exception e) { + boolean wrap = (ctxt == null) || ctxt.isEnabled(DeserializationFeature.WRAP_EXCEPTIONS); + if (!wrap) { + ClassUtil.throwIfRTE(e); + } // note: pass Object.class, not Object[].class, as we need element type for error info throw JsonMappingException.wrapWithPath(e, Object.class, result.size()); }