Skip to content
This repository was archived by the owner on Jan 13, 2026. It is now read-only.

Commit 56e73ba

Browse files
authored
Prevent potential Java 21 issues (#136)
* Apply new caselabel way of working and make sure rewrite java 21 is available on classpath * Fix compile issue
1 parent 7ab9259 commit 56e73ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rewrite-python/src/main/java/org/openrewrite/python/internal/PythonPrinter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -915,11 +915,11 @@ public J visitBlock(J.Block block, PrintOutputCapture<P> p) {
915915
@Override
916916
public J visitCase(J.Case ca, PrintOutputCapture<P> p) {
917917
beforeSyntax(ca, Location.CASE_PREFIX, p);
918-
Expression elem = ca.getExpressions().get(0);
918+
J elem = ca.getCaseLabels().get(0);
919919
if (!(elem instanceof J.Identifier) || !((J.Identifier) elem).getSimpleName().equals("default")) {
920920
p.append("case");
921921
}
922-
visitContainer("", ca.getPadding().getExpressions(), JContainer.Location.CASE_EXPRESSION, ",", "", p);
922+
visitContainer("", ca.getPadding().getCaseLabels(), JContainer.Location.CASE_EXPRESSION, ",", "", p);
923923
visitSpace(ca.getPadding().getStatements().getBefore(), Location.CASE, p);
924924
visitStatements(ca.getPadding().getStatements().getPadding().getElements(), JRightPadded.Location.CASE, p);
925925
if (ca.getBody() instanceof Statement) {

0 commit comments

Comments
 (0)