From 2bb8a7a67983df4aadda8906452f273c4f3626a0 Mon Sep 17 00:00:00 2001 From: Simon Verhoeven Date: Sat, 21 Oct 2023 17:47:49 +0200 Subject: [PATCH 1/3] fix: remove unused variable --- .../java/org/openrewrite/java/migrate/util/UseEnumSetOf.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/org/openrewrite/java/migrate/util/UseEnumSetOf.java b/src/main/java/org/openrewrite/java/migrate/util/UseEnumSetOf.java index a9e57dcf69..effccd7ba2 100644 --- a/src/main/java/org/openrewrite/java/migrate/util/UseEnumSetOf.java +++ b/src/main/java/org/openrewrite/java/migrate/util/UseEnumSetOf.java @@ -29,7 +29,6 @@ import java.time.Duration; import java.util.List; -import java.util.StringJoiner; public class UseEnumSetOf extends Recipe { private static final MethodMatcher SET_OF = new MethodMatcher("java.util.Set of(..)", true); @@ -66,9 +65,7 @@ public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, Execu if (isAssignmentSetOfEnum(type)) { maybeAddImport("java.util.EnumSet"); - StringJoiner setOf = new StringJoiner(", ", "EnumSet.of(", ")"); List args = m.getArguments(); - args.forEach(o -> setOf.add("#{any()}")); return JavaTemplate.builder("EnumSet.of(#{any()})") .contextSensitive() .imports("java.util.EnumSet") From 25844a91b558b19852eb16f1c9b12fe64fe7cc77 Mon Sep 17 00:00:00 2001 From: Simon Verhoeven Date: Sat, 21 Oct 2023 19:05:35 +0200 Subject: [PATCH 2/3] chore: remove unused imports --- .../org/openrewrite/java/migrate/javax/AnnotateTypesVisitor.java | 1 - .../org/openrewrite/java/migrate/lombok/LombokValToFinalVar.java | 1 - .../org/openrewrite/java/migrate/jakarta/JavaxToJakartaTest.java | 1 - 3 files changed, 3 deletions(-) diff --git a/src/main/java/org/openrewrite/java/migrate/javax/AnnotateTypesVisitor.java b/src/main/java/org/openrewrite/java/migrate/javax/AnnotateTypesVisitor.java index 3ac8386980..f5bd1ad9f1 100644 --- a/src/main/java/org/openrewrite/java/migrate/javax/AnnotateTypesVisitor.java +++ b/src/main/java/org/openrewrite/java/migrate/javax/AnnotateTypesVisitor.java @@ -20,7 +20,6 @@ import org.openrewrite.java.JavaParser; import org.openrewrite.java.JavaTemplate; import org.openrewrite.java.tree.J; -import org.openrewrite.java.tree.JavaType; import org.openrewrite.java.tree.TypeUtils; import java.util.Comparator; diff --git a/src/main/java/org/openrewrite/java/migrate/lombok/LombokValToFinalVar.java b/src/main/java/org/openrewrite/java/migrate/lombok/LombokValToFinalVar.java index 858b23d531..0d3c69f19a 100644 --- a/src/main/java/org/openrewrite/java/migrate/lombok/LombokValToFinalVar.java +++ b/src/main/java/org/openrewrite/java/migrate/lombok/LombokValToFinalVar.java @@ -21,7 +21,6 @@ import org.openrewrite.TreeVisitor; import org.openrewrite.internal.ListUtils; import org.openrewrite.java.JavaIsoVisitor; -import org.openrewrite.java.JavaParser; import org.openrewrite.java.JavaTemplate; import org.openrewrite.java.search.UsesType; import org.openrewrite.java.tree.J; diff --git a/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxToJakartaTest.java b/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxToJakartaTest.java index d0fdcd00da..6acc7c47ae 100644 --- a/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxToJakartaTest.java +++ b/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxToJakartaTest.java @@ -19,7 +19,6 @@ import org.junit.jupiter.api.Test; import org.openrewrite.DocumentExample; import org.openrewrite.config.Environment; -import org.openrewrite.java.ChangeType; import org.openrewrite.java.JavaParser; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; From 7e1c08457edae143b035400bd4d29a19aa53c939 Mon Sep 17 00:00:00 2001 From: Simon Verhoeven Date: Sat, 21 Oct 2023 19:05:35 +0200 Subject: [PATCH 3/3] chore: remove unused imports --- .../org/openrewrite/java/migrate/javax/AnnotateTypesVisitor.java | 1 - .../org/openrewrite/java/migrate/lombok/LombokValToFinalVar.java | 1 - .../org/openrewrite/java/migrate/jakarta/JavaxToJakartaTest.java | 1 - 3 files changed, 3 deletions(-) diff --git a/src/main/java/org/openrewrite/java/migrate/javax/AnnotateTypesVisitor.java b/src/main/java/org/openrewrite/java/migrate/javax/AnnotateTypesVisitor.java index 3ac8386980..f5bd1ad9f1 100644 --- a/src/main/java/org/openrewrite/java/migrate/javax/AnnotateTypesVisitor.java +++ b/src/main/java/org/openrewrite/java/migrate/javax/AnnotateTypesVisitor.java @@ -20,7 +20,6 @@ import org.openrewrite.java.JavaParser; import org.openrewrite.java.JavaTemplate; import org.openrewrite.java.tree.J; -import org.openrewrite.java.tree.JavaType; import org.openrewrite.java.tree.TypeUtils; import java.util.Comparator; diff --git a/src/main/java/org/openrewrite/java/migrate/lombok/LombokValToFinalVar.java b/src/main/java/org/openrewrite/java/migrate/lombok/LombokValToFinalVar.java index 858b23d531..0d3c69f19a 100644 --- a/src/main/java/org/openrewrite/java/migrate/lombok/LombokValToFinalVar.java +++ b/src/main/java/org/openrewrite/java/migrate/lombok/LombokValToFinalVar.java @@ -21,7 +21,6 @@ import org.openrewrite.TreeVisitor; import org.openrewrite.internal.ListUtils; import org.openrewrite.java.JavaIsoVisitor; -import org.openrewrite.java.JavaParser; import org.openrewrite.java.JavaTemplate; import org.openrewrite.java.search.UsesType; import org.openrewrite.java.tree.J; diff --git a/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxToJakartaTest.java b/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxToJakartaTest.java index d0fdcd00da..6acc7c47ae 100644 --- a/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxToJakartaTest.java +++ b/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxToJakartaTest.java @@ -19,7 +19,6 @@ import org.junit.jupiter.api.Test; import org.openrewrite.DocumentExample; import org.openrewrite.config.Environment; -import org.openrewrite.java.ChangeType; import org.openrewrite.java.JavaParser; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest;