From 47c3095d69a0509fcc546b22008b22988d29d8c1 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Thu, 25 Apr 2024 12:23:19 +0000 Subject: [PATCH] refactor: OpenRewrite best practices Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.recipes.OpenRewriteBestPractices?organizationId=T3BlblJld3JpdGU%3D Co-authored-by: Moderne --- .../org/openrewrite/java/migrate/ReplaceStringLiteralValue.java | 2 +- .../java/migrate/guava/AbstractNoGuavaImmutableOf.java | 2 +- .../io/ReplaceFileInOrOutputStreamFinalizeWithClose.java | 2 +- .../java/migrate/jakarta/BeanValidationMessages.java | 2 +- .../openrewrite/java/migrate/jakarta/RemoveBeanIsNullable.java | 2 +- .../org/openrewrite/java/migrate/javax/AddColumnAnnotation.java | 2 +- .../java/migrate/javax/AddDefaultConstructorToEntityClass.java | 2 +- .../org/openrewrite/java/migrate/javax/RemoveEmbeddableId.java | 2 +- .../java/migrate/javax/RemoveTemporalAnnotation.java | 2 +- .../openrewrite/java/migrate/util/RemoveFinalizerFromZip.java | 2 +- .../java/org/openrewrite/java/migrate/UpgradeToJava6Test.java | 2 +- .../java/migrate/guava/PreferJavaUtilOptionalTest.java | 2 +- .../openrewrite/java/migrate/jakarta/JakartaFacesXhtmlTest.java | 2 +- .../migrate/jakarta/JavaxBeansXmlToJakartaBeansXmlTest.java | 2 +- .../jakarta/JavaxFacesConfigXmlToJakartaFacesConfigXmlTest.java | 2 +- .../JavaxFacesTagLibraryXmlToJakartaFacesTagLibraryXmlTest.java | 2 +- .../jakarta/JavaxWebFragmentXmlToJakartaWebFragmentXmlTest.java | 2 +- .../java/migrate/jakarta/JavaxWebXmlToJakartaWebXmlTest.java | 2 +- .../java/migrate/jakarta/RemovedStateManagerMethodsTest.java | 1 - .../java/migrate/javax/RemoveTemporalAnnotationTest.java | 2 +- 20 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/main/java/org/openrewrite/java/migrate/ReplaceStringLiteralValue.java b/src/main/java/org/openrewrite/java/migrate/ReplaceStringLiteralValue.java index e5ad4c0c3f..15d9ce36dd 100644 --- a/src/main/java/org/openrewrite/java/migrate/ReplaceStringLiteralValue.java +++ b/src/main/java/org/openrewrite/java/migrate/ReplaceStringLiteralValue.java @@ -76,4 +76,4 @@ public J.Literal visitLiteral(J.Literal literal, ExecutionContext ctx) { }; } -} \ No newline at end of file +} diff --git a/src/main/java/org/openrewrite/java/migrate/guava/AbstractNoGuavaImmutableOf.java b/src/main/java/org/openrewrite/java/migrate/guava/AbstractNoGuavaImmutableOf.java index 228b4bcec1..edf579c12a 100644 --- a/src/main/java/org/openrewrite/java/migrate/guava/AbstractNoGuavaImmutableOf.java +++ b/src/main/java/org/openrewrite/java/migrate/guava/AbstractNoGuavaImmutableOf.java @@ -181,4 +181,4 @@ private boolean isParentTypeMatched(@Nullable JavaType type) { } }); } -} \ No newline at end of file +} diff --git a/src/main/java/org/openrewrite/java/migrate/io/ReplaceFileInOrOutputStreamFinalizeWithClose.java b/src/main/java/org/openrewrite/java/migrate/io/ReplaceFileInOrOutputStreamFinalizeWithClose.java index a608373c07..eeef01591d 100644 --- a/src/main/java/org/openrewrite/java/migrate/io/ReplaceFileInOrOutputStreamFinalizeWithClose.java +++ b/src/main/java/org/openrewrite/java/migrate/io/ReplaceFileInOrOutputStreamFinalizeWithClose.java @@ -78,4 +78,4 @@ public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, Execu } ); } -} \ No newline at end of file +} diff --git a/src/main/java/org/openrewrite/java/migrate/jakarta/BeanValidationMessages.java b/src/main/java/org/openrewrite/java/migrate/jakarta/BeanValidationMessages.java index bb8f8661f5..7e169679c4 100644 --- a/src/main/java/org/openrewrite/java/migrate/jakarta/BeanValidationMessages.java +++ b/src/main/java/org/openrewrite/java/migrate/jakarta/BeanValidationMessages.java @@ -76,4 +76,4 @@ private J.Literal maybeReplaceLiteralValue(J.Literal arg) { } ); } -} \ No newline at end of file +} diff --git a/src/main/java/org/openrewrite/java/migrate/jakarta/RemoveBeanIsNullable.java b/src/main/java/org/openrewrite/java/migrate/jakarta/RemoveBeanIsNullable.java index a1f2992585..2a2406e9b4 100644 --- a/src/main/java/org/openrewrite/java/migrate/jakarta/RemoveBeanIsNullable.java +++ b/src/main/java/org/openrewrite/java/migrate/jakarta/RemoveBeanIsNullable.java @@ -57,4 +57,4 @@ public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) } }; } -} \ No newline at end of file +} diff --git a/src/main/java/org/openrewrite/java/migrate/javax/AddColumnAnnotation.java b/src/main/java/org/openrewrite/java/migrate/javax/AddColumnAnnotation.java index 97ce95f56d..4f6085a6fa 100644 --- a/src/main/java/org/openrewrite/java/migrate/javax/AddColumnAnnotation.java +++ b/src/main/java/org/openrewrite/java/migrate/javax/AddColumnAnnotation.java @@ -97,4 +97,4 @@ public J.VariableDeclarations visitVariableDeclarations(J.VariableDeclarations m } ); } -} \ No newline at end of file +} diff --git a/src/main/java/org/openrewrite/java/migrate/javax/AddDefaultConstructorToEntityClass.java b/src/main/java/org/openrewrite/java/migrate/javax/AddDefaultConstructorToEntityClass.java index 364a8d513e..ca72cc88df 100644 --- a/src/main/java/org/openrewrite/java/migrate/javax/AddDefaultConstructorToEntityClass.java +++ b/src/main/java/org/openrewrite/java/migrate/javax/AddDefaultConstructorToEntityClass.java @@ -76,4 +76,4 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Ex } ); } -} \ No newline at end of file +} diff --git a/src/main/java/org/openrewrite/java/migrate/javax/RemoveEmbeddableId.java b/src/main/java/org/openrewrite/java/migrate/javax/RemoveEmbeddableId.java index a8aef788cb..5405a9d1f4 100644 --- a/src/main/java/org/openrewrite/java/migrate/javax/RemoveEmbeddableId.java +++ b/src/main/java/org/openrewrite/java/migrate/javax/RemoveEmbeddableId.java @@ -122,4 +122,4 @@ public boolean isEmbeddableClass(@Nullable JavaType type) { }); } } -} \ No newline at end of file +} diff --git a/src/main/java/org/openrewrite/java/migrate/javax/RemoveTemporalAnnotation.java b/src/main/java/org/openrewrite/java/migrate/javax/RemoveTemporalAnnotation.java index 4964189b9b..7b2522b7b3 100644 --- a/src/main/java/org/openrewrite/java/migrate/javax/RemoveTemporalAnnotation.java +++ b/src/main/java/org/openrewrite/java/migrate/javax/RemoveTemporalAnnotation.java @@ -123,4 +123,4 @@ public J.VariableDeclarations visitVariableDeclarations(J.VariableDeclarations m } ); } -} \ No newline at end of file +} diff --git a/src/main/java/org/openrewrite/java/migrate/util/RemoveFinalizerFromZip.java b/src/main/java/org/openrewrite/java/migrate/util/RemoveFinalizerFromZip.java index 3e83ea5ccb..db2fcc5553 100644 --- a/src/main/java/org/openrewrite/java/migrate/util/RemoveFinalizerFromZip.java +++ b/src/main/java/org/openrewrite/java/migrate/util/RemoveFinalizerFromZip.java @@ -98,4 +98,4 @@ private boolean shouldRemoveFinalize(JavaType type) { }); } -} \ No newline at end of file +} diff --git a/src/test/java/org/openrewrite/java/migrate/UpgradeToJava6Test.java b/src/test/java/org/openrewrite/java/migrate/UpgradeToJava6Test.java index f7cc4504d8..00237e39ce 100644 --- a/src/test/java/org/openrewrite/java/migrate/UpgradeToJava6Test.java +++ b/src/test/java/org/openrewrite/java/migrate/UpgradeToJava6Test.java @@ -145,4 +145,4 @@ public T unwrap(Class iface) throws java.sql.SQLException { ) ); } -} \ No newline at end of file +} diff --git a/src/test/java/org/openrewrite/java/migrate/guava/PreferJavaUtilOptionalTest.java b/src/test/java/org/openrewrite/java/migrate/guava/PreferJavaUtilOptionalTest.java index 0963a0f204..bd45de16a9 100644 --- a/src/test/java/org/openrewrite/java/migrate/guava/PreferJavaUtilOptionalTest.java +++ b/src/test/java/org/openrewrite/java/migrate/guava/PreferJavaUtilOptionalTest.java @@ -347,4 +347,4 @@ Iterable foo(Iterable> optionals) { """)); } } -} \ No newline at end of file +} diff --git a/src/test/java/org/openrewrite/java/migrate/jakarta/JakartaFacesXhtmlTest.java b/src/test/java/org/openrewrite/java/migrate/jakarta/JakartaFacesXhtmlTest.java index 82035e1037..6c38e7b64f 100644 --- a/src/test/java/org/openrewrite/java/migrate/jakarta/JakartaFacesXhtmlTest.java +++ b/src/test/java/org/openrewrite/java/migrate/jakarta/JakartaFacesXhtmlTest.java @@ -168,4 +168,4 @@ void migrateJCP() { ) ); } -} \ No newline at end of file +} diff --git a/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxBeansXmlToJakartaBeansXmlTest.java b/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxBeansXmlToJakartaBeansXmlTest.java index 48297d2242..46d956bcc5 100644 --- a/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxBeansXmlToJakartaBeansXmlTest.java +++ b/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxBeansXmlToJakartaBeansXmlTest.java @@ -85,4 +85,4 @@ void noSchemaCD12() { ) ); } -} \ No newline at end of file +} diff --git a/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxFacesConfigXmlToJakartaFacesConfigXmlTest.java b/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxFacesConfigXmlToJakartaFacesConfigXmlTest.java index 229d5585a2..04f18dc7da 100644 --- a/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxFacesConfigXmlToJakartaFacesConfigXmlTest.java +++ b/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxFacesConfigXmlToJakartaFacesConfigXmlTest.java @@ -130,4 +130,4 @@ void fileNotFacesConfigXml() { ); } } -} \ No newline at end of file +} diff --git a/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxFacesTagLibraryXmlToJakartaFacesTagLibraryXmlTest.java b/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxFacesTagLibraryXmlToJakartaFacesTagLibraryXmlTest.java index 7e3824d84a..447775dc6a 100644 --- a/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxFacesTagLibraryXmlToJakartaFacesTagLibraryXmlTest.java +++ b/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxFacesTagLibraryXmlToJakartaFacesTagLibraryXmlTest.java @@ -122,4 +122,4 @@ void fileNotTagLibraryXml() { ); } } -} \ No newline at end of file +} diff --git a/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxWebFragmentXmlToJakartaWebFragmentXmlTest.java b/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxWebFragmentXmlToJakartaWebFragmentXmlTest.java index ce9f8714c5..2215396a5f 100644 --- a/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxWebFragmentXmlToJakartaWebFragmentXmlTest.java +++ b/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxWebFragmentXmlToJakartaWebFragmentXmlTest.java @@ -114,4 +114,4 @@ void fileNotWebFragmentXml() { ); } } -} \ No newline at end of file +} diff --git a/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxWebXmlToJakartaWebXmlTest.java b/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxWebXmlToJakartaWebXmlTest.java index bc0a8493ed..347ff0dca4 100644 --- a/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxWebXmlToJakartaWebXmlTest.java +++ b/src/test/java/org/openrewrite/java/migrate/jakarta/JavaxWebXmlToJakartaWebXmlTest.java @@ -118,4 +118,4 @@ void fileNotWebXml() { ); } } -} \ No newline at end of file +} diff --git a/src/test/java/org/openrewrite/java/migrate/jakarta/RemovedStateManagerMethodsTest.java b/src/test/java/org/openrewrite/java/migrate/jakarta/RemovedStateManagerMethodsTest.java index 2dfa05a196..89394c5b12 100644 --- a/src/test/java/org/openrewrite/java/migrate/jakarta/RemovedStateManagerMethodsTest.java +++ b/src/test/java/org/openrewrite/java/migrate/jakarta/RemovedStateManagerMethodsTest.java @@ -135,4 +135,3 @@ public void test() throws IOException { } } - diff --git a/src/test/java/org/openrewrite/java/migrate/javax/RemoveTemporalAnnotationTest.java b/src/test/java/org/openrewrite/java/migrate/javax/RemoveTemporalAnnotationTest.java index bb0b22a7e2..4cab77463d 100644 --- a/src/test/java/org/openrewrite/java/migrate/javax/RemoveTemporalAnnotationTest.java +++ b/src/test/java/org/openrewrite/java/migrate/javax/RemoveTemporalAnnotationTest.java @@ -139,4 +139,4 @@ public class TemporalDates { ) ); } -} \ No newline at end of file +}