Replace throw new IOException(..) inside Jackson serializer / deserializer overrides
Apache 2.0In Jackson 3, serialize() and deserialize() methods no longer declare throws IOException. This recipe removes the throws IOException declaration from overrides of JsonSerializer.serialize, JsonSerializer.serializeWithType, JsonDeserializer.deserialize, and JsonDeserializer.deserializeWithType, and rewrites throw new IOException(msg[, cause]) inside those overrides to JsonMappingException.from(<generator|parser>, msg[, cause]). A companion type change later migrates JsonMappingException to tools.jackson.databind.DatabindException.
org. openrewrite. java. jackson. ReplaceIOExceptionThrowInJacksonOverridesmod run . --recipe= org. openrewrite. java. jackson. ReplaceIOExceptionThrowInJacksonOverridesInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.