Skip to content

Commit 85e984c

Browse files
committed
Polish
1 parent bf0752e commit 85e984c

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

src/main/java/org/openrewrite/java/migrate/AddMissingMethodImplementation.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@
3131
@EqualsAndHashCode(callSuper = false)
3232
public class AddMissingMethodImplementation extends Recipe {
3333

34-
@Option(displayName = "Fully Qualified Class Name",
34+
@Option(displayName = "Fully qualified class name",
3535
description = "A fully qualified class being implemented with missing method.",
3636
example = "com.yourorg.FooBar")
3737
String fullyQualifiedClassName;
3838

39-
@Option(displayName = "Method Pattern",
39+
@Option(displayName = "Method pattern",
4040
description = "A method pattern for matching required method definition.",
4141
example = "*..* hello(..)")
4242
String methodPattern;
4343

44-
@Option(displayName = "Method Template",
44+
@Option(displayName = "Method template",
4545
description = "Template of method to add",
4646
example = "public String hello() { return \\\"Hello from #{}!\\\"; }")
4747
String methodTemplateString;
@@ -68,7 +68,7 @@ public class ClassImplementationVisitor extends JavaIsoVisitor<ExecutionContext>
6868

6969
@Override
7070
public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration cs, ExecutionContext ctx) {
71-
// need to make sure we handle sub-classes
71+
// need to make sure we handle inner classes
7272
J.ClassDeclaration classDecl = super.visitClassDeclaration(cs, ctx);
7373

7474
// No need to make changes to abstract classes or interfaces; only change concrete classes.

src/main/java/org/openrewrite/java/migrate/AddSuppressionForIllegalReflectionWarningsPlugin.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import lombok.EqualsAndHashCode;
1919
import lombok.Getter;
2020
import lombok.RequiredArgsConstructor;
21+
import org.intellij.lang.annotations.Language;
2122
import org.openrewrite.*;
2223
import org.openrewrite.internal.StringUtils;
2324
import org.openrewrite.maven.AddPlugin;
@@ -37,15 +38,15 @@ public class AddSuppressionForIllegalReflectionWarningsPlugin extends Recipe {
3738

3839
private static final XPathMatcher PACKAGING_MATCHER = new XPathMatcher("/project/packaging");
3940

40-
@Option(displayName = "version",
41+
@Option(displayName = "Version",
4142
description = "An exact version number, or node-style semver selector used to select the version number.",
4243
required = false,
4344
example = "29.X")
4445
private final String version;
4546

4647
@Override
4748
public String getDisplayName() {
48-
return "Add Maven Jar Plugin to suppress Illegal Reflection Warnings";
49+
return "Add maven jar plugin to suppress illegal reflection warnings";
4950
}
5051

5152
@Override
@@ -66,6 +67,7 @@ public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext ctx) {
6667
String artifactId = "maven-jar-plugin";
6768
// TODO: Prioritize managedPlugin version.
6869
String version = StringUtils.isNullOrEmpty(getVersion()) ? "3.2.0" : getVersion();
70+
@Language("xml")
6971
String configuration =
7072
"<configuration>\n" +
7173
" <archive>\n" +

src/main/java/org/openrewrite/java/migrate/lang/UseTextBlocks.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import org.openrewrite.*;
2222
import org.openrewrite.internal.StringUtils;
2323
import org.openrewrite.java.JavaVisitor;
24-
import org.openrewrite.java.search.HasJavaVersion;
24+
import org.openrewrite.java.search.UsesJavaVersion;
2525
import org.openrewrite.java.style.IntelliJ;
2626
import org.openrewrite.java.style.TabsAndIndentsStyle;
2727
import org.openrewrite.java.tree.Expression;
@@ -77,7 +77,7 @@ public String getDescription() {
7777
public TreeVisitor<?, ExecutionContext> getVisitor() {
7878
TreeVisitor<?, ExecutionContext> preconditions = Preconditions.and(
7979
Preconditions.not(new KotlinFileChecker<>()),
80-
new HasJavaVersion("[15,)", null).getVisitor()
80+
new UsesJavaVersion<>(17)
8181
);
8282
return Preconditions.check(preconditions, new JavaVisitor<ExecutionContext>() {
8383
@Override

0 commit comments

Comments
 (0)