Skip to content

Commit 98c5dc1

Browse files
committed
Java: Rename to selector as per review comment.
1 parent 0e12df0 commit 98c5dc1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

java/ql/src/semmle/code/java/Statement.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ class SwitchCase extends Stmt, @case {
427427
* Gets the expression of the surrounding switch that this case is compared
428428
* against.
429429
*/
430-
Expr getTestExpr() {
430+
Expr getSelectorExpr() {
431431
result = this.getSwitch().getExpr() or result = this.getSwitchExpr().getExpr()
432432
}
433433

java/ql/src/semmle/code/java/controlflow/Guards.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class Guard extends ExprParent {
127127
branch = true and
128128
bb2.getFirstNode() = sc.getControlFlowNode() and
129129
pred = sc.getControlFlowNode().getAPredecessor() and
130-
pred.(Expr).getParent*() = sc.getTestExpr() and
130+
pred.(Expr).getParent*() = sc.getSelectorExpr() and
131131
bb1 = pred.getBasicBlock()
132132
)
133133
or
@@ -161,12 +161,12 @@ class Guard extends ExprParent {
161161
}
162162

163163
private predicate switchCaseControls(SwitchCase sc, BasicBlock bb) {
164-
exists(BasicBlock caseblock, Expr switchTest |
165-
switchTest = sc.getTestExpr() and
164+
exists(BasicBlock caseblock, Expr selector |
165+
selector = sc.getSelectorExpr() and
166166
caseblock.getFirstNode() = sc.getControlFlowNode() and
167167
caseblock.bbDominates(bb) and
168168
forall(ControlFlowNode pred | pred = sc.getControlFlowNode().getAPredecessor() |
169-
pred.(Expr).getParent*() = switchTest
169+
pred.(Expr).getParent*() = selector
170170
)
171171
)
172172
}
@@ -255,7 +255,7 @@ private predicate equalityGuard(Guard g, Expr e1, Expr e2, boolean polarity) {
255255
exists(ConstCase cc |
256256
cc = g and
257257
polarity = true and
258-
cc.getTestExpr().getProperExpr() = e1 and
258+
cc.getSelectorExpr().getProperExpr() = e1 and
259259
cc.getValue() = e2 and
260260
strictcount(cc.getValue(_)) = 1
261261
)

0 commit comments

Comments
 (0)