mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
Java: Adjust BasicBlock-based qltests.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import java
|
||||
import semmle.code.java.controlflow.Guards
|
||||
import utils.test.BasicBlock
|
||||
|
||||
from ConditionBlock cb, boolean testIsTrue, BasicBlock controlled
|
||||
where
|
||||
cb.controls(controlled, testIsTrue) and
|
||||
cb.getEnclosingCallable().getDeclaringType().hasName("Test")
|
||||
select cb.getCondition(), testIsTrue, controlled
|
||||
select cb.getCondition(), testIsTrue, getFirstAstNode(controlled)
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import java
|
||||
import semmle.code.java.controlflow.Guards
|
||||
import utils.test.BasicBlock
|
||||
|
||||
from Guard g, BasicBlock bb, GuardValue gv
|
||||
where
|
||||
g.valueControls(bb, gv) and
|
||||
g.getEnclosingCallable().getDeclaringType().hasName("Logic") and
|
||||
(exists(gv.asBooleanValue()) or gv.isThrowsException() or gv.getDualValue().isThrowsException())
|
||||
select g, gv, bb
|
||||
select g, gv, getFirstAstNode(bb)
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import java
|
||||
import semmle.code.java.controlflow.Guards
|
||||
import utils.test.BasicBlock
|
||||
|
||||
from Guard g, BasicBlock bb, GuardValue gv
|
||||
where
|
||||
g.valueControls(bb, gv) and
|
||||
g.getEnclosingCallable().getDeclaringType().hasName("Preconditions") and
|
||||
(gv.isThrowsException() or gv.getDualValue().isThrowsException())
|
||||
select g, gv, bb
|
||||
select g, gv, getFirstAstNode(bb)
|
||||
|
||||
Reference in New Issue
Block a user