From 039730007d8da28d435c95cfb9470af39c22baf8 Mon Sep 17 00:00:00 2001 From: PranavPurwar Date: Tue, 10 May 2022 22:40:40 +0530 Subject: [PATCH] use non-deprecated CaseTree#getExpressions() --- .../com/google/googlejavaformat/java/JavaInputAstVisitor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);