-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove "impossible" IOException
in readTree()
and readValue()
ObjectMapper
methods which accept Strings
#1675
Comments
@matthew-pwnieexpress True, although the problem is that methods it has to call on So I don't see much value in adding extra code to slightly reduce declaration of kinds of exceptions that may be thrown. |
@cowtowncoder Sure. Though there is already the workaround in place for writing the value as String/byte[], so there is prior art/existing API using this pattern within the class. |
True. I'll have a look when I get chance. |
+1 for this. I feel kind of awkward in the following scenario:
Or this:
Both code snippets are weird for me. |
Quick note: Jackson 3.x will change But we can definitely consider changes to |
@cowtowncoder Thanks for the explanations. Very helpful. |
IOException
in readTree()
and readValue()
ObjectMapper
methods which accept Strings
* Bump jackson.version from 2.9.7 to 2.10.1 Bumps `jackson.version` from 2.9.7 to 2.10.1. Updates `jackson-databind` from 2.9.7 to 2.10.1 - [Release notes](https://github.com/FasterXML/jackson/releases) - [Commits](https://github.com/FasterXML/jackson/commits) Updates `jackson-dataformat-cbor` from 2.9.7 to 2.10.1 - [Release notes](https://github.com/FasterXML/jackson-dataformats-binary/releases) - [Commits](FasterXML/jackson-dataformats-binary@jackson-dataformats-binary-2.9.7...jackson-dataformats-binary-2.10.1) Updates `jackson-datatype-jsr310` from 2.9.7 to 2.10.1 Updates `jackson-modules-java8` from 2.9.7 to 2.10.1 - [Release notes](https://github.com/FasterXML/jackson-modules-java8/releases) - [Commits](FasterXML/jackson-modules-java8@jackson-modules-java8-2.9.7...jackson-modules-java8-2.10.1) Signed-off-by: dependabot[bot] <[email protected]> * Fixes related to jackson-databind upgrade * Minor change to exception handling to account for behavioural change in FasterXML/jackson-databind#1675
Unless I'm missing something, methods which read from Strings should never be able to throw an IOException. It seems like it would be a nice API improvement if such ObjectMapper no longer threw the (checked) IOException, which must be explicitly handled and ignored. I'm not 100% sure, but this might also apply to the byte[] methods as well.
Relevant methods:
The text was updated successfully, but these errors were encountered: