forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA.java
More file actions
63 lines (49 loc) · 980 Bytes
/
A.java
File metadata and controls
63 lines (49 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
public class A {
static void sink(Object x) { }
static Object source() { return null; }
static class C1 {
C1() { }
C1(Object x) {
foo(x);
}
void wrapFoo1(Object x) {
foo(x);
}
void wrapFoo2(Object x) {
this.foo(x);
}
void foo(Object x) {
Object c1 = x;
sink(c1);
}
}
static class C2 extends C1 {
C2() { }
C2(Object x) {
super(x);
}
void foo(Object x) {
Object c2 = x;
sink(c2);
}
void callWrapFoo2() {
wrapFoo2(source());
}
}
static void wrapFoo3(C1 c1, Object x) {
c1.foo(x);
}
void test(C1 c) {
c.wrapFoo1(source());
c.wrapFoo2(source());
wrapFoo3(c, source());
new C1(source());
new C1().wrapFoo1(source());
new C1().wrapFoo2(source());
wrapFoo3(new C1(), source());
new C2(source());
new C2().wrapFoo1(source());
new C2().wrapFoo2(source());
wrapFoo3(new C2(), source());
}
}