Skip to content

Commit

Permalink
refactor: Kill your Zombie code
Browse files Browse the repository at this point in the history
Use this link to re-run the recipe: https://app.moderne.io/builder/mybR2aHWC?organizationId=T3BlblJld3JpdGU%3D

Co-authored-by: Moderne <team@moderne.io>
  • Loading branch information
2 people authored and app committed Oct 23, 2024
1 parent 36c085a commit 36074f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public TreeVisitor<?, ExecutionContext> getVisitor() {
final AnnotationMatcher classRule = new AnnotationMatcher("@org.junit.ClassRule");
final AnnotationMatcher rule = new AnnotationMatcher("@org.junit.Rule");


private JavaParser.@Nullable Builder<?, ?> javaParser;

private JavaParser.Builder<?, ?> javaParser(ExecutionContext ctx) {
Expand Down Expand Up @@ -157,7 +157,7 @@ private J convertToNewFile(J.MethodInvocation mi, ExecutionContext ctx) {
private static class AddNewFolderMethod extends JavaIsoVisitor<ExecutionContext> {
private final J.MethodInvocation methodInvocation;


private JavaParser.@Nullable Builder<?, ?> javaParser;

private JavaParser.Builder<?, ?> javaParser(ExecutionContext ctx) {
Expand Down Expand Up @@ -236,7 +236,7 @@ private static class TranslateNewFolderMethodInvocation extends JavaVisitor<Exec
J.MethodInvocation methodScope;
JavaType.Method newMethodType;


private JavaParser.@Nullable Builder<?, ?> javaParser;

private JavaParser.Builder<?, ?> javaParser(ExecutionContext ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public String getDescription() {
public TreeVisitor<?, ExecutionContext> getVisitor() {
return Preconditions.check(new UsesType<>("org.junit.FixMethodOrder", false), new JavaIsoVisitor<ExecutionContext>() {


private JavaParser.@Nullable Builder<?, ?> javaParser;

private JavaParser.Builder<?, ?> javaParser(ExecutionContext ctx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void somethingElse() {
)
);
}

@Test
void changeThrowingRunnableToExecutable() {
//language=java
Expand Down

0 comments on commit 36074f0

Please sign in to comment.