diff --git a/lib-google-java-format/src/main/java/com/google/googlejavaformat/java/JavaInputAstVisitor.java b/lib-google-java-format/src/main/java/com/google/googlejavaformat/java/JavaInputAstVisitor.java index 5be8567b9..f2dda78d5 100644 --- a/lib-google-java-format/src/main/java/com/google/googlejavaformat/java/JavaInputAstVisitor.java +++ b/lib-google-java-format/src/main/java/com/google/googlejavaformat/java/JavaInputAstVisitor.java @@ -1878,13 +1878,13 @@ public Void visitCase(CaseTree node, Void unused) { sync(node); markForPartialFormat(); builder.forcedBreak(); - if (node.getExpression() == null) { + if (node.getExpressions().isEmpty()) { token("default", plusTwo); token(":"); } else { token("case", plusTwo); builder.space(); - scan(node.getExpression(), null); + scan(node.getExpressions().get(0), null); token(":"); } builder.open(plusTwo);