From a2a194f32da2058e8783cd664d74799cf418d03d Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Sat, 16 May 2020 11:54:56 +0200 Subject: [fixes #2006] Delegate now excludes already implemented methods --- .../after-delombok/DelegateAlreadyImplemented.java | 43 +++++++++++++++++++++ .../after-ecj/DelegateAlreadyImplemented.java | 29 ++++++++++++++ .../before/DelegateAlreadyImplemented.java | 45 ++++++++++++++++++++++ 3 files changed, 117 insertions(+) create mode 100644 test/transform/resource/after-delombok/DelegateAlreadyImplemented.java create mode 100644 test/transform/resource/after-ecj/DelegateAlreadyImplemented.java create mode 100644 test/transform/resource/before/DelegateAlreadyImplemented.java (limited to 'test') diff --git a/test/transform/resource/after-delombok/DelegateAlreadyImplemented.java b/test/transform/resource/after-delombok/DelegateAlreadyImplemented.java new file mode 100644 index 00000000..c876d8ce --- /dev/null +++ b/test/transform/resource/after-delombok/DelegateAlreadyImplemented.java @@ -0,0 +1,43 @@ +public class DelegateAlreadyImplemented { + private A a; + + public void a() { + } + + public void b(java.util.List l) { + } + + public void c(java.util.List l, String[] a, Integer... varargs) { + } + + public void d(String[][][][] d) { + } + + public void e(Y x) { + } + + @SuppressWarnings("unchecked") + public void f(T s, java.util.List l, T[] a, T... varargs) { + } + + public void g(Number g) { + } +} + +interface A { + void a(); + + void b(java.util.List l); + + @SuppressWarnings("unchecked") + void c(java.util.List l, String[] a, T... varargs); + + void d(String[][][][] d); + + X e(X x); + + @SuppressWarnings("unchecked") + void f(T2 s, java.util.List l, T2[] a, T2... varargs); + + void g(G g); +} \ No newline at end of file diff --git a/test/transform/resource/after-ecj/DelegateAlreadyImplemented.java b/test/transform/resource/after-ecj/DelegateAlreadyImplemented.java new file mode 100644 index 00000000..1e12f405 --- /dev/null +++ b/test/transform/resource/after-ecj/DelegateAlreadyImplemented.java @@ -0,0 +1,29 @@ +public class DelegateAlreadyImplemented { + private @lombok.experimental.Delegate A a; + public DelegateAlreadyImplemented() { + super(); + } + public void a() { + } + public void b(java.util.List l) { + } + public void c(java.util.List l, String[] a, Integer... varargs) { + } + public void d(String[][][][] d) { + } + public void e(Y x) { + } + public @SuppressWarnings("unchecked") void f(T s, java.util.List l, T[] a, T... varargs) { + } + public void g(Number g) { + } +} +interface A { + public void a(); + public void b(java.util.List l); + public @SuppressWarnings("unchecked") void c(java.util.List l, String[] a, T... varargs); + public void d(String[][][][] d); + public X e(X x); + public @SuppressWarnings("unchecked") void f(T2 s, java.util.List l, T2[] a, T2... varargs); + public void g(G g); +} \ No newline at end of file diff --git a/test/transform/resource/before/DelegateAlreadyImplemented.java b/test/transform/resource/before/DelegateAlreadyImplemented.java new file mode 100644 index 00000000..c43c1949 --- /dev/null +++ b/test/transform/resource/before/DelegateAlreadyImplemented.java @@ -0,0 +1,45 @@ +public class DelegateAlreadyImplemented { + + @lombok.experimental.Delegate + private A a; + + public void a() { + } + + public void b(java.util.List l) { + } + + public void c(java.util.List l, String[] a, Integer... varargs) { + } + + public void d(String[][][][] d) { + } + + public void e(Y x) { + } + + @SuppressWarnings("unchecked") + public void f(T s, java.util.List l, T[] a, T... varargs) { + } + + public void g(Number g) { + } +} + +interface A { + public void a(); + + public void b(java.util.List l); + + @SuppressWarnings("unchecked") + public void c(java.util.List l, String[] a, T... varargs); + + public void d(String[][][][] d); + + public X e(X x); + + @SuppressWarnings("unchecked") + public void f(T2 s, java.util.List l, T2[] a, T2... varargs); + + public void g(G g); +} \ No newline at end of file -- cgit