blob: 4b10bf7fca8eea02a2d396523f4b4c79209d1404 (
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
36
37
38
39
40
41
42
43
44
|
import lombok.Delegate;
import lombok.Getter;
class DelegateOnGetter {
private interface Bar {
void setList(java.util.ArrayList<java.lang.String> list);
int getInt();
}
private final @Delegate @Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<Bar>> bar = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<Bar>>();
public @Delegate @java.lang.SuppressWarnings("all") 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))
{
final Bar actualValue = new Bar() {
x() {
super();
}
public void setList(java.util.ArrayList<String> list) {
}
public int getInt() {
return 42;
}
};
value = new java.util.concurrent.atomic.AtomicReference<Bar>(actualValue);
this.bar.set(value);
}
}
}
return value.get();
}
public @java.lang.SuppressWarnings("all") int getInt() {
return this.getBar().getInt();
}
public @java.lang.SuppressWarnings("all") void setList(final java.util.ArrayList<java.lang.String> list) {
this.getBar().setList(list);
}
DelegateOnGetter() {
super();
}
}
|