Skip to content

Commit

Permalink
Make another template context-free
Browse files Browse the repository at this point in the history
  • Loading branch information
knutwannheden committed Nov 26, 2023
1 parent 931c734 commit 83b2f77
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ public TreeVisitor<?, ExecutionContext> getVisitor() {
"@Override public Duration getEstimatedEffortPerOccurrence() {\n" +
"return Duration.ofMinutes(5);\n" +
"}")
.contextSensitive()
.imports("java.time.Duration")
.build();

@Override
public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext executionContext) {
public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext ctx) {
JavaType.FullyQualified type = TypeUtils.asFullyQualified(classDecl.getType());
if (TypeUtils.isAssignableTo("org.openrewrite.Recipe", type)) {
assert type != null;
Expand All @@ -87,7 +86,7 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Ex
throw new RuntimeException(e);
}
}
return super.visitClassDeclaration(classDecl, executionContext);
return super.visitClassDeclaration(classDecl, ctx);
}
});
}
Expand Down

0 comments on commit 83b2f77

Please sign in to comment.