We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3971817 commit 40464edCopy full SHA for 40464ed
java/ql/lib/semmle/code/java/controlflow/internal/SwitchCases.qll
@@ -2,19 +2,12 @@
2
3
import java
4
5
-/**
6
- * Gets the `i`th `SwitchCase` defined on `switch`, if one exists.
7
- */
8
-SwitchCase getCase(StmtParent switch, int i) {
9
- result = switch.(SwitchExpr).getCase(i) or result = switch.(SwitchStmt).getCase(i)
10
-}
11
-
12
/**
13
* Gets the `i`th `PatternCase` defined on `switch`, if one exists.
14
*/
15
PatternCase getPatternCase(StmtParent switch, int i) {
16
result =
17
- rank[i + 1](PatternCase pc, int caseIdx | pc = getCase(switch, caseIdx) | pc order by caseIdx)
+ rank[i + 1](PatternCase pc, int caseIdx | pc.isNthCaseOf(switch, caseIdx) | pc order by caseIdx)
18
}
19
20
0 commit comments