blob: b4567f04f65bafcc8916318b0c25898fc116f562 (
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
|
class GetterLazy {
static class ValueType {
ValueType() {
super();
}
}
private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> fieldName = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>();
GetterLazy() {
super();
}
public @java.lang.SuppressWarnings({"all", "unchecked"}) ValueType getFieldName() {
java.lang.Object value = this.fieldName.get();
if ((value == null))
{
synchronized (this.fieldName)
{
value = this.fieldName.get();
if ((value == null))
{
final ValueType actualValue = new ValueType();
value = ((actualValue == null) ? this.fieldName : actualValue);
this.fieldName.set(value);
}
}
}
return (ValueType) ((value == this.fieldName) ? null : value);
}
}
|