Skip to content

Commit 19cd97e

Browse files
authored
Java: Clarify the meaning of getRuleExpression/Statement
1 parent fa1bb82 commit 19cd97e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,11 +438,17 @@ class SwitchCase extends Stmt, @case {
438438

439439
/**
440440
* Gets the expression on the right-hand side of the arrow, if any.
441+
*
442+
* Note this is mutually exclusive with `getRuleStatement`: it gets a value
443+
* when this case is of the form `case e1 -> e2`, where `e2` is not a block.
441444
*/
442445
Expr getRuleExpression() { result.getParent() = this and result.getIndex() = -1 }
443446

444447
/**
445448
* Gets the statement on the right-hand side of the arrow, if any.
449+
*
450+
* Note this is mutually exclusive with `getRuleExpression`: it gets a value
451+
* when this case if of the form `case e1 -> { s1; s2; ... }`.
446452
*/
447453
Stmt getRuleStatement() { result.getParent() = this and result.getIndex() = -1 }
448454
}

0 commit comments

Comments
 (0)