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
41 lines (38 loc) · 720 Bytes
/
A.java
File metadata and controls
41 lines (38 loc) · 720 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
public class A {
static class Box {
String elem;
Box(String e) { elem = e; }
void setElem(String e) { elem = e; }
String getElem() { return elem; }
}
String get() {
return null;
}
void f1(int i) {
A a = f2("A", i);
String x = a.get();
}
A f2(String p, int i) {
String s;
if (i == 0) {
s = "B";
} else {
s = "C";
}
Box b1 = new Box("D");
Box b2 = new Box(null);
b2.setElem("E");
A a = new A() {
@Override
String get() {
switch (i) {
case 0: return p;
case 1: return s;
case 2: return b1.getElem();
default:return b2.getElem();
}
}
};
return a;
}
}