Skip to content

Commit

Permalink
Revert "Code review tweaks"
Browse files Browse the repository at this point in the history
This reverts commit 285bd8c.
  • Loading branch information
smillst committed Sep 27, 2023
1 parent b183000 commit 69548e8
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ public Node visitBindingPattern17(Tree bindingPatternTree, Void p) {
* Visit a DeconstructionPatternTree.
*
* @param deconstructionPatternTree a DeconstructionPatternTree, typed as Tree so the Checker
* Framework compiles under JDK 20 and earlier
* Framework compiles under JDK < 21
* @param p an unused parameter
* @return the result of visiting the tree
*/
Expand Down Expand Up @@ -2357,6 +2357,7 @@ private SwitchBuilder(Tree switchTree) {

// Build CFG for the cases.
int defaultIndex = -1;
boolean exhaustiveAndNoDefault = exhaustiveAndNoDefault();
for (int i = 0; i < numCases; ++i) {
CaseTree caseTree = caseTrees.get(i);
if (TreeUtils.isDefaultCaseTree(caseTree)) {
Expand All @@ -2365,9 +2366,7 @@ private SwitchBuilder(Tree switchTree) {
// build the default case last.
defaultIndex = i;
} else {
boolean isLastCase = (i == numCases - 1);
boolean isLastCaseAndNoDefault = isLastCase && defaultIndex == -1;
boolean isLastCaseOfExhaustive = isLastCaseAndNoDefault && exhaustiveAndNoDefault();
boolean isLastCaseOfExhaustive = (i == numCases - 1) && exhaustiveAndNoDefault;
buildCase(caseTree, i, isLastCaseOfExhaustive);
}
}
Expand Down

0 comments on commit 69548e8

Please sign in to comment.