diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2013-07-07 21:41:47 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2013-07-07 21:49:47 +0200 |
commit | 85fec0dffa5df13c0cafc86ca762774ba2c4d951 (patch) | |
tree | c44f9ae2ee9feb22033ee0a37d1de06648172580 /test/transform | |
parent | b6a23a7d94ee4f01b38a0e6d7db120fb05be0d6c (diff) | |
download | lombok-85fec0dffa5df13c0cafc86ca762774ba2c4d951.tar.gz lombok-85fec0dffa5df13c0cafc86ca762774ba2c4d951.tar.bz2 lombok-85fec0dffa5df13c0cafc86ca762774ba2c4d951.zip |
eclipse support for the new @Getter(lazy=true) desugaring.
Diffstat (limited to 'test/transform')
5 files changed, 56 insertions, 56 deletions
diff --git a/test/transform/resource/after-ecj/DelegateOnGetter.java b/test/transform/resource/after-ecj/DelegateOnGetter.java index 4eab3791..59f6a3b8 100644 --- a/test/transform/resource/after-ecj/DelegateOnGetter.java +++ b/test/transform/resource/after-ecj/DelegateOnGetter.java @@ -5,12 +5,12 @@ class DelegateOnGetter { 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>>(); + private final @Delegate @Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> bar = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>(); DelegateOnGetter() { super(); } public @Delegate @java.lang.SuppressWarnings("all") Bar getBar() { - java.util.concurrent.atomic.AtomicReference<Bar> value = this.bar.get(); + java.lang.Object value = this.bar.get(); if ((value == null)) { synchronized (this.bar) @@ -28,12 +28,12 @@ class DelegateOnGetter { return 42; } }; - value = new java.util.concurrent.atomic.AtomicReference<Bar>(actualValue); + value = ((actualValue == null) ? this.bar : actualValue); this.bar.set(value); } } } - return value.get(); + return (Bar) ((value == this.bar) ? null : value); } public @java.lang.SuppressWarnings("all") int getInt() { return this.getBar().getInt(); diff --git a/test/transform/resource/after-ecj/GetterLazy.java b/test/transform/resource/after-ecj/GetterLazy.java index 0f5027b9..8394f58d 100644 --- a/test/transform/resource/after-ecj/GetterLazy.java +++ b/test/transform/resource/after-ecj/GetterLazy.java @@ -4,12 +4,12 @@ class GetterLazy { 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>>(); + 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") ValueType getFieldName() { - java.util.concurrent.atomic.AtomicReference<ValueType> value = this.fieldName.get(); + java.lang.Object value = this.fieldName.get(); if ((value == null)) { synchronized (this.fieldName) @@ -18,11 +18,11 @@ class GetterLazy { if ((value == null)) { final ValueType actualValue = new ValueType(); - value = new java.util.concurrent.atomic.AtomicReference<ValueType>(actualValue); + value = ((actualValue == null) ? this.fieldName : actualValue); this.fieldName.set(value); } } } - return value.get(); + return (ValueType) ((value == this.fieldName) ? null : value); } } diff --git a/test/transform/resource/after-ecj/GetterLazyBoolean.java b/test/transform/resource/after-ecj/GetterLazyBoolean.java index 8c890827..a51b164f 100644 --- a/test/transform/resource/after-ecj/GetterLazyBoolean.java +++ b/test/transform/resource/after-ecj/GetterLazyBoolean.java @@ -1,6 +1,6 @@ @lombok.EqualsAndHashCode(of = "booleanValue") @lombok.ToString(of = "booleanValue") class GetterLazyBoolean { - private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Boolean>> booleanValue = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Boolean>>(); - private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Boolean>> otherBooleanValue = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Boolean>>(); + private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> booleanValue = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>(); + private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> otherBooleanValue = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>(); GetterLazyBoolean() { super(); } @@ -8,7 +8,7 @@ return true; } public @java.lang.SuppressWarnings("all") boolean isBooleanValue() { - java.util.concurrent.atomic.AtomicReference<java.lang.Boolean> value = this.booleanValue.get(); + java.lang.Object value = this.booleanValue.get(); if ((value == null)) { synchronized (this.booleanValue) @@ -17,15 +17,15 @@ if ((value == null)) { final boolean actualValue = calculateBoolean(); - value = new java.util.concurrent.atomic.AtomicReference<java.lang.Boolean>(actualValue); + value = actualValue; this.booleanValue.set(value); } } } - return value.get(); + return (java.lang.Boolean) value; } public @java.lang.SuppressWarnings("all") boolean isOtherBooleanValue() { - java.util.concurrent.atomic.AtomicReference<java.lang.Boolean> value = this.otherBooleanValue.get(); + java.lang.Object value = this.otherBooleanValue.get(); if ((value == null)) { synchronized (this.otherBooleanValue) @@ -34,12 +34,12 @@ if ((value == null)) { final boolean actualValue = (! calculateBoolean()); - value = new java.util.concurrent.atomic.AtomicReference<java.lang.Boolean>(actualValue); + value = actualValue; this.otherBooleanValue.set(value); } } } - return value.get(); + return (java.lang.Boolean) value; } public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { if ((o == this)) diff --git a/test/transform/resource/after-ecj/GetterLazyEahcToString.java b/test/transform/resource/after-ecj/GetterLazyEahcToString.java index 1ca848af..db2d4fcf 100644 --- a/test/transform/resource/after-ecj/GetterLazyEahcToString.java +++ b/test/transform/resource/after-ecj/GetterLazyEahcToString.java @@ -1,11 +1,11 @@ @lombok.EqualsAndHashCode(doNotUseGetters = true) @lombok.ToString(doNotUseGetters = true) class GetterLazyEahcToString { - private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<String>> value = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<String>>(); + private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> value = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>(); private final @lombok.Getter String value2 = ""; GetterLazyEahcToString() { super(); } public @java.lang.SuppressWarnings("all") String getValue() { - java.util.concurrent.atomic.AtomicReference<String> value = this.value.get(); + java.lang.Object value = this.value.get(); if ((value == null)) { synchronized (this.value) @@ -14,12 +14,12 @@ if ((value == null)) { final String actualValue = ""; - value = new java.util.concurrent.atomic.AtomicReference<String>(actualValue); + value = ((actualValue == null) ? this.value : actualValue); this.value.set(value); } } } - return value.get(); + return (String) ((value == this.value) ? null : value); } public @java.lang.SuppressWarnings("all") String getValue2() { return this.value2; diff --git a/test/transform/resource/after-ecj/GetterLazyNative.java b/test/transform/resource/after-ecj/GetterLazyNative.java index b67abfc9..db70f2f4 100644 --- a/test/transform/resource/after-ecj/GetterLazyNative.java +++ b/test/transform/resource/after-ecj/GetterLazyNative.java @@ -1,18 +1,18 @@ class GetterLazyNative { - private final @lombok.Getter(lazy = true) 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 @lombok.Getter(lazy = true) 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 @lombok.Getter(lazy = true) 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>>(); - private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Integer>> intField = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Integer>>(); - private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Long>> longField = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<java.lang.Long>>(); - private final @lombok.Getter(lazy = true) 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 @lombok.Getter(lazy = true) 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 @lombok.Getter(lazy = true) 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 @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<int[]>> intArrayField = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<int[]>>(); + private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> booleanField = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>(); + private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> byteField = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>(); + private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> shortField = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>(); + private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> intField = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>(); + private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> longField = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>(); + private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> floatField = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>(); + private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> doubleField = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>(); + private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> charField = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>(); + private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> intArrayField = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>(); GetterLazyNative() { super(); } public @java.lang.SuppressWarnings("all") boolean isBooleanField() { - java.util.concurrent.atomic.AtomicReference<java.lang.Boolean> value = this.booleanField.get(); + java.lang.Object value = this.booleanField.get(); if ((value == null)) { synchronized (this.booleanField) @@ -21,15 +21,15 @@ class GetterLazyNative { if ((value == null)) { final boolean actualValue = true; - value = new java.util.concurrent.atomic.AtomicReference<java.lang.Boolean>(actualValue); + value = actualValue; this.booleanField.set(value); } } } - return value.get(); + return (java.lang.Boolean) value; } public @java.lang.SuppressWarnings("all") byte getByteField() { - java.util.concurrent.atomic.AtomicReference<java.lang.Byte> value = this.byteField.get(); + java.lang.Object value = this.byteField.get(); if ((value == null)) { synchronized (this.byteField) @@ -38,15 +38,15 @@ class GetterLazyNative { if ((value == null)) { final byte actualValue = 1; - value = new java.util.concurrent.atomic.AtomicReference<java.lang.Byte>(actualValue); + value = actualValue; this.byteField.set(value); } } } - return value.get(); + return (java.lang.Byte) value; } public @java.lang.SuppressWarnings("all") short getShortField() { - java.util.concurrent.atomic.AtomicReference<java.lang.Short> value = this.shortField.get(); + java.lang.Object value = this.shortField.get(); if ((value == null)) { synchronized (this.shortField) @@ -55,15 +55,15 @@ class GetterLazyNative { if ((value == null)) { final short actualValue = 1; - value = new java.util.concurrent.atomic.AtomicReference<java.lang.Short>(actualValue); + value = actualValue; this.shortField.set(value); } } } - return value.get(); + return (java.lang.Short) value; } public @java.lang.SuppressWarnings("all") int getIntField() { - java.util.concurrent.atomic.AtomicReference<java.lang.Integer> value = this.intField.get(); + java.lang.Object value = this.intField.get(); if ((value == null)) { synchronized (this.intField) @@ -72,15 +72,15 @@ class GetterLazyNative { if ((value == null)) { final int actualValue = 1; - value = new java.util.concurrent.atomic.AtomicReference<java.lang.Integer>(actualValue); + value = actualValue; this.intField.set(value); } } } - return value.get(); + return (java.lang.Integer) value; } public @java.lang.SuppressWarnings("all") long getLongField() { - java.util.concurrent.atomic.AtomicReference<java.lang.Long> value = this.longField.get(); + java.lang.Object value = this.longField.get(); if ((value == null)) { synchronized (this.longField) @@ -89,15 +89,15 @@ class GetterLazyNative { if ((value == null)) { final long actualValue = 1; - value = new java.util.concurrent.atomic.AtomicReference<java.lang.Long>(actualValue); + value = actualValue; this.longField.set(value); } } } - return value.get(); + return (java.lang.Long) value; } public @java.lang.SuppressWarnings("all") float getFloatField() { - java.util.concurrent.atomic.AtomicReference<java.lang.Float> value = this.floatField.get(); + java.lang.Object value = this.floatField.get(); if ((value == null)) { synchronized (this.floatField) @@ -106,15 +106,15 @@ class GetterLazyNative { if ((value == null)) { final float actualValue = 1.0f; - value = new java.util.concurrent.atomic.AtomicReference<java.lang.Float>(actualValue); + value = actualValue; this.floatField.set(value); } } } - return value.get(); + return (java.lang.Float) value; } public @java.lang.SuppressWarnings("all") double getDoubleField() { - java.util.concurrent.atomic.AtomicReference<java.lang.Double> value = this.doubleField.get(); + java.lang.Object value = this.doubleField.get(); if ((value == null)) { synchronized (this.doubleField) @@ -123,15 +123,15 @@ class GetterLazyNative { if ((value == null)) { final double actualValue = 1.0; - value = new java.util.concurrent.atomic.AtomicReference<java.lang.Double>(actualValue); + value = actualValue; this.doubleField.set(value); } } } - return value.get(); + return (java.lang.Double) value; } public @java.lang.SuppressWarnings("all") char getCharField() { - java.util.concurrent.atomic.AtomicReference<java.lang.Character> value = this.charField.get(); + java.lang.Object value = this.charField.get(); if ((value == null)) { synchronized (this.charField) @@ -140,15 +140,15 @@ class GetterLazyNative { if ((value == null)) { final char actualValue = '1'; - value = new java.util.concurrent.atomic.AtomicReference<java.lang.Character>(actualValue); + value = actualValue; this.charField.set(value); } } } - return value.get(); + return (java.lang.Character) value; } public @java.lang.SuppressWarnings("all") int[] getIntArrayField() { - java.util.concurrent.atomic.AtomicReference<int[]> value = this.intArrayField.get(); + java.lang.Object value = this.intArrayField.get(); if ((value == null)) { synchronized (this.intArrayField) @@ -157,11 +157,11 @@ class GetterLazyNative { if ((value == null)) { final int[] actualValue = new int[]{1}; - value = new java.util.concurrent.atomic.AtomicReference<int[]>(actualValue); + value = ((actualValue == null) ? this.intArrayField : actualValue); this.intArrayField.set(value); } } } - return value.get(); + return (int[]) ((value == this.intArrayField) ? null : value); } } |