Skip to content

Change parent type of JsonProcessingException to be RuntimeException #2177

@cowtowncoder

Description

@cowtowncoder

(NOTE: part of bigger set of changes, see https://github.com/FasterXML/jackson-future-ideas/wiki/JSTEP-4)

Although choice of JsonProcessingException to extend IOException made sense originally (I think), later developments -- in particular, Java 8 Streams and functional approach in general -- have made use of checked exceptions cumbersome for many use cases.
But due to backwards compatibility concerns, change of base exception type has not been possible within 2.x releases.

Now that we are working on 3.0, however, we can make this change. Compared to alternative of providing alternate subtypes of ObjectMapper, ObjectReader and/or ObjectWriter (ones that do not declare checked exceptions for methods), this leads to simpler API.
For 2.x we may still consider simpler work-arounds (maybe convenience wrappers), but with 3.0 let's rebase.

Note, too, that this will help use of Jackson for some specific cases like serialization of this from toString() (and with #2176).

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.xIssues to be only tackled for Jackson 3.x, not 2.xmost-wantedTag to indicate that there is heavy user +1'ing action

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions