diff options
Diffstat (limited to 'test/transform')
16 files changed, 220 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-delombok/DelegateOnGetterNone.java b/test/transform/resource/after-delombok/DelegateOnGetterNone.java new file mode 100644 index 00000000..b3258f25 --- /dev/null +++ b/test/transform/resource/after-delombok/DelegateOnGetterNone.java @@ -0,0 +1,15 @@ +class DelegateOnGetterNone { + private final Bar bar; + private interface Bar { + void setList(java.util.ArrayList<java.lang.String> list); + int getInt(); + } + @java.lang.SuppressWarnings("all") + public void setList(final java.util.ArrayList<java.lang.String> list) { + this.bar.setList(list); + } + @java.lang.SuppressWarnings("all") + public int getInt() { + return this.bar.getInt(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/DelegateOnMethods.java b/test/transform/resource/after-delombok/DelegateOnMethods.java new file mode 100644 index 00000000..b900f140 --- /dev/null +++ b/test/transform/resource/after-delombok/DelegateOnMethods.java @@ -0,0 +1,12 @@ +abstract class DelegateOnMethods { + public abstract Bar getBar(); + + public static interface Bar { + void bar(java.util.ArrayList<java.lang.String> list); + } + + @java.lang.SuppressWarnings("all") + public void bar(final java.util.ArrayList<java.lang.String> list) { + this.getBar().bar(list); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/GetterNone.java b/test/transform/resource/after-delombok/GetterNone.java new file mode 100644 index 00000000..11b4fd09 --- /dev/null +++ b/test/transform/resource/after-delombok/GetterNone.java @@ -0,0 +1,8 @@ +class GetterNone { + int i; + int foo; + @java.lang.SuppressWarnings("all") + public int getI() { + return this.i; + } +}
\ 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-ecj/DelegateOnGetterNone.java b/test/transform/resource/after-ecj/DelegateOnGetterNone.java new file mode 100644 index 00000000..cb06d3c1 --- /dev/null +++ b/test/transform/resource/after-ecj/DelegateOnGetterNone.java @@ -0,0 +1 @@ +//ignore
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/DelegateOnMethods.java b/test/transform/resource/after-ecj/DelegateOnMethods.java new file mode 100644 index 00000000..cb06d3c1 --- /dev/null +++ b/test/transform/resource/after-ecj/DelegateOnMethods.java @@ -0,0 +1 @@ +//ignore
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/GetterNone.java b/test/transform/resource/after-ecj/GetterNone.java new file mode 100644 index 00000000..2ab252ea --- /dev/null +++ b/test/transform/resource/after-ecj/GetterNone.java @@ -0,0 +1,12 @@ +import lombok.AccessLevel; +import lombok.Getter; +@Getter class GetterNone { + int i; + @Getter(AccessLevel.NONE) int foo; + public @java.lang.SuppressWarnings("all") int getI() { + return this.i; + } + GetterNone() { + super(); + } +}
\ 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/after-eclipse/DelegateOnGetterNone.java b/test/transform/resource/after-eclipse/DelegateOnGetterNone.java new file mode 100644 index 00000000..195797a8 --- /dev/null +++ b/test/transform/resource/after-eclipse/DelegateOnGetterNone.java @@ -0,0 +1,19 @@ +import lombok.AccessLevel; +import lombok.Delegate; +import lombok.Getter; +@Getter class DelegateOnGetterNone { + private interface Bar { + void setList(java.util.ArrayList<java.lang.String> list); + int getInt(); + } + private final @Delegate @Getter(AccessLevel.NONE) Bar bar; + public @java.lang.SuppressWarnings("all") int getInt() { + return this.bar.getInt(); + } + public @java.lang.SuppressWarnings("all") void setList(final java.util.ArrayList<java.lang.String> list) { + this.bar.setList(list); + } + DelegateOnGetterNone() { + super(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-eclipse/DelegateOnMethods.java b/test/transform/resource/after-eclipse/DelegateOnMethods.java new file mode 100644 index 00000000..37922e2a --- /dev/null +++ b/test/transform/resource/after-eclipse/DelegateOnMethods.java @@ -0,0 +1,13 @@ +import lombok.Delegate; +abstract class DelegateOnMethods { + public static interface Bar { + void bar(java.util.ArrayList<java.lang.String> list); + } + public @java.lang.SuppressWarnings("all") void bar(final java.util.ArrayList<java.lang.String> list) { + this.getBar().bar(list); + } + DelegateOnMethods() { + super(); + } + public abstract @Delegate Bar getBar(); +}
\ No newline at end of file diff --git a/test/transform/resource/after-eclipse/GetterNone.java b/test/transform/resource/after-eclipse/GetterNone.java new file mode 100644 index 00000000..2ab252ea --- /dev/null +++ b/test/transform/resource/after-eclipse/GetterNone.java @@ -0,0 +1,12 @@ +import lombok.AccessLevel; +import lombok.Getter; +@Getter class GetterNone { + int i; + @Getter(AccessLevel.NONE) int foo; + public @java.lang.SuppressWarnings("all") int getI() { + return this.i; + } + GetterNone() { + 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 diff --git a/test/transform/resource/before/DelegateOnGetterNone.java b/test/transform/resource/before/DelegateOnGetterNone.java new file mode 100644 index 00000000..f9642e6b --- /dev/null +++ b/test/transform/resource/before/DelegateOnGetterNone.java @@ -0,0 +1,14 @@ +import lombok.AccessLevel; +import lombok.Delegate; +import lombok.Getter; + +@Getter +class DelegateOnGetterNone { + + @Delegate @Getter(AccessLevel.NONE) private final Bar bar; + + private interface Bar { + void setList(java.util.ArrayList<java.lang.String> list); + int getInt(); + } +} diff --git a/test/transform/resource/before/DelegateOnMethods.java b/test/transform/resource/before/DelegateOnMethods.java new file mode 100644 index 00000000..1606e18c --- /dev/null +++ b/test/transform/resource/before/DelegateOnMethods.java @@ -0,0 +1,11 @@ +import lombok.Delegate; + +abstract class DelegateOnMethods { + + @Delegate + public abstract Bar getBar(); + + public static interface Bar { + void bar(java.util.ArrayList<java.lang.String> list); + } +}
\ No newline at end of file diff --git a/test/transform/resource/before/GetterNone.java b/test/transform/resource/before/GetterNone.java new file mode 100644 index 00000000..8497e4fc --- /dev/null +++ b/test/transform/resource/before/GetterNone.java @@ -0,0 +1,8 @@ +import lombok.AccessLevel; +import lombok.Getter; + +@Getter +class GetterNone { + int i; + @Getter(AccessLevel.NONE) int foo; +}
\ No newline at end of file |