`UTF8DataInputJsonParser` reports end-of-input as `JacksonIOException` instead of `UnexpectedEndOfInputException`

Open
#1,761 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

@curforever is already working on this.

Since Oct 11, 2026.

  • #1763 by @curforever — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
57/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
api, backend

Research direction

Start by comparing EOF handling in UTF8DataInputJsonParser and UTF8StreamJsonParser, then trace how public entry points such as nextToken() and nextName() report errors with the current context or token. The issue suggests central mapping of EOFException to _reportInvalidEOF(); check existing parser tests for the listed inputs and add coverage for matching exception types and useful messages.

Written by the indexing model from the issue text.

Description

UTF8DataInputJsonParser reports most premature end-of-input as JacksonIOException (wrapping EOFException), whereas UTF8StreamJsonParser throws UnexpectedEndOfInputException for the same content.

Input InputStream DataInput
"abc UnexpectedEndOfInputException (in VALUE_STRING) JacksonIOException
{ "abc UnexpectedEndOfInputException (in property name) JacksonIOException
{"a": UnexpectedEndOfInputException (within/between Object entries) JacksonIOException
[ 12 UnexpectedEndOfInputException (expected close marker) JacksonIOException
+ UnexpectedEndOfInputException (in a Number value) JacksonIOException

With java.io.DataInputStream the message is just "N/A", since its EOFException has no message.

Only a few sites handle EOFException explicitly (_skipWSOrEnd(), escape decoding, and invalid-token reporting since #1752). Instead of adding more per-site catches, EOFException could be mapped to _reportInvalidEOF() centrally in nextToken(), nextName() and other public entry points, using the current context/token for the message.

Related: #325 (root-level end-of-input), #1752.

Dominant language
Java
Stars
2.4k
Forks
952
Avg merge
3d 6h
Merged PRs (30d)
32

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from FasterXML/jackson-core

All issues in FasterXML/jackson-core

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.