mirror of
https://github.com/tiennm99/lombok.git
synced 2026-05-31 18:19:55 +00:00
850c3eaf07
And as expected the tests shows that @Synchronized and @SneakyThrows are currently broken for eclipse but not for ecj.
28 lines
960 B
Java
28 lines
960 B
Java
class GetterLazy {
|
|
static class ValueType {
|
|
ValueType() {
|
|
super();
|
|
}
|
|
}
|
|
private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<ValueType>> fieldName = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<ValueType>>();
|
|
public @java.lang.SuppressWarnings("all") ValueType getFieldName() {
|
|
java.util.concurrent.atomic.AtomicReference<ValueType> value = this.fieldName.get();
|
|
if ((value == null))
|
|
{
|
|
synchronized (this.fieldName)
|
|
{
|
|
value = this.fieldName.get();
|
|
if ((value == null))
|
|
{
|
|
value = new java.util.concurrent.atomic.AtomicReference<ValueType>(new ValueType());
|
|
this.fieldName.set(value);
|
|
}
|
|
}
|
|
}
|
|
return value.get();
|
|
}
|
|
GetterLazy() {
|
|
super();
|
|
}
|
|
}
|