Skip to content

ObjectReader.readValues doesn't stream anymore since Jackson 3.0 #5363

@modular-music-and-code

Description

@modular-music-and-code

Search before asking

  • I searched in the issues and found nothing similar.

Describe the bug

I have isolated a use case, see here (standalone Gradle project).

There are two unit tests, one for Jackson 2, one for Jackson 3.
They are mostly copy+paste except for the imports.
Streaming using ObjectReader.readValues works in Jackson 2 works, but fails in Jackson 3.

Version Information

3.0.1

Reproduction

( see the linked use case )
Run: >> gradle test

Expected behavior

Given following pseudo-code:

val m: ObjectMapper = /* create somehow */
val r: ObjectReader = m.reader()
val fileReader: BufferedReader = Files.newBufferedReader(file)
val p: JsonParser = r.createParser(fileReader)
val iter: Iterator<MyPOJO> = m.reader().readValues(p, MyPOJO::class.java)

The returned iter should iterate further while the underlying reader is read.
It does that with Jackson-2, but not with Jackson-3.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.0Issue planned for initial 3.0 releaseworks-as-intendedFor issues closed due to (new) behavior observed is as intended and not a flaw

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions