Package org.openrewrite.java.jackson
Class ReadValueUrlToOpenStream
java.lang.Object
org.openrewrite.Recipe
org.openrewrite.java.jackson.ReadValueUrlToOpenStream
- All Implemented Interfaces:
Cloneable
public class ReadValueUrlToOpenStream
extends org.openrewrite.Recipe
Migrates
ObjectMapper.readValue(URL, ...) calls to feed
URL.openStream() into the surviving readValue(InputStream, ...)
overload. Jackson 3.x removed all three URL-accepting readValue
overloads (Class, JavaType, TypeReference) from
ObjectMapper; bare package renames downstream would leave call sites
uncompilable. URL.openStream() is what Jackson 2.x's readValue(URL, ...)
did internally, so the substitution is semantics-preserving for the default
JsonParser.Feature.AUTO_CLOSE_SOURCE (which is on by default and causes
Jackson to close the stream after reading).-
Nested Class Summary
Nested classes/interfaces inherited from class org.openrewrite.Recipe
org.openrewrite.Recipe.Builder, org.openrewrite.Recipe.DelegatingRecipe -
Field Summary
Fields inherited from class org.openrewrite.Recipe
contributors, examples, PANIC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.openrewrite.TreeVisitor<?, org.openrewrite.ExecutionContext> Methods inherited from class org.openrewrite.Recipe
addDataTable, aggregateDataTableDescriptors, builder, buildRecipeList, causesAnotherCycle, clone, createRecipeDescriptor, equals, getContributors, getDataTableDescriptors, getDescription, getDescriptor, getDisplayName, getEstimatedEffortPerOccurrence, getExamples, getInstanceName, getInstanceNameSuffix, getJacksonPolymorphicTypeTag, getMaintainers, getName, getRecipeList, getTags, hashCode, maxCycles, noop, onComplete, run, run, run, setContributors, setExamples, validate, validate, validateAll, validateAll, withOptions
-
Constructor Details
-
ReadValueUrlToOpenStream
public ReadValueUrlToOpenStream()
-
-
Method Details
-
getVisitor
public org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getVisitor()- Overrides:
getVisitorin classorg.openrewrite.Recipe
-