blob: ee34018af76123af5863e976aca4891bd750fb21 (
plain)
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
|
class DelegateOnGetter {
private final java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<Bar>> bar = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<Bar>>();
private interface Bar {
void setList(java.util.ArrayList<java.lang.String> list);
int getInt();
}
@java.lang.SuppressWarnings("all")
public Bar getBar() {
java.util.concurrent.atomic.AtomicReference<Bar> value = this.bar.get();
if (value == null) {
synchronized (this.bar) {
value = this.bar.get();
if (value == null) {
value = new java.util.concurrent.atomic.AtomicReference<Bar>(new Bar(){
public void setList(java.util.ArrayList<String> list) {
}
public int getInt() {
return 42;
}
});
this.bar.set(value);
}
}
}
return value.get();
}
@java.lang.SuppressWarnings("all")
public void setList(final java.util.ArrayList<java.lang.String> list) {
this.getBar().setList(list);
}
@java.lang.SuppressWarnings("all")
public int getInt() {
return this.getBar().getInt();
}
}
|