diff --git a/src/main/java/org/openrewrite/java/migrate/AddMissingMethodImplementation.java b/src/main/java/org/openrewrite/java/migrate/AddMissingMethodImplementation.java index 5f1185d267..90dcee7bd0 100644 --- a/src/main/java/org/openrewrite/java/migrate/AddMissingMethodImplementation.java +++ b/src/main/java/org/openrewrite/java/migrate/AddMissingMethodImplementation.java @@ -31,17 +31,17 @@ @EqualsAndHashCode(callSuper = false) public class AddMissingMethodImplementation extends Recipe { - @Option(displayName = "Fully Qualified Class Name", + @Option(displayName = "Fully qualified class name", description = "A fully qualified class being implemented with missing method.", example = "com.yourorg.FooBar") String fullyQualifiedClassName; - @Option(displayName = "Method Pattern", + @Option(displayName = "Method pattern", description = "A method pattern for matching required method definition.", example = "*..* hello(..)") String methodPattern; - @Option(displayName = "Method Template", + @Option(displayName = "Method template", description = "Template of method to add", example = "public String hello() { return \\\"Hello from #{}!\\\"; }") String methodTemplateString; @@ -68,7 +68,7 @@ public class ClassImplementationVisitor extends JavaIsoVisitor @Override public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration cs, ExecutionContext ctx) { - // need to make sure we handle sub-classes + // need to make sure we handle inner classes J.ClassDeclaration classDecl = super.visitClassDeclaration(cs, ctx); // No need to make changes to abstract classes or interfaces; only change concrete classes. diff --git a/src/main/java/org/openrewrite/java/migrate/AddSuppressionForIllegalReflectionWarningsPlugin.java b/src/main/java/org/openrewrite/java/migrate/AddSuppressionForIllegalReflectionWarningsPlugin.java index 89aadf3278..4911fbe0d9 100644 --- a/src/main/java/org/openrewrite/java/migrate/AddSuppressionForIllegalReflectionWarningsPlugin.java +++ b/src/main/java/org/openrewrite/java/migrate/AddSuppressionForIllegalReflectionWarningsPlugin.java @@ -18,6 +18,7 @@ import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.RequiredArgsConstructor; +import org.intellij.lang.annotations.Language; import org.openrewrite.*; import org.openrewrite.internal.StringUtils; import org.openrewrite.maven.AddPlugin; @@ -37,7 +38,7 @@ public class AddSuppressionForIllegalReflectionWarningsPlugin extends Recipe { private static final XPathMatcher PACKAGING_MATCHER = new XPathMatcher("/project/packaging"); - @Option(displayName = "version", + @Option(displayName = "Version", description = "An exact version number, or node-style semver selector used to select the version number.", required = false, example = "29.X") @@ -45,7 +46,7 @@ public class AddSuppressionForIllegalReflectionWarningsPlugin extends Recipe { @Override public String getDisplayName() { - return "Add Maven Jar Plugin to suppress Illegal Reflection Warnings"; + return "Add maven jar plugin to suppress illegal reflection warnings"; } @Override @@ -66,6 +67,7 @@ public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext ctx) { String artifactId = "maven-jar-plugin"; // TODO: Prioritize managedPlugin version. String version = StringUtils.isNullOrEmpty(getVersion()) ? "3.2.0" : getVersion(); + @Language("xml") String configuration = "\n" + " \n" + diff --git a/src/main/java/org/openrewrite/java/migrate/lang/UseTextBlocks.java b/src/main/java/org/openrewrite/java/migrate/lang/UseTextBlocks.java index b00de989a4..fc045af459 100644 --- a/src/main/java/org/openrewrite/java/migrate/lang/UseTextBlocks.java +++ b/src/main/java/org/openrewrite/java/migrate/lang/UseTextBlocks.java @@ -21,7 +21,7 @@ import org.openrewrite.*; import org.openrewrite.internal.StringUtils; import org.openrewrite.java.JavaVisitor; -import org.openrewrite.java.search.HasJavaVersion; +import org.openrewrite.java.search.UsesJavaVersion; import org.openrewrite.java.style.IntelliJ; import org.openrewrite.java.style.TabsAndIndentsStyle; import org.openrewrite.java.tree.Expression; @@ -77,7 +77,7 @@ public String getDescription() { public TreeVisitor getVisitor() { TreeVisitor preconditions = Preconditions.and( Preconditions.not(new KotlinFileChecker<>()), - new HasJavaVersion("[15,)", null).getVisitor() + new UsesJavaVersion<>(17) ); return Preconditions.check(preconditions, new JavaVisitor() { @Override