@@ -440,7 +440,7 @@ private module ControlFlowGraphImpl {
440440 // Join order engineering -- first determine the switch block and the case indices required, then retrieve them.
441441 bindingset [ switch, i]
442442 pragma [ inline_late]
443- private predicate isNthCaseOf ( StmtParent switch , SwitchCase c , int i ) { c .isNthCaseOf ( switch , i ) }
443+ private predicate isNthCaseOf ( SwitchBlock switch , SwitchCase c , int i ) { c .isNthCaseOf ( switch , i ) }
444444
445445 /**
446446 * Gets a `SwitchCase` that may be `pred`'s direct successor, where `pred` is declared in block `switch`.
@@ -450,7 +450,7 @@ private module ControlFlowGraphImpl {
450450 * Because we know the switch block contains at least one pattern, we know by https://docs.oracle.com/javase/specs/jls/se21/html/jls-14.html#jls-14.11
451451 * that any default case comes after the last pattern case.
452452 */
453- private SwitchCase getASuccessorSwitchCase ( PatternCase pred , StmtParent switch ) {
453+ private SwitchCase getASuccessorSwitchCase ( PatternCase pred , SwitchBlock switch ) {
454454 // Note we do include `case null, default` (as well as plain old `default`) here.
455455 not result .( ConstCase ) .getValue ( _) instanceof NullLiteral and
456456 exists ( int maxCaseIndex |
@@ -471,7 +471,7 @@ private module ControlFlowGraphImpl {
471471 *
472472 * Otherwise it is any case in the switch block.
473473 */
474- private SwitchCase getAFirstSwitchCase ( StmtParent switch ) {
474+ private SwitchCase getAFirstSwitchCase ( SwitchBlock switch ) {
475475 result .getParent ( ) = switch and
476476 (
477477 result .( ConstCase ) .getValue ( _) instanceof NullLiteral
@@ -484,7 +484,7 @@ private module ControlFlowGraphImpl {
484484 )
485485 }
486486
487- private Stmt getSwitchStatement ( StmtParent switch , int i ) { result .isNthChildOf ( switch , i ) }
487+ private Stmt getSwitchStatement ( SwitchBlock switch , int i ) { result .isNthChildOf ( switch , i ) }
488488
489489 /**
490490 * Holds if `last` is the last node in a pattern case `pc`'s succeeding bind-and-test operation,
@@ -1296,7 +1296,7 @@ private module ControlFlowGraphImpl {
12961296 )
12971297 or
12981298 // Switch statements and expressions
1299- exists ( StmtParent switch | switch instanceof SwitchStmt or switch instanceof SwitchExpr |
1299+ exists ( SwitchBlock switch |
13001300 exists ( Expr switchExpr |
13011301 switchExpr = switch .( SwitchStmt ) .getExpr ( ) or switchExpr = switch .( SwitchExpr ) .getExpr ( )
13021302 |
0 commit comments