Skip to content

Commit 52406dc

Browse files
author
Benjamin Muskalla
committed
Exclude logging sinks
Those sinks are too coarse grained to be exposed as sinks on any model.
1 parent 25d251c commit 52406dc

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

java/ql/src/utils/model-generator/CaptureSinkModels.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ string captureSink(TargetAPI api) {
4848
config.hasFlow(src, sink) and
4949
sinkNode(sink, kind) and
5050
api = src.getEnclosingCallable() and
51+
not kind = "logging" and
5152
result = asSinkModel(api, asInputArgument(src), kind)
5253
)
5354
}

java/ql/test/utils/model-generator/p/Sinks.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.nio.charset.Charset;
88
import java.nio.file.Files;
99
import java.nio.file.Path;
10+
import java.util.logging.Logger;
1011

1112
public class Sinks {
1213

@@ -25,4 +26,9 @@ public static void main(String[] args) throws IOException {
2526
String foo = new Sinks().readUrl(new URL(args[0]), Charset.defaultCharset());
2627
}
2728

29+
public void propagate(String s) {
30+
Logger logger = Logger.getLogger(Sinks.class.getSimpleName());
31+
logger.warning(s);
32+
}
33+
2834
}

0 commit comments

Comments
 (0)