diff options
author | Roel Spilker <r.spilker@gmail.com> | 2017-12-12 01:03:51 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2017-12-12 01:04:20 +0100 |
commit | f2530ab37efecf60e9ed1df2ed232822df209e4e (patch) | |
tree | a347b1fd2e923b4b4faf56e6dfe5c1a20eb93555 /test/transform/resource | |
parent | 0232d99ba646313505536a0663952e9e94340022 (diff) | |
download | lombok-f2530ab37efecf60e9ed1df2ed232822df209e4e.tar.gz lombok-f2530ab37efecf60e9ed1df2ed232822df209e4e.tar.bz2 lombok-f2530ab37efecf60e9ed1df2ed232822df209e4e.zip |
handle @Builder.Default on generic fields. Fixes #1527
Diffstat (limited to 'test/transform/resource')
3 files changed, 139 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/BuilderDefaultsGenerics.java b/test/transform/resource/after-delombok/BuilderDefaultsGenerics.java new file mode 100644 index 00000000..18dd375e --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderDefaultsGenerics.java @@ -0,0 +1,73 @@ +import java.util.*; +public class BuilderDefaultsGenerics<N extends Number, T, R extends List<T>> { + private java.util.concurrent.Callable<N> callable; + private T tee; + private R arrr; + @java.lang.SuppressWarnings("all") + private static <N extends Number, T, R extends List<T>> java.util.concurrent.Callable<N> $default$callable() { + return null; + } + @java.lang.SuppressWarnings("all") + private static <N extends Number, T, R extends List<T>> T $default$tee() { + return null; + } + @java.lang.SuppressWarnings("all") + private static <N extends Number, T, R extends List<T>> R $default$arrr() { + return null; + } + @java.lang.SuppressWarnings("all") + BuilderDefaultsGenerics(final java.util.concurrent.Callable<N> callable, final T tee, final R arrr) { + this.callable = callable; + this.tee = tee; + this.arrr = arrr; + } + @java.lang.SuppressWarnings("all") + public static class BuilderDefaultsGenericsBuilder<N extends Number, T, R extends List<T>> { + @java.lang.SuppressWarnings("all") + private boolean callable$set; + @java.lang.SuppressWarnings("all") + private java.util.concurrent.Callable<N> callable; + @java.lang.SuppressWarnings("all") + private boolean tee$set; + @java.lang.SuppressWarnings("all") + private T tee; + @java.lang.SuppressWarnings("all") + private boolean arrr$set; + @java.lang.SuppressWarnings("all") + private R arrr; + @java.lang.SuppressWarnings("all") + BuilderDefaultsGenericsBuilder() { + } + @java.lang.SuppressWarnings("all") + public BuilderDefaultsGenericsBuilder<N, T, R> callable(final java.util.concurrent.Callable<N> callable) { + this.callable = callable; + callable$set = true; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderDefaultsGenericsBuilder<N, T, R> tee(final T tee) { + this.tee = tee; + tee$set = true; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderDefaultsGenericsBuilder<N, T, R> arrr(final R arrr) { + this.arrr = arrr; + arrr$set = true; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderDefaultsGenerics<N, T, R> build() { + return new BuilderDefaultsGenerics<N, T, R>(callable$set ? callable : BuilderDefaultsGenerics.<N, T, R>$default$callable(), tee$set ? tee : BuilderDefaultsGenerics.<N, T, R>$default$tee(), arrr$set ? arrr : BuilderDefaultsGenerics.<N, T, R>$default$arrr()); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderDefaultsGenerics.BuilderDefaultsGenericsBuilder(callable=" + this.callable + ", tee=" + this.tee + ", arrr=" + this.arrr + ")"; + } + } + @java.lang.SuppressWarnings("all") + public static <N extends Number, T, R extends List<T>> BuilderDefaultsGenericsBuilder<N, T, R> builder() { + return new BuilderDefaultsGenericsBuilder<N, T, R>(); + } +} diff --git a/test/transform/resource/after-ecj/BuilderDefaultsGenerics.java b/test/transform/resource/after-ecj/BuilderDefaultsGenerics.java new file mode 100644 index 00000000..a8f81afa --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderDefaultsGenerics.java @@ -0,0 +1,57 @@ +import lombok.Builder; +import java.util.*; +public @Builder class BuilderDefaultsGenerics<N extends Number, T, R extends List<T>> { + public static @java.lang.SuppressWarnings("all") class BuilderDefaultsGenericsBuilder<N extends Number, T, R extends List<T>> { + private @java.lang.SuppressWarnings("all") java.util.concurrent.Callable<N> callable; + private @java.lang.SuppressWarnings("all") boolean callable$set; + private @java.lang.SuppressWarnings("all") T tee; + private @java.lang.SuppressWarnings("all") boolean tee$set; + private @java.lang.SuppressWarnings("all") R arrr; + private @java.lang.SuppressWarnings("all") boolean arrr$set; + @java.lang.SuppressWarnings("all") BuilderDefaultsGenericsBuilder() { + super(); + } + public @java.lang.SuppressWarnings("all") BuilderDefaultsGenericsBuilder<N, T, R> callable(final java.util.concurrent.Callable<N> callable) { + this.callable = callable; + callable$set = true; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderDefaultsGenericsBuilder<N, T, R> tee(final T tee) { + this.tee = tee; + tee$set = true; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderDefaultsGenericsBuilder<N, T, R> arrr(final R arrr) { + this.arrr = arrr; + arrr$set = true; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderDefaultsGenerics<N, T, R> build() { + return new BuilderDefaultsGenerics<N, T, R>((callable$set ? callable : BuilderDefaultsGenerics.<N, T, R>$default$callable()), (tee$set ? tee : BuilderDefaultsGenerics.<N, T, R>$default$tee()), (arrr$set ? arrr : BuilderDefaultsGenerics.<N, T, R>$default$arrr())); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((((("BuilderDefaultsGenerics.BuilderDefaultsGenericsBuilder(callable=" + this.callable) + ", tee=") + this.tee) + ", arrr=") + this.arrr) + ")"); + } + } + private @Builder.Default java.util.concurrent.Callable<N> callable; + private @Builder.Default T tee; + private @Builder.Default R arrr; + private static @java.lang.SuppressWarnings("all") <N extends Number, T, R extends List<T>>java.util.concurrent.Callable<N> $default$callable() { + return null; + } + private static @java.lang.SuppressWarnings("all") <N extends Number, T, R extends List<T>>T $default$tee() { + return null; + } + private static @java.lang.SuppressWarnings("all") <N extends Number, T, R extends List<T>>R $default$arrr() { + return null; + } + @java.lang.SuppressWarnings("all") BuilderDefaultsGenerics(final java.util.concurrent.Callable<N> callable, final T tee, final R arrr) { + super(); + this.callable = callable; + this.tee = tee; + this.arrr = arrr; + } + public static @java.lang.SuppressWarnings("all") <N extends Number, T, R extends List<T>>BuilderDefaultsGenericsBuilder<N, T, R> builder() { + return new BuilderDefaultsGenericsBuilder<N, T, R>(); + } +} diff --git a/test/transform/resource/before/BuilderDefaultsGenerics.java b/test/transform/resource/before/BuilderDefaultsGenerics.java new file mode 100644 index 00000000..fffc9739 --- /dev/null +++ b/test/transform/resource/before/BuilderDefaultsGenerics.java @@ -0,0 +1,9 @@ +import lombok.Builder; +import java.util.*; + +@Builder +public class BuilderDefaultsGenerics<N extends Number, T, R extends List<T>> { + @Builder.Default private java.util.concurrent.Callable<N> callable = null; + @Builder.Default private T tee = null; + @Builder.Default private R arrr = null; +} |