Skip to content

Commit

Permalink
Move doAfterVisit to within conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Aug 17, 2024
1 parent 3412efb commit cd481c1
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public TreeVisitor<?, ExecutionContext> getVisitor() {
private static class UpdateTestAnnotationVisitor extends JavaIsoVisitor<ExecutionContext> {
private static final AnnotationMatcher JUNIT4_TEST = new AnnotationMatcher("@org.junit.Test");


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

private JavaParser.Builder<?, ?> javaParser(ExecutionContext ctx) {
Expand All @@ -66,7 +65,6 @@ private static class UpdateTestAnnotationVisitor extends JavaIsoVisitor<Executio
return javaParser;
}


@Override
public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionContext ctx) {
J.CompilationUnit c = super.visitCompilationUnit(cu, ctx);
Expand Down Expand Up @@ -169,9 +167,9 @@ public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, Ex
maybeAddImport("java.util.concurrent.TimeUnit");
}
maybeAddImport("org.junit.jupiter.api.Test");
}

doAfterVisit(new LambdaBlockToExpression().getVisitor());
doAfterVisit(new LambdaBlockToExpression().getVisitor());
}

return super.visitMethodDeclaration(m, ctx);
}
Expand Down

0 comments on commit cd481c1

Please sign in to comment.