Skip to content

Commit

Permalink
Use simpler nested class recipe name (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek authored Aug 22, 2023
1 parent 767d683 commit cb30db9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,11 @@ public void visitClassDef(JCTree.JCClassDecl classDecl) {
String outerClassName = className.substring(className.lastIndexOf('.') + 1);
out.write("public final class " + outerClassName + " extends Recipe {\n");

String simpleInputOuterFQN = inputOuterFQN.substring(inputOuterFQN.lastIndexOf('.') + 1);
out.write("\n" +
" @Override\n" +
" public String getDisplayName() {\n" +
" return \"Refaster recipes for `" + inputOuterFQN + "`\";\n" +
" return \"`" + simpleInputOuterFQN + "` Refaster recipes\";\n" +
" }\n" +
"\n" +
" @Override\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public final class MultipleDereferencesRecipes extends Recipe {

@Override
public String getDisplayName() {
return "Refaster recipes for `foo.MultipleDereferences`";
return "`MultipleDereferences` Refaster recipes";
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/recipes/ShouldAddImportsRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public final class ShouldAddImportsRecipes extends Recipe {

@Override
public String getDisplayName() {
return "Refaster recipes for `foo.ShouldAddImports`";
return "`ShouldAddImports` Refaster recipes";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public final class ShouldSupportNestedClassesRecipes extends Recipe {

@Override
public String getDisplayName() {
return "Refaster recipes for `foo.ShouldSupportNestedClasses`";
return "`ShouldSupportNestedClasses` Refaster recipes";
}

@Override
Expand Down

0 comments on commit cb30db9

Please sign in to comment.