diff --git a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyPrinter.java b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyPrinter.java index 313ae563178..5bea1f9109c 100644 --- a/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyPrinter.java +++ b/rewrite-groovy/src/main/java/org/openrewrite/groovy/GroovyPrinter.java @@ -397,12 +397,9 @@ public J visitReturn(J.Return return_, PrintOutputCapture

p) { return super.visitReturn(return_, p); } - protected void visitStatement(@Nullable JRightPadded paddedStat, JRightPadded.Location location, PrintOutputCapture

p) { - if (paddedStat != null) { - visit(paddedStat.getElement(), p); - visitSpace(paddedStat.getAfter(), location.getAfterLocation(), p); - visitMarkers(paddedStat.getMarkers(), p); - } + @Override + protected void printStatementTerminator(Statement s, PrintOutputCapture

p) { + // empty } @Override diff --git a/rewrite-java/src/main/java/org/openrewrite/java/JavaPrinter.java b/rewrite-java/src/main/java/org/openrewrite/java/JavaPrinter.java index 3b35a1ef433..a8ec988c14a 100644 --- a/rewrite-java/src/main/java/org/openrewrite/java/JavaPrinter.java +++ b/rewrite-java/src/main/java/org/openrewrite/java/JavaPrinter.java @@ -387,8 +387,8 @@ protected void visitStatement(@Nullable JRightPadded paddedStat, JRig visit(paddedStat.getElement(), p); visitSpace(paddedStat.getAfter(), location.getAfterLocation(), p); - printStatementTerminator(paddedStat.getElement(), p); visitMarkers(paddedStat.getMarkers(), p); + printStatementTerminator(paddedStat.getElement(), p); } protected void printStatementTerminator(Statement s, PrintOutputCapture

p) {