Skip to content

Commit

Permalink
Automatic code cleanup.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 568553066
  • Loading branch information
cushon authored and Error Prone Team committed Sep 26, 2023
1 parent a357fce commit 18058d5
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,24 @@ private JCCase makeCase(CaseTree node, List<JCStatement> stmts) {
checkState(
caseKind.name().contentEquals("STATEMENT"),
"expression switches are not supported yet");
if (RuntimeVersion.isAtLeast21()) {
return (JCCase)
TreeMaker.class
.getMethod(
"Case",
Class.forName("com.sun.source.tree.CaseTree$CaseKind"),
List.class,
JCExpression.class,
List.class,
JCTree.class)
.invoke(
maker(),
caseKind,
CaseTree.class.getMethod("getLabels").invoke(node),
CaseTree.class.getMethod("getGuard").invoke(node),
stmts,
/* body */ null);
}
return (JCCase)
TreeMaker.class
.getMethod(
Expand Down

0 comments on commit 18058d5

Please sign in to comment.