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 f44bece commit c7cb885Copy full SHA for c7cb885
java/ql/lib/semmle/code/java/Statement.qll
@@ -551,8 +551,16 @@ class PatternCase extends SwitchCase {
551
*/
552
PatternExpr getPatternAtIndex(int n) { result.isNthChildOf(this, n) }
553
554
+ /**
555
+ * Gets any of this case's patterns.
556
+ */
557
PatternExpr getAPattern() { result = this.getPatternAtIndex(_) }
558
559
560
+ * Gets this case's sole pattern, if there is exactly one.
561
562
+ PatternExpr getUniquePattern() { result = unique(PatternExpr pe | pe = this.getPatternAtIndex(_)) }
563
+
564
/** Gets the guard applicable to this pattern case, if any. */
565
Expr getGuard() { result.isNthChildOf(this, -3) }
566
0 commit comments