Fix test to correctly highlight lack of flow from field init

This commit is contained in:
Tony Torralba
2022-05-20 12:36:10 +02:00
parent 20af134ff0
commit 775b53b7b4
2 changed files with 2 additions and 5 deletions

View File

@@ -1,4 +1,3 @@
isFinalField
| test.kt:3:3:3:18 | x |
#select
| test.kt:3:3:3:18 | this.x | test.kt:6:10:6:10 | getX(...) |
#select

View File

@@ -4,9 +4,7 @@ import semmle.code.java.dataflow.DataFlow
class Config extends DataFlow::Configuration {
Config() { this = "Config" }
override predicate isSource(DataFlow::Node n) {
n.asExpr().(CompileTimeConstantExpr).getStringValue() = "Source"
}
override predicate isSource(DataFlow::Node n) { n.asExpr().(StringLiteral).getValue() = "Source" }
override predicate isSink(DataFlow::Node n) {
n.asExpr().(Argument).getCall().getCallee().getName() = "sink"