From 544cc6156cb546a9509e86fec3f47253bd335668 Mon Sep 17 00:00:00 2001 From: Ivo Studensky Date: Thu, 30 Jan 2020 11:23:12 +0100 Subject: [PATCH] Fix #2482 --- .../com/fasterxml/jackson/databind/JsonMappingException.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/fasterxml/jackson/databind/JsonMappingException.java b/src/main/java/com/fasterxml/jackson/databind/JsonMappingException.java index 4c258186f4..a7de58b9f9 100644 --- a/src/main/java/com/fasterxml/jackson/databind/JsonMappingException.java +++ b/src/main/java/com/fasterxml/jackson/databind/JsonMappingException.java @@ -251,7 +251,9 @@ public JsonMappingException(Closeable processor, String msg) { public JsonMappingException(Closeable processor, String msg, Throwable problem) { super(msg, problem); _processor = processor; - if (processor instanceof JsonParser) { + if (problem instanceof JsonProcessingException) { + _location = ((JsonProcessingException) problem).getLocation(); + } else if (processor instanceof JsonParser) { _location = ((JsonParser) processor).getTokenLocation(); } }