aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-ecj
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2016-12-05 23:41:38 +0100
committerRoel Spilker <r.spilker@gmail.com>2016-12-05 23:41:38 +0100
commitcf82dcfb8057637255ce223671a8d727fe0a073a (patch)
treed7359b41ad7732c507b59b7c78003863ab1d44a7 /test/transform/resource/after-ecj
parent0727c8bfd305408074d908dc4f8c31c0bff54789 (diff)
downloadlombok-cf82dcfb8057637255ce223671a8d727fe0a073a.tar.gz
lombok-cf82dcfb8057637255ce223671a8d727fe0a073a.tar.bz2
lombok-cf82dcfb8057637255ce223671a8d727fe0a073a.zip
Fixes #1236: Getter(lazy=true) now emits an error when used on a transient field
Diffstat (limited to 'test/transform/resource/after-ecj')
-rw-r--r--test/transform/resource/after-ecj/GetterLazyTransient.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/transform/resource/after-ecj/GetterLazyTransient.java b/test/transform/resource/after-ecj/GetterLazyTransient.java
new file mode 100644
index 00000000..9bc0d9ae
--- /dev/null
+++ b/test/transform/resource/after-ecj/GetterLazyTransient.java
@@ -0,0 +1,28 @@
+class GetterLazyTransient {
+ private final @lombok.Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.lang.Object> nonTransientField = new java.util.concurrent.atomic.AtomicReference<java.lang.Object>();
+ private final transient @lombok.Getter(lazy = true) int transientField = 2;
+ private final transient @lombok.Getter int nonLazyTransientField = 3;
+ GetterLazyTransient() {
+ super();
+ }
+ public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getNonTransientField() {
+ java.lang.Object value = this.nonTransientField.get();
+ if ((value == null))
+ {
+ synchronized (this.nonTransientField)
+ {
+ value = this.nonTransientField.get();
+ if ((value == null))
+ {
+ final int actualValue = 1;
+ value = actualValue;
+ this.nonTransientField.set(value);
+ }
+ }
+ }
+ return (java.lang.Integer) value;
+ }
+ public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int getNonLazyTransientField() {
+ return this.nonLazyTransientField;
+ }
+} \ No newline at end of file