aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-delombok/GetterLazyNative.java
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2010-11-11 05:55:15 +0100
committerRoel Spilker <r.spilker@gmail.com>2010-11-11 05:55:15 +0100
commit3f00e7c90548cc00fca75ad1975a2ecc05521871 (patch)
treeae366ad188b29d5af556ad708906382e14a5d435 /test/transform/resource/after-delombok/GetterLazyNative.java
parenta9113718ae2adc2d837f9e5a1adf885a4b1aa844 (diff)
downloadlombok-3f00e7c90548cc00fca75ad1975a2ecc05521871.tar.gz
lombok-3f00e7c90548cc00fca75ad1975a2ecc05521871.tar.bz2
lombok-3f00e7c90548cc00fca75ad1975a2ecc05521871.zip
@Getter(lazy=true) now also works in Eclipse
Diffstat (limited to 'test/transform/resource/after-delombok/GetterLazyNative.java')
-rw-r--r--test/transform/resource/after-delombok/GetterLazyNative.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/test/transform/resource/after-delombok/GetterLazyNative.java b/test/transform/resource/after-delombok/GetterLazyNative.java
index ffa0824b..650d0496 100644
--- a/test/transform/resource/after-delombok/GetterLazyNative.java
+++ b/test/transform/resource/after-delombok/GetterLazyNative.java
@@ -1,5 +1,4 @@
class GetterLazyNative {
-
private final java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Boolean>> booleanField = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Boolean>>();
private final java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Byte>> byteField = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Byte>>();
private final java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Short>> shortField = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Short>>();
@@ -8,7 +7,7 @@ class GetterLazyNative {
private final java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Float>> floatField = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Float>>();
private final java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Double>> doubleField = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Double>>();
private final java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Character>> charField = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Character>>();
-
+ private final java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<int[]>> intArrayField = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<int[]>>();
@java.lang.SuppressWarnings("all")
public boolean getBooleanField() {
java.util.concurrent.atomic.AtomicReference<java.lang.Boolean> value = this.booleanField.get();
@@ -121,4 +120,18 @@ class GetterLazyNative {
}
return value.get();
}
-}
+ @java.lang.SuppressWarnings("all")
+ public int[] getIntArrayField() {
+ java.util.concurrent.atomic.AtomicReference<int[]> value = this.intArrayField.get();
+ if (value == null) {
+ synchronized (this.intArrayField) {
+ value = this.intArrayField.get();
+ if (value == null) {
+ value = new java.util.concurrent.atomic.AtomicReference<int[]>(new int[]{1});
+ this.intArrayField.set(value);
+ }
+ }
+ }
+ return value.get();
+ }
+} \ No newline at end of file