Skip to content
This repository was archived by the owner on Jan 13, 2026. It is now read-only.

Commit aea84f7

Browse files
timtebeekTeamModerne
authored andcommitted
Replace getDisplayName() and getDescription() methods with fields
Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.java.recipes.UseDisplayNameAndDescriptionFields?organizationId=QUxML01vZGVybmUvTW9kZXJuZSArIE9wZW5SZXdyaXRl Co-authored-by: Moderne <team@moderne.io>
1 parent da5cd58 commit aea84f7

2 files changed

Lines changed: 4 additions & 16 deletions

File tree

rewrite-python/src/main/java/org/openrewrite/python/ChangeMethodName.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,9 @@ public class ChangeMethodName extends Recipe {
4545
@Nullable
4646
Boolean ignoreDefinition;
4747

48-
@Override
49-
public String getDisplayName() {
50-
return "Change method name";
51-
}
48+
String displayName = "Change method name";
5249

53-
@Override
54-
public String getDescription() {
55-
return "Renames a method.";
56-
}
50+
String description = "Renames a method.";
5751

5852
@Override
5953
public TreeVisitor<?, ExecutionContext> getVisitor() {

rewrite-python/src/main/java/org/openrewrite/python/format/PythonSpaces.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,9 @@
2626
@Value
2727
@EqualsAndHashCode(callSuper = false)
2828
public class PythonSpaces extends Recipe {
29-
@Override
30-
public String getDisplayName() {
31-
return "Formats spaces in Python code";
32-
}
29+
String displayName = "Formats spaces in Python code";
3330

34-
@Override
35-
public String getDescription() {
36-
return "Standardizes spaces in Python code. Currently limited to formatting method arguments.";
37-
}
31+
String description = "Standardizes spaces in Python code. Currently limited to formatting method arguments.";
3832

3933
@Override
4034
public TreeVisitor<?, ExecutionContext> getVisitor() {

0 commit comments

Comments
 (0)