diff options
Diffstat (limited to 'test/transform')
5 files changed, 88 insertions, 2 deletions
diff --git a/test/transform/resource/after-delombok/BuilderGenericMethod.java b/test/transform/resource/after-delombok/BuilderGenericMethod.java new file mode 100644 index 00000000..f70ae871 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderGenericMethod.java @@ -0,0 +1,40 @@ +import java.util.List; +import java.util.*; +class BuilderGenericMethod<T> { + public <N extends Number> Map<N, T> foo(int a, long b) { + return null; + } + @java.lang.SuppressWarnings("all") + public class MapBuilder<N extends Number> { + @java.lang.SuppressWarnings("all") + private int a; + @java.lang.SuppressWarnings("all") + private long b; + @java.lang.SuppressWarnings("all") + MapBuilder() { + } + @java.lang.SuppressWarnings("all") + public MapBuilder<N> a(final int a) { + this.a = a; + return this; + } + @java.lang.SuppressWarnings("all") + public MapBuilder<N> b(final long b) { + this.b = b; + return this; + } + @java.lang.SuppressWarnings("all") + public Map<N, T> build() { + return BuilderGenericMethod.this.<N>foo(a, b); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderGenericMethod.MapBuilder(a=" + this.a + ", b=" + this.b + ")"; + } + } + @java.lang.SuppressWarnings("all") + public <N extends Number> MapBuilder<N> builder() { + return new MapBuilder<N>(); + } +} diff --git a/test/transform/resource/after-delombok/BuilderWithExistingBuilderClass.java b/test/transform/resource/after-delombok/BuilderWithExistingBuilderClass.java index 15293470..0a5edacd 100644 --- a/test/transform/resource/after-delombok/BuilderWithExistingBuilderClass.java +++ b/test/transform/resource/after-delombok/BuilderWithExistingBuilderClass.java @@ -24,7 +24,7 @@ class BuilderWithExistingBuilderClass<T, K extends Number> { return this; } @java.lang.SuppressWarnings("all") - public BuilderWithExistingBuilderClass build() { + public BuilderWithExistingBuilderClass<String, Z> build() { return BuilderWithExistingBuilderClass.<Z>staticMethod(arg1, arg2, arg3); } @java.lang.Override diff --git a/test/transform/resource/after-delombok/BuilderWithToBuilder.java b/test/transform/resource/after-delombok/BuilderWithToBuilder.java index e2ce1966..46387f0f 100644 --- a/test/transform/resource/after-delombok/BuilderWithToBuilder.java +++ b/test/transform/resource/after-delombok/BuilderWithToBuilder.java @@ -165,7 +165,7 @@ class StaticWithToBuilder<T, K> { return this; } @java.lang.SuppressWarnings("all") - public StaticWithToBuilder build() { + public StaticWithToBuilder<Z, String> build() { return StaticWithToBuilder.<Z>test(mOne, bar); } @java.lang.Override diff --git a/test/transform/resource/after-ecj/BuilderGenericMethod.java b/test/transform/resource/after-ecj/BuilderGenericMethod.java new file mode 100644 index 00000000..1b770654 --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderGenericMethod.java @@ -0,0 +1,35 @@ +import java.util.List; +import lombok.Builder; +import java.util.*; +class BuilderGenericMethod<T> { + public @java.lang.SuppressWarnings("all") class MapBuilder<N extends Number> { + private @java.lang.SuppressWarnings("all") int a; + private @java.lang.SuppressWarnings("all") long b; + @java.lang.SuppressWarnings("all") MapBuilder() { + super(); + } + public @java.lang.SuppressWarnings("all") MapBuilder<N> a(final int a) { + this.a = a; + return this; + } + public @java.lang.SuppressWarnings("all") MapBuilder<N> b(final long b) { + this.b = b; + return this; + } + public @java.lang.SuppressWarnings("all") Map<N, T> build() { + return BuilderGenericMethod.this.<N>foo(a, b); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((("BuilderGenericMethod.MapBuilder(a=" + this.a) + ", b=") + this.b) + ")"); + } + } + BuilderGenericMethod() { + super(); + } + public @Builder <N extends Number>Map<N, T> foo(int a, long b) { + return null; + } + public @java.lang.SuppressWarnings("all") <N extends Number>MapBuilder<N> builder() { + return new MapBuilder<N>(); + } +} diff --git a/test/transform/resource/before/BuilderGenericMethod.java b/test/transform/resource/before/BuilderGenericMethod.java new file mode 100644 index 00000000..63dcb4db --- /dev/null +++ b/test/transform/resource/before/BuilderGenericMethod.java @@ -0,0 +1,11 @@ +import java.util.List; + +import lombok.Builder; +import java.util.*; + +class BuilderGenericMethod<T> { + @Builder + public <N extends Number> Map<N,T> foo(int a, long b) { + return null; + } +} |