From 6e2d23fdd7613de9650ffaf00c6e24a6ead0d74b Mon Sep 17 00:00:00 2001 From: Jan Rieke Date: Fri, 7 Feb 2020 14:28:46 +0100 Subject: setter prefixes for SuperBuilder setter prefixes for SuperBuilder [javac] better javadoc for the SuperBuilder setterPrefix value setter prefixes for SuperBuilder [ecj] add test for SuperBuilder setter method customization fix setter method customization with setterPrefix --- .../SuperBuilderCustomizedWithSetterPrefix.java | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 test/transform/resource/after-delombok/SuperBuilderCustomizedWithSetterPrefix.java (limited to 'test/transform/resource/after-delombok/SuperBuilderCustomizedWithSetterPrefix.java') diff --git a/test/transform/resource/after-delombok/SuperBuilderCustomizedWithSetterPrefix.java b/test/transform/resource/after-delombok/SuperBuilderCustomizedWithSetterPrefix.java new file mode 100644 index 00000000..8cc5dfe0 --- /dev/null +++ b/test/transform/resource/after-delombok/SuperBuilderCustomizedWithSetterPrefix.java @@ -0,0 +1,50 @@ +import java.util.List; +public class SuperBuilderCustomizedWithSetterPrefix { + public static class Parent { + public static abstract class ParentBuilder> { + @java.lang.SuppressWarnings("all") + private int field1; + public B setField1(int field1) { + this.field1 = field1 + 1; + return self(); + } + @java.lang.SuppressWarnings("all") + protected abstract B self(); + @java.lang.SuppressWarnings("all") + public abstract C build(); + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilder(field1=" + this.field1 + ")"; + } + } + int field1; + @java.lang.SuppressWarnings("all") + private static final class ParentBuilderImpl extends SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilder { + @java.lang.SuppressWarnings("all") + private ParentBuilderImpl() { + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + protected SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilderImpl self() { + return this; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public SuperBuilderCustomizedWithSetterPrefix.Parent build() { + return new SuperBuilderCustomizedWithSetterPrefix.Parent(this); + } + } + @java.lang.SuppressWarnings("all") + protected Parent(final SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilder b) { + this.field1 = b.field1; + } + @java.lang.SuppressWarnings("all") + public static SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilder builder() { + return new SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilderImpl(); + } + } + public static void test() { + Parent x = Parent.builder().setField1(5).build(); + } +} -- cgit