Modernize legacy jackson-core feature constants
org.openrewrite.java.jackson.UpgradeJackson_2_3_ModernizeJacksonCoreFeatures
Jackson 2.10 moved most flag constants out of JsonParser.Feature and JsonGenerator.Feature into the new JsonReadFeature / JsonWriteFeature (for JSON-specific flags) and StreamReadFeature / StreamWriteFeature (for format-agnostic flags). Jackson 3 keeps only the modern locations. This recipe rewrites every legacy constant to its Jackson 2-modern equivalent so the rest of the Jackson 2 → 3 pipeline (in particular the builder migrations) sees flags the modern API will accept.
Tags
Recipe source
GitHub: jackson-2-3.yml, Issue Tracker, Maven Central
This recipe is composed of more than one recipe. If you want to customize the set of recipes this is composed of, you can find and copy the GitHub source for the recipe from the link above.
This recipe is available under the Apache License Version 2.0.
Definition
- Recipe List
- Yaml Recipe List
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_COMMENTS - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_JAVA_COMMENTS
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_YAML_COMMENTS - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_YAML_COMMENTS
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_UNQUOTED_FIELD_NAMES
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_SINGLE_QUOTES - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_SINGLE_QUOTES
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_UNQUOTED_CONTROL_CHARS - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_UNESCAPED_CONTROL_CHARS
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_RS_CONTROL_CHAR - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_RS_CONTROL_CHAR
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_NUMERIC_LEADING_ZEROS - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_LEADING_ZEROS_FOR_NUMBERS
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_LEADING_PLUS_SIGN_FOR_NUMBERS - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_LEADING_PLUS_SIGN_FOR_NUMBERS
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERS - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERS
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_TRAILING_DECIMAL_POINT_FOR_NUMBERS - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_TRAILING_DECIMAL_POINT_FOR_NUMBERS
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_MISSING_VALUES - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_MISSING_VALUES
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_TRAILING_COMMA - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_TRAILING_COMMA
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.AUTO_CLOSE_SOURCE - fullyQualifiedConstantName:
com.fasterxml.jackson.core.StreamReadFeature.AUTO_CLOSE_SOURCE
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.STRICT_DUPLICATE_DETECTION - fullyQualifiedConstantName:
com.fasterxml.jackson.core.StreamReadFeature.STRICT_DUPLICATE_DETECTION
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.IGNORE_UNDEFINED - fullyQualifiedConstantName:
com.fasterxml.jackson.core.StreamReadFeature.IGNORE_UNDEFINED
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.INCLUDE_SOURCE_IN_LOCATION - fullyQualifiedConstantName:
com.fasterxml.jackson.core.StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.USE_FAST_DOUBLE_PARSER - fullyQualifiedConstantName:
com.fasterxml.jackson.core.StreamReadFeature.USE_FAST_DOUBLE_PARSER
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonParser.Feature.USE_FAST_BIG_NUMBER_PARSER - fullyQualifiedConstantName:
com.fasterxml.jackson.core.StreamReadFeature.USE_FAST_BIG_NUMBER_PARSER
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonGenerator.Feature.QUOTE_FIELD_NAMES - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonWriteFeature.QUOTE_FIELD_NAMES
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonGenerator.Feature.QUOTE_NON_NUMERIC_NUMBERS - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonWriteFeature.WRITE_NAN_AS_STRINGS
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonWriteFeature.WRITE_NUMBERS_AS_STRINGS
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonGenerator.Feature.ESCAPE_NON_ASCII - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonWriteFeature.ESCAPE_NON_ASCII
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonGenerator.Feature.WRITE_HEX_UPPER_CASE - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonWriteFeature.WRITE_HEX_UPPER_CASE
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonGenerator.Feature.ESCAPE_FORWARD_SLASHES - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonWriteFeature.ESCAPE_FORWARD_SLASHES
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonGenerator.Feature.COMBINE_UNICODE_SURROGATES_IN_UTF8 - fullyQualifiedConstantName:
com.fasterxml.jackson.core.json.JsonWriteFeature.COMBINE_UNICODE_SURROGATES_IN_UTF8
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonGenerator.Feature.AUTO_CLOSE_TARGET - fullyQualifiedConstantName:
com.fasterxml.jackson.core.StreamWriteFeature.AUTO_CLOSE_TARGET
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT - fullyQualifiedConstantName:
com.fasterxml.jackson.core.StreamWriteFeature.AUTO_CLOSE_CONTENT
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonGenerator.Feature.FLUSH_PASSED_TO_STREAM - fullyQualifiedConstantName:
com.fasterxml.jackson.core.StreamWriteFeature.FLUSH_PASSED_TO_STREAM
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonGenerator.Feature.WRITE_BIGDECIMAL_AS_PLAIN - fullyQualifiedConstantName:
com.fasterxml.jackson.core.StreamWriteFeature.WRITE_BIGDECIMAL_AS_PLAIN
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonGenerator.Feature.STRICT_DUPLICATE_DETECTION - fullyQualifiedConstantName:
com.fasterxml.jackson.core.StreamWriteFeature.STRICT_DUPLICATE_DETECTION
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonGenerator.Feature.IGNORE_UNKNOWN - fullyQualifiedConstantName:
com.fasterxml.jackson.core.StreamWriteFeature.IGNORE_UNKNOWN
- existingFullyQualifiedConstantName:
- Replace constant with another constant
- existingFullyQualifiedConstantName:
com.fasterxml.jackson.core.JsonGenerator.Feature.USE_FAST_DOUBLE_WRITER - fullyQualifiedConstantName:
com.fasterxml.jackson.core.StreamWriteFeature.USE_FAST_DOUBLE_WRITER
- existingFullyQualifiedConstantName:
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.jackson.UpgradeJackson_2_3_ModernizeJacksonCoreFeatures
displayName: Modernize legacy `jackson-core` feature constants
description: |
Jackson 2.10 moved most flag constants out of `JsonParser.Feature` and `JsonGenerator.Feature` into the new `JsonReadFeature` / `JsonWriteFeature` (for JSON-specific flags) and `StreamReadFeature` / `StreamWriteFeature` (for format-agnostic flags). Jackson 3 keeps only the modern locations. This recipe rewrites every legacy constant to its Jackson 2-modern equivalent so the rest of the Jackson 2 → 3 pipeline (in particular the builder migrations) sees flags the modern API will accept.
tags:
- jackson-3
recipeList:
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_COMMENTS
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_JAVA_COMMENTS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_YAML_COMMENTS
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_YAML_COMMENTS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_UNQUOTED_FIELD_NAMES
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_SINGLE_QUOTES
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_SINGLE_QUOTES
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_UNQUOTED_CONTROL_CHARS
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_UNESCAPED_CONTROL_CHARS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_RS_CONTROL_CHAR
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_RS_CONTROL_CHAR
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_NUMERIC_LEADING_ZEROS
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_LEADING_ZEROS_FOR_NUMBERS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_LEADING_PLUS_SIGN_FOR_NUMBERS
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_LEADING_PLUS_SIGN_FOR_NUMBERS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERS
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_TRAILING_DECIMAL_POINT_FOR_NUMBERS
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_TRAILING_DECIMAL_POINT_FOR_NUMBERS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_MISSING_VALUES
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_MISSING_VALUES
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.ALLOW_TRAILING_COMMA
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonReadFeature.ALLOW_TRAILING_COMMA
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.AUTO_CLOSE_SOURCE
fullyQualifiedConstantName: com.fasterxml.jackson.core.StreamReadFeature.AUTO_CLOSE_SOURCE
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.STRICT_DUPLICATE_DETECTION
fullyQualifiedConstantName: com.fasterxml.jackson.core.StreamReadFeature.STRICT_DUPLICATE_DETECTION
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.IGNORE_UNDEFINED
fullyQualifiedConstantName: com.fasterxml.jackson.core.StreamReadFeature.IGNORE_UNDEFINED
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.INCLUDE_SOURCE_IN_LOCATION
fullyQualifiedConstantName: com.fasterxml.jackson.core.StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.USE_FAST_DOUBLE_PARSER
fullyQualifiedConstantName: com.fasterxml.jackson.core.StreamReadFeature.USE_FAST_DOUBLE_PARSER
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonParser.Feature.USE_FAST_BIG_NUMBER_PARSER
fullyQualifiedConstantName: com.fasterxml.jackson.core.StreamReadFeature.USE_FAST_BIG_NUMBER_PARSER
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonGenerator.Feature.QUOTE_FIELD_NAMES
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonWriteFeature.QUOTE_FIELD_NAMES
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonGenerator.Feature.QUOTE_NON_NUMERIC_NUMBERS
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonWriteFeature.WRITE_NAN_AS_STRINGS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonWriteFeature.WRITE_NUMBERS_AS_STRINGS
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonGenerator.Feature.ESCAPE_NON_ASCII
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonWriteFeature.ESCAPE_NON_ASCII
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonGenerator.Feature.WRITE_HEX_UPPER_CASE
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonWriteFeature.WRITE_HEX_UPPER_CASE
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonGenerator.Feature.ESCAPE_FORWARD_SLASHES
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonWriteFeature.ESCAPE_FORWARD_SLASHES
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonGenerator.Feature.COMBINE_UNICODE_SURROGATES_IN_UTF8
fullyQualifiedConstantName: com.fasterxml.jackson.core.json.JsonWriteFeature.COMBINE_UNICODE_SURROGATES_IN_UTF8
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonGenerator.Feature.AUTO_CLOSE_TARGET
fullyQualifiedConstantName: com.fasterxml.jackson.core.StreamWriteFeature.AUTO_CLOSE_TARGET
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonGenerator.Feature.AUTO_CLOSE_JSON_CONTENT
fullyQualifiedConstantName: com.fasterxml.jackson.core.StreamWriteFeature.AUTO_CLOSE_CONTENT
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonGenerator.Feature.FLUSH_PASSED_TO_STREAM
fullyQualifiedConstantName: com.fasterxml.jackson.core.StreamWriteFeature.FLUSH_PASSED_TO_STREAM
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonGenerator.Feature.WRITE_BIGDECIMAL_AS_PLAIN
fullyQualifiedConstantName: com.fasterxml.jackson.core.StreamWriteFeature.WRITE_BIGDECIMAL_AS_PLAIN
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonGenerator.Feature.STRICT_DUPLICATE_DETECTION
fullyQualifiedConstantName: com.fasterxml.jackson.core.StreamWriteFeature.STRICT_DUPLICATE_DETECTION
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonGenerator.Feature.IGNORE_UNKNOWN
fullyQualifiedConstantName: com.fasterxml.jackson.core.StreamWriteFeature.IGNORE_UNKNOWN
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: com.fasterxml.jackson.core.JsonGenerator.Feature.USE_FAST_DOUBLE_WRITER
fullyQualifiedConstantName: com.fasterxml.jackson.core.StreamWriteFeature.USE_FAST_DOUBLE_WRITER
Used by
This recipe is used as part of the following composite recipes:
Examples
Example 1
UpgradeJackson_2_3_ModernizeJacksonCoreFeaturesTest#allowCommentsRenamedToAllowJavaComments
- java
- Diff
Before
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
class A {
JsonFactory factory = new JsonFactory().enable(JsonParser.Feature.ALLOW_COMMENTS);
}
After
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.json.JsonReadFeature;
class A {
JsonFactory factory = new JsonFactory().enable(JsonReadFeature.ALLOW_JAVA_COMMENTS);
}
@@ -2,1 +2,1 @@
import com.fasterxml.jackson.core.JsonFactory;
-import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.json.JsonReadFeature;
@@ -5,1 +5,1 @@
class A {
- JsonFactory factory = new JsonFactory().enable(JsonParser.Feature.ALLOW_COMMENTS);
+ JsonFactory factory = new JsonFactory().enable(JsonReadFeature.ALLOW_JAVA_COMMENTS);
}
Example 2
UpgradeJackson_2_3_ModernizeJacksonCoreFeaturesTest#allowCommentsRenamedToAllowJavaComments
- java
- Diff
Before
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
class A {
JsonFactory factory = new JsonFactory().enable(JsonParser.Feature.ALLOW_COMMENTS);
}
After
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.json.JsonReadFeature;
class A {
JsonFactory factory = new JsonFactory().enable(JsonReadFeature.ALLOW_JAVA_COMMENTS);
}
@@ -2,1 +2,1 @@
import com.fasterxml.jackson.core.JsonFactory;
-import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.json.JsonReadFeature;
@@ -5,1 +5,1 @@
class A {
- JsonFactory factory = new JsonFactory().enable(JsonParser.Feature.ALLOW_COMMENTS);
+ JsonFactory factory = new JsonFactory().enable(JsonReadFeature.ALLOW_JAVA_COMMENTS);
}
Usage
This recipe has no required configuration options. Users of Moderne can run it via the Moderne CLI.
You will need to have configured the Moderne CLI on your machine before you can run the following command.
mod run . --recipe UpgradeJackson_2_3_ModernizeJacksonCoreFeatures
If the recipe is not available locally, then you can install it using:
mod config recipes jar install org.openrewrite.recipe:rewrite-jackson:1.25.0
See how this recipe works across multiple open-source repositories
Run this recipe on OSS repos at scale with the Moderne SaaS.

