We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0ae81ea commit cd22bb3Copy full SHA for cd22bb3
1 file changed
java/ql/test/library-tests/dataflow/capture/B.java
@@ -227,4 +227,25 @@ void testEnhancedForStmtCapture() {
227
}
228
229
230
+ void testDoubleCall() {
231
+ String s = source("src");
232
+ List<String> l = new ArrayList<>();
233
+ List<String> l2 = new ArrayList<>();
234
+ class MyLocal2 {
235
+ MyLocal2() {
236
+ sink(l.get(0)); // no flow
237
+ sink(l2.get(0)); // no flow
238
+ l.add(s);
239
+ }
240
+ void run() {
241
+ l2.add(l.get(0));
242
243
244
+ // The ClassInstanceExpr has two calls in the same cfg node:
245
+ // First the constructor call for which it is the postupdate,
246
+ // and then as instance argument to the run call.
247
+ new MyLocal2().run();
248
+ sink(l.get(0)); // $ hasValueFlow=src
249
+ sink(l2.get(0)); // $ hasValueFlow=src
250
251
0 commit comments