Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/main/java/tools/jackson/databind/ObjectMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -2694,8 +2694,19 @@ protected JsonNode _readTreeAndClose(DeserializationContextExt ctxt,
if (t == JsonToken.VALUE_NULL) {
resultNode = cfg.getNodeFactory().nullNode();
} else {
resultNode = (JsonNode) ctxt.readRootValue(p, valueType,
_findRootDeserializer(ctxt, valueType), null);
try {
resultNode = (JsonNode) ctxt.readRootValue(p, valueType,
_findRootDeserializer(ctxt, valueType), null);
} catch (JacksonException e) {
throw e;
} catch (RuntimeException e) {
// 05-Apr-2026: Parsers should only throw JacksonException but some
// format backends may throw RuntimeException on corrupt input (e.g.
// IndexOutOfBoundsException from TextBuffer). Wrap as StreamReadException.
// See https://github.com/FasterXML/jackson-dataformats-text/pull/648
throw new StreamReadException(p,
"Unexpected character (corrupt input): " + e.getMessage(), e);
}
// No ObjectIds so can ignore
// ctxt.checkUnresolvedObjectId();
}
Expand Down