The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.
Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.
Data Tables
- SourcesFileResults
- SearchResults
- SourcesFileErrors
- RecipeRunStats
Source files that had results
org.openrewrite.table.SourcesFileResults
Source files that were modified by the recipe run.
| Column Name | Description |
|---|---|
| Source path before the run | The source path of the file before the run. null when a source file was created during the run. |
| Source path after the run | A recipe may modify the source path. This is the path after the run. null when a source file was deleted during the run. |
| Parent of the recipe that made changes | In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all. |
| Recipe that made changes | The specific recipe that made a change. |
| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. |
| Cycle | The recipe cycle in which the change was made. |
Source files that had search results
org.openrewrite.table.SearchResults
Search results that were found during the recipe run.
| Column Name | Description |
|---|---|
| Source path of search result before the run | The source path of the file with the search result markers present. |
| Source path of search result after run the run | A recipe may modify the source path. This is the path after the run. null when a source file was deleted during the run. |
| Result | The trimmed printed tree of the LST element that the marker is attached to. |
| Description | The content of the description of the marker. |
| Recipe that added the search marker | The specific recipe that added the Search marker. |
Source files that errored on a recipe
org.openrewrite.table.SourcesFileErrors
The details of all errors produced by a recipe run.
| Column Name | Description |
|---|---|
| Source path | The file that failed to parse. |
| Recipe that made changes | The specific recipe that made a change. |
| Stack trace | The stack trace of the failure. |
Recipe performance
org.openrewrite.table.RecipeRunStats
Statistics used in analyzing the performance of recipes.
| Column Name | Description |
|---|---|
| The recipe | The recipe whose stats are being measured both individually and cumulatively. |
| Source file count | The number of source files the recipe ran over. |
| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. |
| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. |
| Max scanning time (ns) | The max time scanning any one source file. |
| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. |
| Max edit time (ns) | The max time editing any one source file. |