From b6a23a7d94ee4f01b38a0e6d7db120fb05be0d6c Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sun, 7 Jul 2013 09:14:59 +0200 Subject: @Getter(lazy=true) now uses a different, more efficient desugaring. Implementing in javac, ecj still has to be done. --- .../resource/after-delombok/GetterLazyNative.java | 74 +++++++++++----------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'test/transform/resource/after-delombok/GetterLazyNative.java') diff --git a/test/transform/resource/after-delombok/GetterLazyNative.java b/test/transform/resource/after-delombok/GetterLazyNative.java index a10075ba..eb31991a 100644 --- a/test/transform/resource/after-delombok/GetterLazyNative.java +++ b/test/transform/resource/after-delombok/GetterLazyNative.java @@ -1,146 +1,146 @@ class GetterLazyNative { - private final java.util.concurrent.atomic.AtomicReference> booleanField = new java.util.concurrent.atomic.AtomicReference>(); - private final java.util.concurrent.atomic.AtomicReference> byteField = new java.util.concurrent.atomic.AtomicReference>(); - private final java.util.concurrent.atomic.AtomicReference> shortField = new java.util.concurrent.atomic.AtomicReference>(); - private final java.util.concurrent.atomic.AtomicReference> intField = new java.util.concurrent.atomic.AtomicReference>(); - private final java.util.concurrent.atomic.AtomicReference> longField = new java.util.concurrent.atomic.AtomicReference>(); - private final java.util.concurrent.atomic.AtomicReference> floatField = new java.util.concurrent.atomic.AtomicReference>(); - private final java.util.concurrent.atomic.AtomicReference> doubleField = new java.util.concurrent.atomic.AtomicReference>(); - private final java.util.concurrent.atomic.AtomicReference> charField = new java.util.concurrent.atomic.AtomicReference>(); - private final java.util.concurrent.atomic.AtomicReference> intArrayField = new java.util.concurrent.atomic.AtomicReference>(); + private final java.util.concurrent.atomic.AtomicReference booleanField = new java.util.concurrent.atomic.AtomicReference(); + private final java.util.concurrent.atomic.AtomicReference byteField = new java.util.concurrent.atomic.AtomicReference(); + private final java.util.concurrent.atomic.AtomicReference shortField = new java.util.concurrent.atomic.AtomicReference(); + private final java.util.concurrent.atomic.AtomicReference intField = new java.util.concurrent.atomic.AtomicReference(); + private final java.util.concurrent.atomic.AtomicReference longField = new java.util.concurrent.atomic.AtomicReference(); + private final java.util.concurrent.atomic.AtomicReference floatField = new java.util.concurrent.atomic.AtomicReference(); + private final java.util.concurrent.atomic.AtomicReference doubleField = new java.util.concurrent.atomic.AtomicReference(); + private final java.util.concurrent.atomic.AtomicReference charField = new java.util.concurrent.atomic.AtomicReference(); + private final java.util.concurrent.atomic.AtomicReference intArrayField = new java.util.concurrent.atomic.AtomicReference(); @java.lang.SuppressWarnings("all") public boolean isBooleanField() { - java.util.concurrent.atomic.AtomicReference value = this.booleanField.get(); + java.lang.Object value = this.booleanField.get(); if (value == null) { synchronized (this.booleanField) { value = this.booleanField.get(); if (value == null) { final boolean actualValue = true; - value = new java.util.concurrent.atomic.AtomicReference(actualValue); + value = actualValue; this.booleanField.set(value); } } } - return value.get(); + return (java.lang.Boolean)value; } @java.lang.SuppressWarnings("all") public byte getByteField() { - java.util.concurrent.atomic.AtomicReference value = this.byteField.get(); + java.lang.Object value = this.byteField.get(); if (value == null) { synchronized (this.byteField) { value = this.byteField.get(); if (value == null) { final byte actualValue = 1; - value = new java.util.concurrent.atomic.AtomicReference(actualValue); + value = actualValue; this.byteField.set(value); } } } - return value.get(); + return (java.lang.Byte)value; } @java.lang.SuppressWarnings("all") public short getShortField() { - java.util.concurrent.atomic.AtomicReference value = this.shortField.get(); + java.lang.Object value = this.shortField.get(); if (value == null) { synchronized (this.shortField) { value = this.shortField.get(); if (value == null) { final short actualValue = 1; - value = new java.util.concurrent.atomic.AtomicReference(actualValue); + value = actualValue; this.shortField.set(value); } } } - return value.get(); + return (java.lang.Short)value; } @java.lang.SuppressWarnings("all") public int getIntField() { - java.util.concurrent.atomic.AtomicReference value = this.intField.get(); + java.lang.Object value = this.intField.get(); if (value == null) { synchronized (this.intField) { value = this.intField.get(); if (value == null) { final int actualValue = 1; - value = new java.util.concurrent.atomic.AtomicReference(actualValue); + value = actualValue; this.intField.set(value); } } } - return value.get(); + return (java.lang.Integer)value; } @java.lang.SuppressWarnings("all") public long getLongField() { - java.util.concurrent.atomic.AtomicReference value = this.longField.get(); + java.lang.Object value = this.longField.get(); if (value == null) { synchronized (this.longField) { value = this.longField.get(); if (value == null) { final long actualValue = 1; - value = new java.util.concurrent.atomic.AtomicReference(actualValue); + value = actualValue; this.longField.set(value); } } } - return value.get(); + return (java.lang.Long)value; } @java.lang.SuppressWarnings("all") public float getFloatField() { - java.util.concurrent.atomic.AtomicReference value = this.floatField.get(); + java.lang.Object value = this.floatField.get(); if (value == null) { synchronized (this.floatField) { value = this.floatField.get(); if (value == null) { final float actualValue = 1.0F; - value = new java.util.concurrent.atomic.AtomicReference(actualValue); + value = actualValue; this.floatField.set(value); } } } - return value.get(); + return (java.lang.Float)value; } @java.lang.SuppressWarnings("all") public double getDoubleField() { - java.util.concurrent.atomic.AtomicReference value = this.doubleField.get(); + java.lang.Object value = this.doubleField.get(); if (value == null) { synchronized (this.doubleField) { value = this.doubleField.get(); if (value == null) { final double actualValue = 1.0; - value = new java.util.concurrent.atomic.AtomicReference(actualValue); + value = actualValue; this.doubleField.set(value); } } } - return value.get(); + return (java.lang.Double)value; } @java.lang.SuppressWarnings("all") public char getCharField() { - java.util.concurrent.atomic.AtomicReference value = this.charField.get(); + java.lang.Object value = this.charField.get(); if (value == null) { synchronized (this.charField) { value = this.charField.get(); if (value == null) { final char actualValue = '1'; - value = new java.util.concurrent.atomic.AtomicReference(actualValue); + value = actualValue; this.charField.set(value); } } } - return value.get(); + return (java.lang.Character)value; } @java.lang.SuppressWarnings("all") public int[] getIntArrayField() { - java.util.concurrent.atomic.AtomicReference value = this.intArrayField.get(); + java.lang.Object value = this.intArrayField.get(); if (value == null) { synchronized (this.intArrayField) { value = this.intArrayField.get(); if (value == null) { final int[] actualValue = new int[]{1}; - value = new java.util.concurrent.atomic.AtomicReference(actualValue); + value = actualValue == null ? this.intArrayField : actualValue; this.intArrayField.set(value); } } } - return value.get(); + return (int[])(value == this.intArrayField ? null : value); } -} \ No newline at end of file +} -- cgit