diff options
Diffstat (limited to 'test')
4 files changed, 94 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/DelegateOnGetter.java b/test/transform/resource/after-delombok/DelegateOnGetter.java new file mode 100644 index 00000000..ee34018a --- /dev/null +++ b/test/transform/resource/after-delombok/DelegateOnGetter.java @@ -0,0 +1,35 @@ +class DelegateOnGetter { + private final 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 interface Bar { + void setList(java.util.ArrayList<java.lang.String> list); + int getInt(); + } + @java.lang.SuppressWarnings("all") + public Bar getBar() { + java.util.concurrent.atomic.AtomicReference<Bar> value = this.bar.get(); + if (value == null) { + synchronized (this.bar) { + value = this.bar.get(); + if (value == null) { + value = new java.util.concurrent.atomic.AtomicReference<Bar>(new Bar(){ + public void setList(java.util.ArrayList<String> list) { + } + public int getInt() { + return 42; + } + }); + this.bar.set(value); + } + } + } + return value.get(); + } + @java.lang.SuppressWarnings("all") + public void setList(final java.util.ArrayList<java.lang.String> list) { + this.getBar().setList(list); + } + @java.lang.SuppressWarnings("all") + public int getInt() { + return this.getBar().getInt(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/DelegateOnGetter.java b/test/transform/resource/after-ecj/DelegateOnGetter.java new file mode 100644 index 00000000..cb06d3c1 --- /dev/null +++ b/test/transform/resource/after-ecj/DelegateOnGetter.java @@ -0,0 +1 @@ +//ignore
\ No newline at end of file diff --git a/test/transform/resource/after-eclipse/DelegateOnGetter.java b/test/transform/resource/after-eclipse/DelegateOnGetter.java new file mode 100644 index 00000000..7d5907e0 --- /dev/null +++ b/test/transform/resource/after-eclipse/DelegateOnGetter.java @@ -0,0 +1,40 @@ +import lombok.Delegate; +import lombok.Getter; +class DelegateOnGetter { + private interface Bar { + 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>>(); + public @Delegate @java.lang.SuppressWarnings("all") Bar getBar() { + java.util.concurrent.atomic.AtomicReference<Bar> value = this.bar.get(); + if ((value == null)) + { + synchronized (this.bar) + { + value = this.bar.get(); + if ((value == null)) + { + value = new java.util.concurrent.atomic.AtomicReference<Bar>(new Bar() { + public void setList(java.util.ArrayList<String> list) { + } + public int getInt() { + return 42; + } +}); + this.bar.set(value); + } + } + } + return value.get(); + } + public @java.lang.SuppressWarnings("all") int getInt() { + return this.getBar().getInt(); + } + public @java.lang.SuppressWarnings("all") void setList(final java.util.ArrayList<java.lang.String> list) { + this.getBar().setList(list); + } + DelegateOnGetter() { + super(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/before/DelegateOnGetter.java b/test/transform/resource/before/DelegateOnGetter.java new file mode 100644 index 00000000..afe09ff4 --- /dev/null +++ b/test/transform/resource/before/DelegateOnGetter.java @@ -0,0 +1,18 @@ +import lombok.Delegate; +import lombok.Getter; + +class DelegateOnGetter { + + @Delegate @Getter(lazy=true) private final Bar bar = new Bar() { + public void setList(java.util.ArrayList<String> list) { + } + public int getInt() { + return 42; + } + }; + + private interface Bar { + void setList(java.util.ArrayList<java.lang.String> list); + int getInt(); + } +}
\ No newline at end of file |