mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Java: Add test.
This commit is contained in:
27
java/ql/test/library-tests/dataflow/fields/C.java
Normal file
27
java/ql/test/library-tests/dataflow/fields/C.java
Normal file
@@ -0,0 +1,27 @@
|
||||
public class C {
|
||||
|
||||
private Elem s1 = new Elem();
|
||||
private final Elem s2 = new Elem();
|
||||
private Elem s3;
|
||||
private static Elem s4 = new Elem();
|
||||
|
||||
public static void main(String[] args){
|
||||
C c = new C();
|
||||
c.func();
|
||||
}
|
||||
|
||||
private C() {
|
||||
this.s3 = new Elem();
|
||||
}
|
||||
|
||||
public void func(){
|
||||
sink(s1);
|
||||
sink(s2);
|
||||
sink(s3);
|
||||
sink(s4);
|
||||
}
|
||||
|
||||
public static void sink(Object o) { }
|
||||
|
||||
public static class Elem { }
|
||||
}
|
||||
@@ -15,3 +15,7 @@
|
||||
| B.java:4:14:4:23 | new Elem(...) | B.java:8:10:8:22 | b2.box1.elem2 |
|
||||
| B.java:12:14:12:23 | new Elem(...) | B.java:15:10:15:22 | b2.box1.elem1 |
|
||||
| B.java:12:14:12:23 | new Elem(...) | B.java:16:10:16:22 | b2.box1.elem2 |
|
||||
| C.java:3:21:3:30 | new Elem(...) | C.java:18:10:18:11 | s1 |
|
||||
| C.java:4:27:4:36 | new Elem(...) | C.java:19:10:19:11 | s2 |
|
||||
| C.java:6:28:6:37 | new Elem(...) | C.java:21:10:21:11 | s4 |
|
||||
| C.java:14:15:14:24 | new Elem(...) | C.java:20:10:20:11 | s3 |
|
||||
|
||||
Reference in New Issue
Block a user