mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-15 02:17:12 +00:00
@Getter(lazy=true) now also works in Eclipse
This commit is contained in:
1 parent
a9113718ae
commit
3f00e7c905
13 files changed
+570
-22
No files matched your search
@@ -0,0 +1,27 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user