From 7622f6681890936ff0fdb2286db7ac1fc0c44c67 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Tue, 12 Mar 2024 09:12:52 +0000 Subject: [PATCH] refactor: Add missing `@Override` to overriding and implementing methods Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.staticanalysis.MissingOverrideAnnotation?organizationId=T3BlblJld3JpdGU%3D Co-authored-by: Moderne --- .../org/openrewrite/java/migrate/ReplaceStringLiteralValue.java | 1 + .../org/openrewrite/java/migrate/lombok/LombokValueToRecord.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/java/org/openrewrite/java/migrate/ReplaceStringLiteralValue.java b/src/main/java/org/openrewrite/java/migrate/ReplaceStringLiteralValue.java index 46f99c168a..e5ad4c0c3f 100644 --- a/src/main/java/org/openrewrite/java/migrate/ReplaceStringLiteralValue.java +++ b/src/main/java/org/openrewrite/java/migrate/ReplaceStringLiteralValue.java @@ -63,6 +63,7 @@ public String getDescription() { @Override public TreeVisitor getVisitor() { return new JavaIsoVisitor() { + @Override public J.Literal visitLiteral(J.Literal literal, ExecutionContext ctx) { J.Literal l = super.visitLiteral(literal, ctx); if (l.getType() != JavaType.Primitive.String || !oldLiteralValue.equals(literal.getValue())) { diff --git a/src/main/java/org/openrewrite/java/migrate/lombok/LombokValueToRecord.java b/src/main/java/org/openrewrite/java/migrate/lombok/LombokValueToRecord.java index 3530ad4e1f..bdb2d374d7 100644 --- a/src/main/java/org/openrewrite/java/migrate/lombok/LombokValueToRecord.java +++ b/src/main/java/org/openrewrite/java/migrate/lombok/LombokValueToRecord.java @@ -48,6 +48,7 @@ public class LombokValueToRecord extends ScanningRecipe> @Nullable Boolean useExactToString; + @Override public String getDisplayName() { return "Convert `@lombok.Value` class to Record"; }