Skip to content

Commit

Permalink
Fix template compilation for the abstract class case
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Dec 19, 2024
1 parent 6f01501 commit 9071a63
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, Ex

m = JavaTemplate.builder("#{}\n #{} void write(#{} Chunk<#{}> #{}) throws Exception #{}")
.contextSensitive()
.doBeforeParseTemplate(System.out::println)
// .doAfterVariableSubstitution(System.out::println)
.javaParser(JavaParser.fromJavaVersion()
.classpathFromResources(ctx, "spring-batch-core-5.+", "spring-batch-infrastructure-5.+"))
.imports("org.springframework.batch.item.Chunk")
Expand All @@ -102,7 +104,7 @@ public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, Ex
.collect(Collectors.joining(" ")),
chunkTypeParameter,
paramName,
m.getBody() == null ? "" : m.getBody().print(getCursor()));
m.getBody() == null ? ";" : m.getBody().print(getCursor()));

maybeAddImport("org.springframework.batch.item.Chunk");
maybeRemoveImport("java.util.List");
Expand Down

0 comments on commit 9071a63

Please sign in to comment.