From 341b116935aac163f9ebd5595aba32cceba98b99 Mon Sep 17 00:00:00 2001 From: Steve Hill Date: Mon, 24 Jul 2023 22:17:01 -0700 Subject: [PATCH] JavaxAnnotationsToSpotbugs should not order imports Creates too many unrelated changes. Fixes #10. --- src/main/resources/META-INF/rewrite/jsr-305.yml | 2 -- .../openrewrite/jenkins/JavaxAnnotationsToSpotBugsTest.java | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/resources/META-INF/rewrite/jsr-305.yml b/src/main/resources/META-INF/rewrite/jsr-305.yml index 4fa3590..e15bc86 100644 --- a/src/main/resources/META-INF/rewrite/jsr-305.yml +++ b/src/main/resources/META-INF/rewrite/jsr-305.yml @@ -27,5 +27,3 @@ recipeList: oldPackageName: javax.annotation newPackageName: edu.umd.cs.findbugs.annotations recursive: false - - org.openrewrite.java.OrderImports: - removeUnused: false diff --git a/src/test/java/org/openrewrite/jenkins/JavaxAnnotationsToSpotBugsTest.java b/src/test/java/org/openrewrite/jenkins/JavaxAnnotationsToSpotBugsTest.java index ce8ca52..9f5da40 100644 --- a/src/test/java/org/openrewrite/jenkins/JavaxAnnotationsToSpotBugsTest.java +++ b/src/test/java/org/openrewrite/jenkins/JavaxAnnotationsToSpotBugsTest.java @@ -78,7 +78,7 @@ public String key() { @Test @DocumentExample - void shouldOrderImports() { + void shouldNotOrderImports() { rewriteRun(java( """ import javax.annotation.CheckForNull; @@ -97,9 +97,9 @@ public String key() { } """.stripIndent(), """ - import edu.umd.cs.findbugs.annotations.CheckForNull; import edu.umd.cs.findbugs.annotations.NonNull; + import edu.umd.cs.findbugs.annotations.CheckForNull; import java.util.Objects; public class A {