Skip to content

Commit 3bc70f0

Browse files
author
Benjamin Muskalla
committed
Convert containerflow to inline flow test
1 parent 7a0fc6a commit 3bc70f0

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed
Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import java
22
import semmle.code.java.dataflow.DataFlow
33
import semmle.code.java.dataflow.ExternalFlow
4-
import TestUtilities.InlineExpectationsTest
5-
import DataFlow
4+
import TestUtilities.InlineFlowTest
65

76
class SummaryModelTest extends SummaryModelCsv {
87
override predicate row(string row) {
@@ -15,25 +14,6 @@ class SummaryModelTest extends SummaryModelCsv {
1514
}
1615
}
1716

18-
class ContainerFlowConf extends Configuration {
19-
ContainerFlowConf() { this = "qltest:ContainerFlowConf" }
20-
21-
override predicate isSource(Node n) { n.asExpr().(MethodAccess).getMethod().hasName("source") }
22-
23-
override predicate isSink(Node n) { n.asExpr().(Argument).getCall().getCallee().hasName("sink") }
24-
}
25-
26-
class HasFlowTest extends InlineExpectationsTest {
27-
HasFlowTest() { this = "HasFlowTest" }
28-
29-
override string getARelevantTag() { result = "hasValueFlow" }
30-
31-
override predicate hasActualResult(Location location, string element, string tag, string value) {
32-
tag = "hasValueFlow" and
33-
exists(Node src, Node sink, ContainerFlowConf conf | conf.hasFlow(src, sink) |
34-
sink.getLocation() = location and
35-
element = sink.toString() and
36-
value = ""
37-
)
38-
}
17+
class HasFlowTest extends InlineFlowTest {
18+
override DataFlow::Configuration getTaintFlowConfig() { none() }
3919
}

0 commit comments

Comments
 (0)