Skip to content

Commit

Permalink
Use ReplaceConstantWithAnotherConstant in UseStandardCharsets
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Mar 2, 2024
1 parent 7c98a29 commit 3742541
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
36 changes: 18 additions & 18 deletions src/main/resources/META-INF/rewrite/apache-commons-io.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,21 @@ tags:
- apache
- commons
recipeList:
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: org.apache.commons.io.Charsets.ISO_8859_1
newFullyQualifiedTypeName: java.nio.charset.StandardCharsets.ISO_8859_1
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: org.apache.commons.io.Charsets.US_ASCII
newFullyQualifiedTypeName: java.nio.charset.StandardCharsets.US_ASCII
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: org.apache.commons.io.Charsets.UTF_8
newFullyQualifiedTypeName: java.nio.charset.StandardCharsets.UTF_8
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: org.apache.commons.io.Charsets.UTF_16
newFullyQualifiedTypeName: java.nio.charset.StandardCharsets.UTF_16
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: org.apache.commons.io.Charsets.UTF_16BE
newFullyQualifiedTypeName: java.nio.charset.StandardCharsets.UTF_16BE
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: org.apache.commons.io.Charsets.UTF_16LE
newFullyQualifiedTypeName: java.nio.charset.StandardCharsets.UTF_16LE
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.commons.io.Charsets.ISO_8859_1
fullyQualifiedConstantName: java.nio.charset.StandardCharsets.ISO_8859_1
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.commons.io.Charsets.US_ASCII
fullyQualifiedConstantName: java.nio.charset.StandardCharsets.US_ASCII
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.commons.io.Charsets.UTF_8
fullyQualifiedConstantName: java.nio.charset.StandardCharsets.UTF_8
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.commons.io.Charsets.UTF_16
fullyQualifiedConstantName: java.nio.charset.StandardCharsets.UTF_16
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.commons.io.Charsets.UTF_16BE
fullyQualifiedConstantName: java.nio.charset.StandardCharsets.UTF_16BE
- org.openrewrite.java.ReplaceConstantWithAnotherConstant:
existingFullyQualifiedConstantName: org.apache.commons.io.Charsets.UTF_16LE
fullyQualifiedConstantName: java.nio.charset.StandardCharsets.UTF_16LE
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.openrewrite.config.Environment;
import org.openrewrite.java.JavaParser;
import org.openrewrite.test.RecipeSpec;
import org.openrewrite.test.RewriteTest;
Expand All @@ -28,10 +27,7 @@ class UseJavaStandardCharsetsTest implements RewriteTest {
@Override
public void defaults(RecipeSpec spec) {
spec
.recipe(Environment.builder()
.scanRuntimeClasspath("org.openrewrite.apache.commons.io")
.build()
.activateRecipes("org.openrewrite.apache.commons.io.UseStandardCharsets"))
.recipeFromResources("org.openrewrite.apache.commons.io.UseStandardCharsets")
.parser(JavaParser.fromJavaVersion().classpath("commons-io"));
}

Expand Down

0 comments on commit 3742541

Please sign in to comment.