You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given that use of checked exceptions can be problematic for some use cases, perhaps it would make sense to implement an ObjectMapper-like abstraction that can wrap an actual ObjectMapper, but expose set of methods that do NOT throw IOException (and subtypes), but rather wrap such exceptions as RuntimeExceptions.
Actually, since it is ok for sub-class to remove exceptions from signature, this could just be a sub-class of ObjectMapper, for improved compatibility (cast as ObjectMapper there is no benefit wrt exception declarations, but it would work).
However, implementation should still use delegation model instead of sub-classing, to support use with other ObjectMapper subtypes, like XmlMapper.
This is a half-baked idea at this point, so feel free to add comments for improvements, or for/against the idea. Note however that API definition of ObjectMapper itself is not under discussion for Jackson 2.x, at least; and even for 3.x change to unchecked exceptions would be a major change and would need separate discussion.
C-Otto, miguelaferreira, Jhilan, fabriziocucci, mageddo and 1 more