aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-ecj
diff options
context:
space:
mode:
Diffstat (limited to 'test/transform/resource/after-ecj')
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderAbstract.java222
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderAbstractToBuilder.java280
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderBasic.java244
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java366
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderCustomized.java182
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderCustomizedWithSetterPrefix.java90
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderNestedGenericTypes.java72
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderWithCustomBuilderMethod.java244
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderWithDefaults.java242
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderWithGenerics.java244
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderWithGenerics2.java244
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderWithGenericsAndToBuilder.java324
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderWithNonNull.java222
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderWithSetterPrefix.java366
-rw-r--r--test/transform/resource/after-ecj/ValueCallSuper.java64
15 files changed, 1703 insertions, 1703 deletions
diff --git a/test/transform/resource/after-ecj/SuperBuilderAbstract.java b/test/transform/resource/after-ecj/SuperBuilderAbstract.java
index 88406272..2fef9451 100644
--- a/test/transform/resource/after-ecj/SuperBuilderAbstract.java
+++ b/test/transform/resource/after-ecj/SuperBuilderAbstract.java
@@ -1,111 +1,111 @@
-public class SuperBuilderAbstract {
- public static @lombok.experimental.SuperBuilder class Parent {
- public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<C extends SuperBuilderAbstract.Parent, B extends SuperBuilderAbstract.Parent.ParentBuilder<C, B>> {
- private @java.lang.SuppressWarnings("all") int parentField;
- public ParentBuilder() {
- super();
- }
- protected abstract @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B parentField(final int parentField) {
- this.parentField = parentField;
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (("SuperBuilderAbstract.Parent.ParentBuilder(parentField=" + this.parentField) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends SuperBuilderAbstract.Parent.ParentBuilder<SuperBuilderAbstract.Parent, SuperBuilderAbstract.Parent.ParentBuilderImpl> {
- private ParentBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderAbstract.Parent.ParentBuilderImpl self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderAbstract.Parent build() {
- return new SuperBuilderAbstract.Parent(this);
- }
- }
- int parentField;
- protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderAbstract.Parent.ParentBuilder<?, ?> b) {
- super();
- this.parentField = b.parentField;
- }
- public static @java.lang.SuppressWarnings("all") SuperBuilderAbstract.Parent.ParentBuilder<?, ?> builder() {
- return new SuperBuilderAbstract.Parent.ParentBuilderImpl();
- }
- }
- public static abstract @lombok.experimental.SuperBuilder class Child extends Parent {
- public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends SuperBuilderAbstract.Child, B extends SuperBuilderAbstract.Child.ChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
- private @java.lang.SuppressWarnings("all") double childField;
- public ChildBuilder() {
- super();
- }
- protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B childField(final double childField) {
- this.childField = childField;
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderAbstract.Child.ChildBuilder(super=" + super.toString()) + ", childField=") + this.childField) + ")");
- }
- }
- double childField;
- protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderAbstract.Child.ChildBuilder<?, ?> b) {
- super(b);
- this.childField = b.childField;
- }
- }
- public static @lombok.experimental.SuperBuilder class GrandChild extends Child {
- public static abstract @java.lang.SuppressWarnings("all") class GrandChildBuilder<C extends SuperBuilderAbstract.GrandChild, B extends SuperBuilderAbstract.GrandChild.GrandChildBuilder<C, B>> extends Child.ChildBuilder<C, B> {
- private @java.lang.SuppressWarnings("all") String grandChildField;
- public GrandChildBuilder() {
- super();
- }
- protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B grandChildField(final String grandChildField) {
- this.grandChildField = grandChildField;
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderAbstract.GrandChild.GrandChildBuilder(super=" + super.toString()) + ", grandChildField=") + this.grandChildField) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class GrandChildBuilderImpl extends SuperBuilderAbstract.GrandChild.GrandChildBuilder<SuperBuilderAbstract.GrandChild, SuperBuilderAbstract.GrandChild.GrandChildBuilderImpl> {
- private GrandChildBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderAbstract.GrandChild.GrandChildBuilderImpl self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderAbstract.GrandChild build() {
- return new SuperBuilderAbstract.GrandChild(this);
- }
- }
- String grandChildField;
- protected @java.lang.SuppressWarnings("all") GrandChild(final SuperBuilderAbstract.GrandChild.GrandChildBuilder<?, ?> b) {
- super(b);
- this.grandChildField = b.grandChildField;
- }
- public static @java.lang.SuppressWarnings("all") SuperBuilderAbstract.GrandChild.GrandChildBuilder<?, ?> builder() {
- return new SuperBuilderAbstract.GrandChild.GrandChildBuilderImpl();
- }
- }
- public SuperBuilderAbstract() {
- super();
- }
- public static void test() {
- GrandChild x = GrandChild.builder().grandChildField("").parentField(5).childField(2.5).build();
- }
-}
+public class SuperBuilderAbstract {
+ public static @lombok.experimental.SuperBuilder class Parent {
+ public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<C extends SuperBuilderAbstract.Parent, B extends SuperBuilderAbstract.Parent.ParentBuilder<C, B>> {
+ private @java.lang.SuppressWarnings("all") int parentField;
+ public ParentBuilder() {
+ super();
+ }
+ protected abstract @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B parentField(final int parentField) {
+ this.parentField = parentField;
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (("SuperBuilderAbstract.Parent.ParentBuilder(parentField=" + this.parentField) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends SuperBuilderAbstract.Parent.ParentBuilder<SuperBuilderAbstract.Parent, SuperBuilderAbstract.Parent.ParentBuilderImpl> {
+ private ParentBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderAbstract.Parent.ParentBuilderImpl self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderAbstract.Parent build() {
+ return new SuperBuilderAbstract.Parent(this);
+ }
+ }
+ int parentField;
+ protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderAbstract.Parent.ParentBuilder<?, ?> b) {
+ super();
+ this.parentField = b.parentField;
+ }
+ public static @java.lang.SuppressWarnings("all") SuperBuilderAbstract.Parent.ParentBuilder<?, ?> builder() {
+ return new SuperBuilderAbstract.Parent.ParentBuilderImpl();
+ }
+ }
+ public static abstract @lombok.experimental.SuperBuilder class Child extends Parent {
+ public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends SuperBuilderAbstract.Child, B extends SuperBuilderAbstract.Child.ChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
+ private @java.lang.SuppressWarnings("all") double childField;
+ public ChildBuilder() {
+ super();
+ }
+ protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B childField(final double childField) {
+ this.childField = childField;
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderAbstract.Child.ChildBuilder(super=" + super.toString()) + ", childField=") + this.childField) + ")");
+ }
+ }
+ double childField;
+ protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderAbstract.Child.ChildBuilder<?, ?> b) {
+ super(b);
+ this.childField = b.childField;
+ }
+ }
+ public static @lombok.experimental.SuperBuilder class GrandChild extends Child {
+ public static abstract @java.lang.SuppressWarnings("all") class GrandChildBuilder<C extends SuperBuilderAbstract.GrandChild, B extends SuperBuilderAbstract.GrandChild.GrandChildBuilder<C, B>> extends Child.ChildBuilder<C, B> {
+ private @java.lang.SuppressWarnings("all") String grandChildField;
+ public GrandChildBuilder() {
+ super();
+ }
+ protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B grandChildField(final String grandChildField) {
+ this.grandChildField = grandChildField;
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderAbstract.GrandChild.GrandChildBuilder(super=" + super.toString()) + ", grandChildField=") + this.grandChildField) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class GrandChildBuilderImpl extends SuperBuilderAbstract.GrandChild.GrandChildBuilder<SuperBuilderAbstract.GrandChild, SuperBuilderAbstract.GrandChild.GrandChildBuilderImpl> {
+ private GrandChildBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderAbstract.GrandChild.GrandChildBuilderImpl self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderAbstract.GrandChild build() {
+ return new SuperBuilderAbstract.GrandChild(this);
+ }
+ }
+ String grandChildField;
+ protected @java.lang.SuppressWarnings("all") GrandChild(final SuperBuilderAbstract.GrandChild.GrandChildBuilder<?, ?> b) {
+ super(b);
+ this.grandChildField = b.grandChildField;
+ }
+ public static @java.lang.SuppressWarnings("all") SuperBuilderAbstract.GrandChild.GrandChildBuilder<?, ?> builder() {
+ return new SuperBuilderAbstract.GrandChild.GrandChildBuilderImpl();
+ }
+ }
+ public SuperBuilderAbstract() {
+ super();
+ }
+ public static void test() {
+ GrandChild x = GrandChild.builder().grandChildField("").parentField(5).childField(2.5).build();
+ }
+}
diff --git a/test/transform/resource/after-ecj/SuperBuilderAbstractToBuilder.java b/test/transform/resource/after-ecj/SuperBuilderAbstractToBuilder.java
index d1ce4fa9..2d2cd422 100644
--- a/test/transform/resource/after-ecj/SuperBuilderAbstractToBuilder.java
+++ b/test/transform/resource/after-ecj/SuperBuilderAbstractToBuilder.java
@@ -1,140 +1,140 @@
-public class SuperBuilderAbstractToBuilder {
- public static @lombok.experimental.SuperBuilder(toBuilder = true) class Parent {
- public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<C extends SuperBuilderAbstractToBuilder.Parent, B extends SuperBuilderAbstractToBuilder.Parent.ParentBuilder<C, B>> {
- private @java.lang.SuppressWarnings("all") int parentField;
- public ParentBuilder() {
- super();
- }
- protected @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
- SuperBuilderAbstractToBuilder.Parent.ParentBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
- return self();
- }
- private static @java.lang.SuppressWarnings("all") void $fillValuesFromInstanceIntoBuilder(final SuperBuilderAbstractToBuilder.Parent instance, final SuperBuilderAbstractToBuilder.Parent.ParentBuilder<?, ?> b) {
- b.parentField(instance.parentField);
- }
- protected abstract @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B parentField(final int parentField) {
- this.parentField = parentField;
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (("SuperBuilderAbstractToBuilder.Parent.ParentBuilder(parentField=" + this.parentField) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends SuperBuilderAbstractToBuilder.Parent.ParentBuilder<SuperBuilderAbstractToBuilder.Parent, SuperBuilderAbstractToBuilder.Parent.ParentBuilderImpl> {
- private ParentBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderAbstractToBuilder.Parent.ParentBuilderImpl self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderAbstractToBuilder.Parent build() {
- return new SuperBuilderAbstractToBuilder.Parent(this);
- }
- }
- int parentField;
- protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderAbstractToBuilder.Parent.ParentBuilder<?, ?> b) {
- super();
- this.parentField = b.parentField;
- }
- public @java.lang.SuppressWarnings("all") SuperBuilderAbstractToBuilder.Parent.ParentBuilder<?, ?> toBuilder() {
- return new SuperBuilderAbstractToBuilder.Parent.ParentBuilderImpl().$fillValuesFrom(this);
- }
- public static @java.lang.SuppressWarnings("all") SuperBuilderAbstractToBuilder.Parent.ParentBuilder<?, ?> builder() {
- return new SuperBuilderAbstractToBuilder.Parent.ParentBuilderImpl();
- }
- }
- public static abstract @lombok.experimental.SuperBuilder(toBuilder = true) class Child extends Parent {
- public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends SuperBuilderAbstractToBuilder.Child, B extends SuperBuilderAbstractToBuilder.Child.ChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
- private @java.lang.SuppressWarnings("all") double childField;
- public ChildBuilder() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
- super.$fillValuesFrom(instance);
- SuperBuilderAbstractToBuilder.Child.ChildBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
- return self();
- }
- private static @java.lang.SuppressWarnings("all") void $fillValuesFromInstanceIntoBuilder(final SuperBuilderAbstractToBuilder.Child instance, final SuperBuilderAbstractToBuilder.Child.ChildBuilder<?, ?> b) {
- b.childField(instance.childField);
- }
- protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B childField(final double childField) {
- this.childField = childField;
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderAbstractToBuilder.Child.ChildBuilder(super=" + super.toString()) + ", childField=") + this.childField) + ")");
- }
- }
- double childField;
- protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderAbstractToBuilder.Child.ChildBuilder<?, ?> b) {
- super(b);
- this.childField = b.childField;
- }
- }
- public static @lombok.experimental.SuperBuilder(toBuilder = true) class GrandChild extends Child {
- public static abstract @java.lang.SuppressWarnings("all") class GrandChildBuilder<C extends SuperBuilderAbstractToBuilder.GrandChild, B extends SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilder<C, B>> extends Child.ChildBuilder<C, B> {
- private @java.lang.SuppressWarnings("all") String grandChildField;
- public GrandChildBuilder() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
- super.$fillValuesFrom(instance);
- SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
- return self();
- }
- private static @java.lang.SuppressWarnings("all") void $fillValuesFromInstanceIntoBuilder(final SuperBuilderAbstractToBuilder.GrandChild instance, final SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilder<?, ?> b) {
- b.grandChildField(instance.grandChildField);
- }
- protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B grandChildField(final String grandChildField) {
- this.grandChildField = grandChildField;
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilder(super=" + super.toString()) + ", grandChildField=") + this.grandChildField) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class GrandChildBuilderImpl extends SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilder<SuperBuilderAbstractToBuilder.GrandChild, SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilderImpl> {
- private GrandChildBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilderImpl self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderAbstractToBuilder.GrandChild build() {
- return new SuperBuilderAbstractToBuilder.GrandChild(this);
- }
- }
- String grandChildField;
- protected @java.lang.SuppressWarnings("all") GrandChild(final SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilder<?, ?> b) {
- super(b);
- this.grandChildField = b.grandChildField;
- }
- public @java.lang.SuppressWarnings("all") SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilder<?, ?> toBuilder() {
- return new SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilderImpl().$fillValuesFrom(this);
- }
- public static @java.lang.SuppressWarnings("all") SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilder<?, ?> builder() {
- return new SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilderImpl();
- }
- }
- public SuperBuilderAbstractToBuilder() {
- super();
- }
- public static void test() {
- GrandChild x = GrandChild.builder().grandChildField("").parentField(5).childField(2.5).build().toBuilder().build();
- }
-}
+public class SuperBuilderAbstractToBuilder {
+ public static @lombok.experimental.SuperBuilder(toBuilder = true) class Parent {
+ public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<C extends SuperBuilderAbstractToBuilder.Parent, B extends SuperBuilderAbstractToBuilder.Parent.ParentBuilder<C, B>> {
+ private @java.lang.SuppressWarnings("all") int parentField;
+ public ParentBuilder() {
+ super();
+ }
+ protected @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
+ SuperBuilderAbstractToBuilder.Parent.ParentBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
+ return self();
+ }
+ private static @java.lang.SuppressWarnings("all") void $fillValuesFromInstanceIntoBuilder(final SuperBuilderAbstractToBuilder.Parent instance, final SuperBuilderAbstractToBuilder.Parent.ParentBuilder<?, ?> b) {
+ b.parentField(instance.parentField);
+ }
+ protected abstract @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B parentField(final int parentField) {
+ this.parentField = parentField;
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (("SuperBuilderAbstractToBuilder.Parent.ParentBuilder(parentField=" + this.parentField) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends SuperBuilderAbstractToBuilder.Parent.ParentBuilder<SuperBuilderAbstractToBuilder.Parent, SuperBuilderAbstractToBuilder.Parent.ParentBuilderImpl> {
+ private ParentBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderAbstractToBuilder.Parent.ParentBuilderImpl self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderAbstractToBuilder.Parent build() {
+ return new SuperBuilderAbstractToBuilder.Parent(this);
+ }
+ }
+ int parentField;
+ protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderAbstractToBuilder.Parent.ParentBuilder<?, ?> b) {
+ super();
+ this.parentField = b.parentField;
+ }
+ public @java.lang.SuppressWarnings("all") SuperBuilderAbstractToBuilder.Parent.ParentBuilder<?, ?> toBuilder() {
+ return new SuperBuilderAbstractToBuilder.Parent.ParentBuilderImpl().$fillValuesFrom(this);
+ }
+ public static @java.lang.SuppressWarnings("all") SuperBuilderAbstractToBuilder.Parent.ParentBuilder<?, ?> builder() {
+ return new SuperBuilderAbstractToBuilder.Parent.ParentBuilderImpl();
+ }
+ }
+ public static abstract @lombok.experimental.SuperBuilder(toBuilder = true) class Child extends Parent {
+ public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends SuperBuilderAbstractToBuilder.Child, B extends SuperBuilderAbstractToBuilder.Child.ChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
+ private @java.lang.SuppressWarnings("all") double childField;
+ public ChildBuilder() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
+ super.$fillValuesFrom(instance);
+ SuperBuilderAbstractToBuilder.Child.ChildBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
+ return self();
+ }
+ private static @java.lang.SuppressWarnings("all") void $fillValuesFromInstanceIntoBuilder(final SuperBuilderAbstractToBuilder.Child instance, final SuperBuilderAbstractToBuilder.Child.ChildBuilder<?, ?> b) {
+ b.childField(instance.childField);
+ }
+ protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B childField(final double childField) {
+ this.childField = childField;
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderAbstractToBuilder.Child.ChildBuilder(super=" + super.toString()) + ", childField=") + this.childField) + ")");
+ }
+ }
+ double childField;
+ protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderAbstractToBuilder.Child.ChildBuilder<?, ?> b) {
+ super(b);
+ this.childField = b.childField;
+ }
+ }
+ public static @lombok.experimental.SuperBuilder(toBuilder = true) class GrandChild extends Child {
+ public static abstract @java.lang.SuppressWarnings("all") class GrandChildBuilder<C extends SuperBuilderAbstractToBuilder.GrandChild, B extends SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilder<C, B>> extends Child.ChildBuilder<C, B> {
+ private @java.lang.SuppressWarnings("all") String grandChildField;
+ public GrandChildBuilder() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
+ super.$fillValuesFrom(instance);
+ SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
+ return self();
+ }
+ private static @java.lang.SuppressWarnings("all") void $fillValuesFromInstanceIntoBuilder(final SuperBuilderAbstractToBuilder.GrandChild instance, final SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilder<?, ?> b) {
+ b.grandChildField(instance.grandChildField);
+ }
+ protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B grandChildField(final String grandChildField) {
+ this.grandChildField = grandChildField;
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilder(super=" + super.toString()) + ", grandChildField=") + this.grandChildField) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class GrandChildBuilderImpl extends SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilder<SuperBuilderAbstractToBuilder.GrandChild, SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilderImpl> {
+ private GrandChildBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilderImpl self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderAbstractToBuilder.GrandChild build() {
+ return new SuperBuilderAbstractToBuilder.GrandChild(this);
+ }
+ }
+ String grandChildField;
+ protected @java.lang.SuppressWarnings("all") GrandChild(final SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilder<?, ?> b) {
+ super(b);
+ this.grandChildField = b.grandChildField;
+ }
+ public @java.lang.SuppressWarnings("all") SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilder<?, ?> toBuilder() {
+ return new SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilderImpl().$fillValuesFrom(this);
+ }
+ public static @java.lang.SuppressWarnings("all") SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilder<?, ?> builder() {
+ return new SuperBuilderAbstractToBuilder.GrandChild.GrandChildBuilderImpl();
+ }
+ }
+ public SuperBuilderAbstractToBuilder() {
+ super();
+ }
+ public static void test() {
+ GrandChild x = GrandChild.builder().grandChildField("").parentField(5).childField(2.5).build().toBuilder().build();
+ }
+}
diff --git a/test/transform/resource/after-ecj/SuperBuilderBasic.java b/test/transform/resource/after-ecj/SuperBuilderBasic.java
index b5e835d4..844206d0 100644
--- a/test/transform/resource/after-ecj/SuperBuilderBasic.java
+++ b/test/transform/resource/after-ecj/SuperBuilderBasic.java
@@ -1,122 +1,122 @@
-import java.util.List;
-public class SuperBuilderBasic {
- public static @lombok.experimental.SuperBuilder class Parent {
- public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<C extends SuperBuilderBasic.Parent, B extends SuperBuilderBasic.Parent.ParentBuilder<C, B>> {
- private @java.lang.SuppressWarnings("all") int field1;
- private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items;
- public ParentBuilder() {
- super();
- }
- protected abstract @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B field1(final int field1) {
- this.field1 = field1;
- return self();
- }
- public @java.lang.SuppressWarnings("all") B item(final String item) {
- if ((this.items == null))
- this.items = new java.util.ArrayList<String>();
- this.items.add(item);
- return self();
- }
- public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
- if ((items == null))
- {
- throw new java.lang.NullPointerException("items cannot be null");
- }
- if ((this.items == null))
- this.items = new java.util.ArrayList<String>();
- this.items.addAll(items);
- return self();
- }
- public @java.lang.SuppressWarnings("all") B clearItems() {
- if ((this.items != null))
- this.items.clear();
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderBasic.Parent.ParentBuilder(field1=" + this.field1) + ", items=") + this.items) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends SuperBuilderBasic.Parent.ParentBuilder<SuperBuilderBasic.Parent, SuperBuilderBasic.Parent.ParentBuilderImpl> {
- private ParentBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderBasic.Parent.ParentBuilderImpl self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderBasic.Parent build() {
- return new SuperBuilderBasic.Parent(this);
- }
- }
- int field1;
- @lombok.Singular List<String> items;
- protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderBasic.Parent.ParentBuilder<?, ?> b) {
- super();
- this.field1 = b.field1;
- java.util.List<String> items;
- switch (((b.items == null) ? 0 : b.items.size())) {
- case 0 :
- items = java.util.Collections.emptyList();
- break;
- case 1 :
- items = java.util.Collections.singletonList(b.items.get(0));
- break;
- default :
- items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(b.items));
- }
- this.items = items;
- }
- public static @java.lang.SuppressWarnings("all") SuperBuilderBasic.Parent.ParentBuilder<?, ?> builder() {
- return new SuperBuilderBasic.Parent.ParentBuilderImpl();
- }
- }
- public static @lombok.experimental.SuperBuilder class Child extends SuperBuilderBasic.Parent {
- public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends SuperBuilderBasic.Child, B extends SuperBuilderBasic.Child.ChildBuilder<C, B>> extends SuperBuilderBasic.Parent.ParentBuilder<C, B> {
- private @java.lang.SuppressWarnings("all") double field3;
- public ChildBuilder() {
- super();
- }
- protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B field3(final double field3) {
- this.field3 = field3;
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderBasic.Child.ChildBuilder(super=" + super.toString()) + ", field3=") + this.field3) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl extends SuperBuilderBasic.Child.ChildBuilder<SuperBuilderBasic.Child, SuperBuilderBasic.Child.ChildBuilderImpl> {
- private ChildBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderBasic.Child.ChildBuilderImpl self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderBasic.Child build() {
- return new SuperBuilderBasic.Child(this);
- }
- }
- double field3;
- protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderBasic.Child.ChildBuilder<?, ?> b) {
- super(b);
- this.field3 = b.field3;
- }
- public static @java.lang.SuppressWarnings("all") SuperBuilderBasic.Child.ChildBuilder<?, ?> builder() {
- return new SuperBuilderBasic.Child.ChildBuilderImpl();
- }
- }
- public SuperBuilderBasic() {
- super();
- }
- public static void test() {
- Child x = Child.builder().field3(0.0).field1(5).item("").build();
- }
-}
+import java.util.List;
+public class SuperBuilderBasic {
+ public static @lombok.experimental.SuperBuilder class Parent {
+ public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<C extends SuperBuilderBasic.Parent, B extends SuperBuilderBasic.Parent.ParentBuilder<C, B>> {
+ private @java.lang.SuppressWarnings("all") int field1;
+ private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items;
+ public ParentBuilder() {
+ super();
+ }
+ protected abstract @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B field1(final int field1) {
+ this.field1 = field1;
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B item(final String item) {
+ if ((this.items == null))
+ this.items = new java.util.ArrayList<String>();
+ this.items.add(item);
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
+ if ((items == null))
+ {
+ throw new java.lang.NullPointerException("items cannot be null");
+ }
+ if ((this.items == null))
+ this.items = new java.util.ArrayList<String>();
+ this.items.addAll(items);
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B clearItems() {
+ if ((this.items != null))
+ this.items.clear();
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderBasic.Parent.ParentBuilder(field1=" + this.field1) + ", items=") + this.items) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends SuperBuilderBasic.Parent.ParentBuilder<SuperBuilderBasic.Parent, SuperBuilderBasic.Parent.ParentBuilderImpl> {
+ private ParentBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderBasic.Parent.ParentBuilderImpl self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderBasic.Parent build() {
+ return new SuperBuilderBasic.Parent(this);
+ }
+ }
+ int field1;
+ @lombok.Singular List<String> items;
+ protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderBasic.Parent.ParentBuilder<?, ?> b) {
+ super();
+ this.field1 = b.field1;
+ java.util.List<String> items;
+ switch (((b.items == null) ? 0 : b.items.size())) {
+ case 0 :
+ items = java.util.Collections.emptyList();
+ break;
+ case 1 :
+ items = java.util.Collections.singletonList(b.items.get(0));
+ break;
+ default :
+ items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(b.items));
+ }
+ this.items = items;
+ }
+ public static @java.lang.SuppressWarnings("all") SuperBuilderBasic.Parent.ParentBuilder<?, ?> builder() {
+ return new SuperBuilderBasic.Parent.ParentBuilderImpl();
+ }
+ }
+ public static @lombok.experimental.SuperBuilder class Child extends SuperBuilderBasic.Parent {
+ public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends SuperBuilderBasic.Child, B extends SuperBuilderBasic.Child.ChildBuilder<C, B>> extends SuperBuilderBasic.Parent.ParentBuilder<C, B> {
+ private @java.lang.SuppressWarnings("all") double field3;
+ public ChildBuilder() {
+ super();
+ }
+ protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B field3(final double field3) {
+ this.field3 = field3;
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderBasic.Child.ChildBuilder(super=" + super.toString()) + ", field3=") + this.field3) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl extends SuperBuilderBasic.Child.ChildBuilder<SuperBuilderBasic.Child, SuperBuilderBasic.Child.ChildBuilderImpl> {
+ private ChildBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderBasic.Child.ChildBuilderImpl self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderBasic.Child build() {
+ return new SuperBuilderBasic.Child(this);
+ }
+ }
+ double field3;
+ protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderBasic.Child.ChildBuilder<?, ?> b) {
+ super(b);
+ this.field3 = b.field3;
+ }
+ public static @java.lang.SuppressWarnings("all") SuperBuilderBasic.Child.ChildBuilder<?, ?> builder() {
+ return new SuperBuilderBasic.Child.ChildBuilderImpl();
+ }
+ }
+ public SuperBuilderBasic() {
+ super();
+ }
+ public static void test() {
+ Child x = Child.builder().field3(0.0).field1(5).item("").build();
+ }
+}
diff --git a/test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java b/test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java
index f6d298e1..70b54c16 100644
--- a/test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java
+++ b/test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java
@@ -1,183 +1,183 @@
-import java.util.List;
-public class SuperBuilderBasicToBuilder {
- public static @lombok.experimental.SuperBuilder(toBuilder = true) class Parent {
- public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<C extends SuperBuilderBasicToBuilder.Parent, B extends SuperBuilderBasicToBuilder.Parent.ParentBuilder<C, B>> {
- private @java.lang.SuppressWarnings("all") int field1;
- private @java.lang.SuppressWarnings("all") int obtainViaField;
- private @java.lang.SuppressWarnings("all") int obtainViaMethod;
- private @java.lang.SuppressWarnings("all") String obtainViaStaticMethod;
- private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items;
- public ParentBuilder() {
- super();
- }
- protected @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
- SuperBuilderBasicToBuilder.Parent.ParentBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
- return self();
- }
- private static @java.lang.SuppressWarnings("all") void $fillValuesFromInstanceIntoBuilder(final SuperBuilderBasicToBuilder.Parent instance, final SuperBuilderBasicToBuilder.Parent.ParentBuilder<?, ?> b) {
- b.field1(instance.field1);
- b.obtainViaField(instance.field1);
- b.obtainViaMethod(instance.method());
- b.obtainViaStaticMethod(SuperBuilderBasicToBuilder.Parent.staticMethod(instance));
- b.items(((instance.items == null) ? java.util.Collections.emptyList() : instance.items));
- }
- protected abstract @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B field1(final int field1) {
- this.field1 = field1;
- return self();
- }
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B obtainViaField(final int obtainViaField) {
- this.obtainViaField = obtainViaField;
- return self();
- }
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B obtainViaMethod(final int obtainViaMethod) {
- this.obtainViaMethod = obtainViaMethod;
- return self();
- }
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B obtainViaStaticMethod(final String obtainViaStaticMethod) {
- this.obtainViaStaticMethod = obtainViaStaticMethod;
- return self();
- }
- public @java.lang.SuppressWarnings("all") B item(final String item) {
- if ((this.items == null))
- this.items = new java.util.ArrayList<String>();
- this.items.add(item);
- return self();
- }
- public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
- if ((items == null))
- {
- throw new java.lang.NullPointerException("items cannot be null");
- }
- if ((this.items == null))
- this.items = new java.util.ArrayList<String>();
- this.items.addAll(items);
- return self();
- }
- public @java.lang.SuppressWarnings("all") B clearItems() {
- if ((this.items != null))
- this.items.clear();
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((((((((("SuperBuilderBasicToBuilder.Parent.ParentBuilder(field1=" + this.field1) + ", obtainViaField=") + this.obtainViaField) + ", obtainViaMethod=") + this.obtainViaMethod) + ", obtainViaStaticMethod=") + this.obtainViaStaticMethod) + ", items=") + this.items) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends SuperBuilderBasicToBuilder.Parent.ParentBuilder<SuperBuilderBasicToBuilder.Parent, SuperBuilderBasicToBuilder.Parent.ParentBuilderImpl> {
- private ParentBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderBasicToBuilder.Parent.ParentBuilderImpl self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderBasicToBuilder.Parent build() {
- return new SuperBuilderBasicToBuilder.Parent(this);
- }
- }
- private int field1;
- @lombok.Builder.ObtainVia(field = "field1") int obtainViaField;
- @lombok.Builder.ObtainVia(method = "method") int obtainViaMethod;
- @lombok.Builder.ObtainVia(method = "staticMethod",isStatic = true) String obtainViaStaticMethod;
- @lombok.Singular List<String> items;
- private int method() {
- return 2;
- }
- private static String staticMethod(Parent instance) {
- return "staticMethod";
- }
- protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderBasicToBuilder.Parent.ParentBuilder<?, ?> b) {
- super();
- this.field1 = b.field1;
- this.obtainViaField = b.obtainViaField;
- this.obtainViaMethod = b.obtainViaMethod;
- this.obtainViaStaticMethod = b.obtainViaStaticMethod;
- java.util.List<String> items;
- switch (((b.items == null) ? 0 : b.items.size())) {
- case 0 :
- items = java.util.Collections.emptyList();
- break;
- case 1 :
- items = java.util.Collections.singletonList(b.items.get(0));
- break;
- default :
- items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(b.items));
- }
- this.items = items;
- }
- public @java.lang.SuppressWarnings("all") SuperBuilderBasicToBuilder.Parent.ParentBuilder<?, ?> toBuilder() {
- return new SuperBuilderBasicToBuilder.Parent.ParentBuilderImpl().$fillValuesFrom(this);
- }
- public static @java.lang.SuppressWarnings("all") SuperBuilderBasicToBuilder.Parent.ParentBuilder<?, ?> builder() {
- return new SuperBuilderBasicToBuilder.Parent.ParentBuilderImpl();
- }
- }
- public static @lombok.experimental.SuperBuilder(toBuilder = true) class Child extends Parent {
- public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends SuperBuilderBasicToBuilder.Child, B extends SuperBuilderBasicToBuilder.Child.ChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
- private @java.lang.SuppressWarnings("all") double field3;
- public ChildBuilder() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
- super.$fillValuesFrom(instance);
- SuperBuilderBasicToBuilder.Child.ChildBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
- return self();
- }
- private static @java.lang.SuppressWarnings("all") void $fillValuesFromInstanceIntoBuilder(final SuperBuilderBasicToBuilder.Child instance, final SuperBuilderBasicToBuilder.Child.ChildBuilder<?, ?> b) {
- b.field3(instance.field3);
- }
- protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B field3(final double field3) {
- this.field3 = field3;
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderBasicToBuilder.Child.ChildBuilder(super=" + super.toString()) + ", field3=") + this.field3) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl extends SuperBuilderBasicToBuilder.Child.ChildBuilder<SuperBuilderBasicToBuilder.Child, SuperBuilderBasicToBuilder.Child.ChildBuilderImpl> {
- private ChildBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderBasicToBuilder.Child.ChildBuilderImpl self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderBasicToBuilder.Child build() {
- return new SuperBuilderBasicToBuilder.Child(this);
- }
- }
- private double field3;
- protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderBasicToBuilder.Child.ChildBuilder<?, ?> b) {
- super(b);
- this.field3 = b.field3;
- }
- public @java.lang.SuppressWarnings("all") SuperBuilderBasicToBuilder.Child.ChildBuilder<?, ?> toBuilder() {
- return new SuperBuilderBasicToBuilder.Child.ChildBuilderImpl().$fillValuesFrom(this);
- }
- public static @java.lang.SuppressWarnings("all") SuperBuilderBasicToBuilder.Child.ChildBuilder<?, ?> builder() {
- return new SuperBuilderBasicToBuilder.Child.ChildBuilderImpl();
- }
- }
- public SuperBuilderBasicToBuilder() {
- super();
- }
- public static void test() {
- Child x = Child.builder().field3(0.0).field1(5).item("").build().toBuilder().build();
- }
-}
+import java.util.List;
+public class SuperBuilderBasicToBuilder {
+ public static @lombok.experimental.SuperBuilder(toBuilder = true) class Parent {
+ public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<C extends SuperBuilderBasicToBuilder.Parent, B extends SuperBuilderBasicToBuilder.Parent.ParentBuilder<C, B>> {
+ private @java.lang.SuppressWarnings("all") int field1;
+ private @java.lang.SuppressWarnings("all") int obtainViaField;
+ private @java.lang.SuppressWarnings("all") int obtainViaMethod;
+ private @java.lang.SuppressWarnings("all") String obtainViaStaticMethod;
+ private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items;
+ public ParentBuilder() {
+ super();
+ }
+ protected @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
+ SuperBuilderBasicToBuilder.Parent.ParentBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
+ return self();
+ }
+ private static @java.lang.SuppressWarnings("all") void $fillValuesFromInstanceIntoBuilder(final SuperBuilderBasicToBuilder.Parent instance, final SuperBuilderBasicToBuilder.Parent.ParentBuilder<?, ?> b) {
+ b.field1(instance.field1);
+ b.obtainViaField(instance.field1);
+ b.obtainViaMethod(instance.method());
+ b.obtainViaStaticMethod(SuperBuilderBasicToBuilder.Parent.staticMethod(instance));
+ b.items(((instance.items == null) ? java.util.Collections.emptyList() : instance.items));
+ }
+ protected abstract @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B field1(final int field1) {
+ this.field1 = field1;
+ return self();
+ }
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B obtainViaField(final int obtainViaField) {
+ this.obtainViaField = obtainViaField;
+ return self();
+ }
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B obtainViaMethod(final int obtainViaMethod) {
+ this.obtainViaMethod = obtainViaMethod;
+ return self();
+ }
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B obtainViaStaticMethod(final String obtainViaStaticMethod) {
+ this.obtainViaStaticMethod = obtainViaStaticMethod;
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B item(final String item) {
+ if ((this.items == null))
+ this.items = new java.util.ArrayList<String>();
+ this.items.add(item);
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
+ if ((items == null))
+ {
+ throw new java.lang.NullPointerException("items cannot be null");
+ }
+ if ((this.items == null))
+ this.items = new java.util.ArrayList<String>();
+ this.items.addAll(items);
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B clearItems() {
+ if ((this.items != null))
+ this.items.clear();
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((((((((("SuperBuilderBasicToBuilder.Parent.ParentBuilder(field1=" + this.field1) + ", obtainViaField=") + this.obtainViaField) + ", obtainViaMethod=") + this.obtainViaMethod) + ", obtainViaStaticMethod=") + this.obtainViaStaticMethod) + ", items=") + this.items) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends SuperBuilderBasicToBuilder.Parent.ParentBuilder<SuperBuilderBasicToBuilder.Parent, SuperBuilderBasicToBuilder.Parent.ParentBuilderImpl> {
+ private ParentBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderBasicToBuilder.Parent.ParentBuilderImpl self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderBasicToBuilder.Parent build() {
+ return new SuperBuilderBasicToBuilder.Parent(this);
+ }
+ }
+ private int field1;
+ @lombok.Builder.ObtainVia(field = "field1") int obtainViaField;
+ @lombok.Builder.ObtainVia(method = "method") int obtainViaMethod;
+ @lombok.Builder.ObtainVia(method = "staticMethod",isStatic = true) String obtainViaStaticMethod;
+ @lombok.Singular List<String> items;
+ private int method() {
+ return 2;
+ }
+ private static String staticMethod(Parent instance) {
+ return "staticMethod";
+ }
+ protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderBasicToBuilder.Parent.ParentBuilder<?, ?> b) {
+ super();
+ this.field1 = b.field1;
+ this.obtainViaField = b.obtainViaField;
+ this.obtainViaMethod = b.obtainViaMethod;
+ this.obtainViaStaticMethod = b.obtainViaStaticMethod;
+ java.util.List<String> items;
+ switch (((b.items == null) ? 0 : b.items.size())) {
+ case 0 :
+ items = java.util.Collections.emptyList();
+ break;
+ case 1 :
+ items = java.util.Collections.singletonList(b.items.get(0));
+ break;
+ default :
+ items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(b.items));
+ }
+ this.items = items;
+ }
+ public @java.lang.SuppressWarnings("all") SuperBuilderBasicToBuilder.Parent.ParentBuilder<?, ?> toBuilder() {
+ return new SuperBuilderBasicToBuilder.Parent.ParentBuilderImpl().$fillValuesFrom(this);
+ }
+ public static @java.lang.SuppressWarnings("all") SuperBuilderBasicToBuilder.Parent.ParentBuilder<?, ?> builder() {
+ return new SuperBuilderBasicToBuilder.Parent.ParentBuilderImpl();
+ }
+ }
+ public static @lombok.experimental.SuperBuilder(toBuilder = true) class Child extends Parent {
+ public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends SuperBuilderBasicToBuilder.Child, B extends SuperBuilderBasicToBuilder.Child.ChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
+ private @java.lang.SuppressWarnings("all") double field3;
+ public ChildBuilder() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
+ super.$fillValuesFrom(instance);
+ SuperBuilderBasicToBuilder.Child.ChildBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
+ return self();
+ }
+ private static @java.lang.SuppressWarnings("all") void $fillValuesFromInstanceIntoBuilder(final SuperBuilderBasicToBuilder.Child instance, final SuperBuilderBasicToBuilder.Child.ChildBuilder<?, ?> b) {
+ b.field3(instance.field3);
+ }
+ protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B field3(final double field3) {
+ this.field3 = field3;
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderBasicToBuilder.Child.ChildBuilder(super=" + super.toString()) + ", field3=") + this.field3) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl extends SuperBuilderBasicToBuilder.Child.ChildBuilder<SuperBuilderBasicToBuilder.Child, SuperBuilderBasicToBuilder.Child.ChildBuilderImpl> {
+ private ChildBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderBasicToBuilder.Child.ChildBuilderImpl self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderBasicToBuilder.Child build() {
+ return new SuperBuilderBasicToBuilder.Child(this);
+ }
+ }
+ private double field3;
+ protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderBasicToBuilder.Child.ChildBuilder<?, ?> b) {
+ super(b);
+ this.field3 = b.field3;
+ }
+ public @java.lang.SuppressWarnings("all") SuperBuilderBasicToBuilder.Child.ChildBuilder<?, ?> toBuilder() {
+ return new SuperBuilderBasicToBuilder.Child.ChildBuilderImpl().$fillValuesFrom(this);
+ }
+ public static @java.lang.SuppressWarnings("all") SuperBuilderBasicToBuilder.Child.ChildBuilder<?, ?> builder() {
+ return new SuperBuilderBasicToBuilder.Child.ChildBuilderImpl();
+ }
+ }
+ public SuperBuilderBasicToBuilder() {
+ super();
+ }
+ public static void test() {
+ Child x = Child.builder().field3(0.0).field1(5).item("").build().toBuilder().build();
+ }
+}
diff --git a/test/transform/resource/after-ecj/SuperBuilderCustomized.java b/test/transform/resource/after-ecj/SuperBuilderCustomized.java
index c9619602..1fb41367 100644
--- a/test/transform/resource/after-ecj/SuperBuilderCustomized.java
+++ b/test/transform/resource/after-ecj/SuperBuilderCustomized.java
@@ -1,91 +1,91 @@
-import java.util.List;
-public class SuperBuilderCustomized {
- public static @lombok.experimental.SuperBuilder class Parent {
- public static abstract class ParentBuilder<C extends Parent, B extends ParentBuilder<C, B>> {
- private @java.lang.SuppressWarnings("all") int field1;
- public ParentBuilder() {
- super();
- }
- public B resetToDefault() {
- field1 = 0;
- return self();
- }
- public B field1(int field1) {
- this.field1 = (field1 + 1);
- return self();
- }
- protected abstract @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.SuppressWarnings("all") C build();
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (("SuperBuilderCustomized.Parent.ParentBuilder(field1=" + this.field1) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends SuperBuilderCustomized.Parent.ParentBuilder<SuperBuilderCustomized.Parent, SuperBuilderCustomized.Parent.ParentBuilderImpl> {
- private ParentBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderCustomized.Parent.ParentBuilderImpl self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderCustomized.Parent build() {
- return new SuperBuilderCustomized.Parent(this);
- }
- }
- int field1;
- protected Parent(ParentBuilder<?, ?> b) {
- super();
- if ((b.field1 == 0))
- throw new IllegalArgumentException("field1 must be != 0");
- this.field1 = b.field1;
- }
- public static SuperBuilderCustomized.Parent.ParentBuilder<?, ?> builder(int field1) {
- return new SuperBuilderCustomized.Parent.ParentBuilderImpl().field1(field1);
- }
- }
- public static @lombok.experimental.SuperBuilder class Child extends Parent {
- private static final class ChildBuilderImpl extends ChildBuilder<Child, ChildBuilderImpl> {
- private ChildBuilderImpl() {
- super();
- }
- public @Override Child build() {
- this.resetToDefault();
- return new Child(this);
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderCustomized.Child.ChildBuilderImpl self() {
- return this;
- }
- }
- public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends SuperBuilderCustomized.Child, B extends SuperBuilderCustomized.Child.ChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
- private @java.lang.SuppressWarnings("all") double field2;
- public ChildBuilder() {
- super();
- }
- protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B field2(final double field2) {
- this.field2 = field2;
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderCustomized.Child.ChildBuilder(super=" + super.toString()) + ", field2=") + this.field2) + ")");
- }
- }
- double field2;
- public static ChildBuilder<?, ?> builder() {
- return new ChildBuilderImpl().field2(10.0);
- }
- protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderCustomized.Child.ChildBuilder<?, ?> b) {
- super(b);
- this.field2 = b.field2;
- }
- }
- public SuperBuilderCustomized() {
- super();
- }
- public static void test() {
- Child x = Child.builder().field2(1.0).field1(5).resetToDefault().build();
- }
-}
+import java.util.List;
+public class SuperBuilderCustomized {
+ public static @lombok.experimental.SuperBuilder class Parent {
+ public static abstract class ParentBuilder<C extends Parent, B extends ParentBuilder<C, B>> {
+ private @java.lang.SuppressWarnings("all") int field1;
+ public ParentBuilder() {
+ super();
+ }
+ public B resetToDefault() {
+ field1 = 0;
+ return self();
+ }
+ public B field1(int field1) {
+ this.field1 = (field1 + 1);
+ return self();
+ }
+ protected abstract @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.SuppressWarnings("all") C build();
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (("SuperBuilderCustomized.Parent.ParentBuilder(field1=" + this.field1) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends SuperBuilderCustomized.Parent.ParentBuilder<SuperBuilderCustomized.Parent, SuperBuilderCustomized.Parent.ParentBuilderImpl> {
+ private ParentBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderCustomized.Parent.ParentBuilderImpl self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderCustomized.Parent build() {
+ return new SuperBuilderCustomized.Parent(this);
+ }
+ }
+ int field1;
+ protected Parent(ParentBuilder<?, ?> b) {
+ super();
+ if ((b.field1 == 0))
+ throw new IllegalArgumentException("field1 must be != 0");
+ this.field1 = b.field1;
+ }
+ public static SuperBuilderCustomized.Parent.ParentBuilder<?, ?> builder(int field1) {
+ return new SuperBuilderCustomized.Parent.ParentBuilderImpl().field1(field1);
+ }
+ }
+ public static @lombok.experimental.SuperBuilder class Child extends Parent {
+ private static final class ChildBuilderImpl extends ChildBuilder<Child, ChildBuilderImpl> {
+ private ChildBuilderImpl() {
+ super();
+ }
+ public @Override Child build() {
+ this.resetToDefault();
+ return new Child(this);
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderCustomized.Child.ChildBuilderImpl self() {
+ return this;
+ }
+ }
+ public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends SuperBuilderCustomized.Child, B extends SuperBuilderCustomized.Child.ChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
+ private @java.lang.SuppressWarnings("all") double field2;
+ public ChildBuilder() {
+ super();
+ }
+ protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B field2(final double field2) {
+ this.field2 = field2;
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderCustomized.Child.ChildBuilder(super=" + super.toString()) + ", field2=") + this.field2) + ")");
+ }
+ }
+ double field2;
+ public static ChildBuilder<?, ?> builder() {
+ return new ChildBuilderImpl().field2(10.0);
+ }
+ protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderCustomized.Child.ChildBuilder<?, ?> b) {
+ super(b);
+ this.field2 = b.field2;
+ }
+ }
+ public SuperBuilderCustomized() {
+ super();
+ }
+ public static void test() {
+ Child x = Child.builder().field2(1.0).field1(5).resetToDefault().build();
+ }
+}
diff --git a/test/transform/resource/after-ecj/SuperBuilderCustomizedWithSetterPrefix.java b/test/transform/resource/after-ecj/SuperBuilderCustomizedWithSetterPrefix.java
index 283bacd4..142181ec 100644
--- a/test/transform/resource/after-ecj/SuperBuilderCustomizedWithSetterPrefix.java
+++ b/test/transform/resource/after-ecj/SuperBuilderCustomizedWithSetterPrefix.java
@@ -1,45 +1,45 @@
-import java.util.List;
-public class SuperBuilderCustomizedWithSetterPrefix {
- public static @lombok.experimental.SuperBuilder(setterPrefix = "set") class Parent {
- public static abstract class ParentBuilder<C extends Parent, B extends ParentBuilder<C, B>> {
- private @java.lang.SuppressWarnings("all") int field1;
- public ParentBuilder() {
- super();
- }
- public B setField1(int field1) {
- this.field1 = (field1 + 1);
- return self();
- }
- protected abstract @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.SuppressWarnings("all") C build();
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (("SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilder(field1=" + this.field1) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilder<SuperBuilderCustomizedWithSetterPrefix.Parent, SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilderImpl> {
- private ParentBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilderImpl self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderCustomizedWithSetterPrefix.Parent build() {
- return new SuperBuilderCustomizedWithSetterPrefix.Parent(this);
- }
- }
- int field1;
- protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilder<?, ?> b) {
- super();
- this.field1 = b.field1;
- }
- public static @java.lang.SuppressWarnings("all") SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilder<?, ?> builder() {
- return new SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilderImpl();
- }
- }
- public SuperBuilderCustomizedWithSetterPrefix() {
- super();
- }
- public static void test() {
- Parent x = Parent.builder().setField1(5).build();
- }
-}
+import java.util.List;
+public class SuperBuilderCustomizedWithSetterPrefix {
+ public static @lombok.experimental.SuperBuilder(setterPrefix = "set") class Parent {
+ public static abstract class ParentBuilder<C extends Parent, B extends ParentBuilder<C, B>> {
+ private @java.lang.SuppressWarnings("all") int field1;
+ public ParentBuilder() {
+ super();
+ }
+ public B setField1(int field1) {
+ this.field1 = (field1 + 1);
+ return self();
+ }
+ protected abstract @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.SuppressWarnings("all") C build();
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (("SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilder(field1=" + this.field1) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilder<SuperBuilderCustomizedWithSetterPrefix.Parent, SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilderImpl> {
+ private ParentBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilderImpl self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderCustomizedWithSetterPrefix.Parent build() {
+ return new SuperBuilderCustomizedWithSetterPrefix.Parent(this);
+ }
+ }
+ int field1;
+ protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilder<?, ?> b) {
+ super();
+ this.field1 = b.field1;
+ }
+ public static @java.lang.SuppressWarnings("all") SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilder<?, ?> builder() {
+ return new SuperBuilderCustomizedWithSetterPrefix.Parent.ParentBuilderImpl();
+ }
+ }
+ public SuperBuilderCustomizedWithSetterPrefix() {
+ super();
+ }
+ public static void test() {
+ Parent x = Parent.builder().setField1(5).build();
+ }
+}
diff --git a/test/transform/resource/after-ecj/SuperBuilderNestedGenericTypes.java b/test/transform/resource/after-ecj/SuperBuilderNestedGenericTypes.java
index e511b276..0c51d4ee 100644
--- a/test/transform/resource/after-ecj/SuperBuilderNestedGenericTypes.java
+++ b/test/transform/resource/after-ecj/SuperBuilderNestedGenericTypes.java
@@ -1,37 +1,37 @@
-public class SuperBuilderNestedGenericTypes {
- public static abstract @lombok.experimental.SuperBuilder class Generic<T extends Generic<?>> {
- public static abstract @java.lang.SuppressWarnings("all") class GenericBuilder<T extends Generic<?>, C extends SuperBuilderNestedGenericTypes.Generic<T>, B extends SuperBuilderNestedGenericTypes.Generic.GenericBuilder<T, C, B>> {
- public GenericBuilder() {
- super();
- }
- protected abstract @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.SuppressWarnings("all") C build();
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return "SuperBuilderNestedGenericTypes.Generic.GenericBuilder()";
- }
- }
- protected @java.lang.SuppressWarnings("all") Generic(final SuperBuilderNestedGenericTypes.Generic.GenericBuilder<T, ?, ?> b) {
- super();
- }
- }
- public static abstract @lombok.experimental.SuperBuilder class NestedGeneric<T extends OtherGeneric<?>> extends Generic<NestedGeneric<? extends OtherGeneric<?>>> {
- public static abstract @java.lang.SuppressWarnings("all") class NestedGenericBuilder<T extends OtherGeneric<?>, C extends SuperBuilderNestedGenericTypes.NestedGeneric<T>, B extends SuperBuilderNestedGenericTypes.NestedGeneric.NestedGenericBuilder<T, C, B>> extends Generic.GenericBuilder<NestedGeneric<? extends OtherGeneric<?>>, C, B> {
- public NestedGenericBuilder() {
- super();
- }
- protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (("SuperBuilderNestedGenericTypes.NestedGeneric.NestedGenericBuilder(super=" + super.toString()) + ")");
- }
- }
- protected @java.lang.SuppressWarnings("all") NestedGeneric(final SuperBuilderNestedGenericTypes.NestedGeneric.NestedGenericBuilder<T, ?, ?> b) {
- super(b);
- }
- }
- public interface OtherGeneric<T> {
- }
- public SuperBuilderNestedGenericTypes() {
- super();
- }
+public class SuperBuilderNestedGenericTypes {
+ public static abstract @lombok.experimental.SuperBuilder class Generic<T extends Generic<?>> {
+ public static abstract @java.lang.SuppressWarnings("all") class GenericBuilder<T extends Generic<?>, C extends SuperBuilderNestedGenericTypes.Generic<T>, B extends SuperBuilderNestedGenericTypes.Generic.GenericBuilder<T, C, B>> {
+ public GenericBuilder() {
+ super();
+ }
+ protected abstract @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.SuppressWarnings("all") C build();
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return "SuperBuilderNestedGenericTypes.Generic.GenericBuilder()";
+ }
+ }
+ protected @java.lang.SuppressWarnings("all") Generic(final SuperBuilderNestedGenericTypes.Generic.GenericBuilder<T, ?, ?> b) {
+ super();
+ }
+ }
+ public static abstract @lombok.experimental.SuperBuilder class NestedGeneric<T extends OtherGeneric<?>> extends Generic<NestedGeneric<? extends OtherGeneric<?>>> {
+ public static abstract @java.lang.SuppressWarnings("all") class NestedGenericBuilder<T extends OtherGeneric<?>, C extends SuperBuilderNestedGenericTypes.NestedGeneric<T>, B extends SuperBuilderNestedGenericTypes.NestedGeneric.NestedGenericBuilder<T, C, B>> extends Generic.GenericBuilder<NestedGeneric<? extends OtherGeneric<?>>, C, B> {
+ public NestedGenericBuilder() {
+ super();
+ }
+ protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (("SuperBuilderNestedGenericTypes.NestedGeneric.NestedGenericBuilder(super=" + super.toString()) + ")");
+ }
+ }
+ protected @java.lang.SuppressWarnings("all") NestedGeneric(final SuperBuilderNestedGenericTypes.NestedGeneric.NestedGenericBuilder<T, ?, ?> b) {
+ super(b);
+ }
+ }
+ public interface OtherGeneric<T> {
+ }
+ public SuperBuilderNestedGenericTypes() {
+ super();
+ }
} \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/SuperBuilderWithCustomBuilderMethod.java b/test/transform/resource/after-ecj/SuperBuilderWithCustomBuilderMethod.java
index 5438f576..93b78c3d 100644
--- a/test/transform/resource/after-ecj/SuperBuilderWithCustomBuilderMethod.java
+++ b/test/transform/resource/after-ecj/SuperBuilderWithCustomBuilderMethod.java
@@ -1,122 +1,122 @@
-import java.util.List;
-public class SuperBuilderWithCustomBuilderMethod {
- public static @lombok.experimental.SuperBuilder class Parent<A> {
- public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<A, C extends SuperBuilderWithCustomBuilderMethod.Parent<A>, B extends SuperBuilderWithCustomBuilderMethod.Parent.ParentBuilder<A, C, B>> {
- private @java.lang.SuppressWarnings("all") A field1;
- private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items;
- public ParentBuilder() {
- super();
- }
- protected abstract @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B field1(final A field1) {
- this.field1 = field1;
- return self();
- }
- public @java.lang.SuppressWarnings("all") B item(final String item) {
- if ((this.items == null))
- this.items = new java.util.ArrayList<String>();
- this.items.add(item);
- return self();
- }
- public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
- if ((items == null))
- {
- throw new java.lang.NullPointerException("items cannot be null");
- }
- if ((this.items == null))
- this.items = new java.util.ArrayList<String>();
- this.items.addAll(items);
- return self();
- }
- public @java.lang.SuppressWarnings("all") B clearItems() {
- if ((this.items != null))
- this.items.clear();
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderWithCustomBuilderMethod.Parent.ParentBuilder(field1=" + this.field1) + ", items=") + this.items) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl<A> extends SuperBuilderWithCustomBuilderMethod.Parent.ParentBuilder<A, SuperBuilderWithCustomBuilderMethod.Parent<A>, SuperBuilderWithCustomBuilderMethod.Parent.ParentBuilderImpl<A>> {
- private ParentBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithCustomBuilderMethod.Parent.ParentBuilderImpl<A> self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithCustomBuilderMethod.Parent<A> build() {
- return new SuperBuilderWithCustomBuilderMethod.Parent<A>(this);
- }
- }
- A field1;
- @lombok.Singular List<String> items;
- protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderWithCustomBuilderMethod.Parent.ParentBuilder<A, ?, ?> b) {
- super();
- this.field1 = b.field1;
- java.util.List<String> items;
- switch (((b.items == null) ? 0 : b.items.size())) {
- case 0 :
- items = java.util.Collections.emptyList();
- break;
- case 1 :
- items = java.util.Collections.singletonList(b.items.get(0));
- break;
- default :
- items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(b.items));
- }
- this.items = items;
- }
- public static @java.lang.SuppressWarnings("all") <A>SuperBuilderWithCustomBuilderMethod.Parent.ParentBuilder<A, ?, ?> builder() {
- return new SuperBuilderWithCustomBuilderMethod.Parent.ParentBuilderImpl<A>();
- }
- }
- public static @lombok.experimental.SuperBuilder class Child<A> extends Parent<A> {
- public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<A, C extends SuperBuilderWithCustomBuilderMethod.Child<A>, B extends SuperBuilderWithCustomBuilderMethod.Child.ChildBuilder<A, C, B>> extends Parent.ParentBuilder<A, C, B> {
- private @java.lang.SuppressWarnings("all") double field3;
- public ChildBuilder() {
- super();
- }
- protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B field3(final double field3) {
- this.field3 = field3;
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderWithCustomBuilderMethod.Child.ChildBuilder(super=" + super.toString()) + ", field3=") + this.field3) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl<A> extends SuperBuilderWithCustomBuilderMethod.Child.ChildBuilder<A, SuperBuilderWithCustomBuilderMethod.Child<A>, SuperBuilderWithCustomBuilderMethod.Child.ChildBuilderImpl<A>> {
- private ChildBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithCustomBuilderMethod.Child.ChildBuilderImpl<A> self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithCustomBuilderMethod.Child<A> build() {
- return new SuperBuilderWithCustomBuilderMethod.Child<A>(this);
- }
- }
- double field3;
- public static <A>ChildBuilder<A, ?, ?> builder() {
- return new ChildBuilderImpl<A>().item("default item");
- }
- protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderWithCustomBuilderMethod.Child.ChildBuilder<A, ?, ?> b) {
- super(b);
- this.field3 = b.field3;
- }
- }
- public SuperBuilderWithCustomBuilderMethod() {
- super();
- }
- public static void test() {
- Child<Integer> x = Child.<Integer>builder().field3(0.0).field1(5).item("").build();
- }
-}
+import java.util.List;
+public class SuperBuilderWithCustomBuilderMethod {
+ public static @lombok.experimental.SuperBuilder class Parent<A> {
+ public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<A, C extends SuperBuilderWithCustomBuilderMethod.Parent<A>, B extends SuperBuilderWithCustomBuilderMethod.Parent.ParentBuilder<A, C, B>> {
+ private @java.lang.SuppressWarnings("all") A field1;
+ private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items;
+ public ParentBuilder() {
+ super();
+ }
+ protected abstract @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B field1(final A field1) {
+ this.field1 = field1;
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B item(final String item) {
+ if ((this.items == null))
+ this.items = new java.util.ArrayList<String>();
+ this.items.add(item);
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
+ if ((items == null))
+ {
+ throw new java.lang.NullPointerException("items cannot be null");
+ }
+ if ((this.items == null))
+ this.items = new java.util.ArrayList<String>();
+ this.items.addAll(items);
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B clearItems() {
+ if ((this.items != null))
+ this.items.clear();
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderWithCustomBuilderMethod.Parent.ParentBuilder(field1=" + this.field1) + ", items=") + this.items) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl<A> extends SuperBuilderWithCustomBuilderMethod.Parent.ParentBuilder<A, SuperBuilderWithCustomBuilderMethod.Parent<A>, SuperBuilderWithCustomBuilderMethod.Parent.ParentBuilderImpl<A>> {
+ private ParentBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithCustomBuilderMethod.Parent.ParentBuilderImpl<A> self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithCustomBuilderMethod.Parent<A> build() {
+ return new SuperBuilderWithCustomBuilderMethod.Parent<A>(this);
+ }
+ }
+ A field1;
+ @lombok.Singular List<String> items;
+ protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderWithCustomBuilderMethod.Parent.ParentBuilder<A, ?, ?> b) {
+ super();
+ this.field1 = b.field1;
+ java.util.List<String> items;
+ switch (((b.items == null) ? 0 : b.items.size())) {
+ case 0 :
+ items = java.util.Collections.emptyList();
+ break;
+ case 1 :
+ items = java.util.Collections.singletonList(b.items.get(0));
+ break;
+ default :
+ items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(b.items));
+ }
+ this.items = items;
+ }
+ public static @java.lang.SuppressWarnings("all") <A>SuperBuilderWithCustomBuilderMethod.Parent.ParentBuilder<A, ?, ?> builder() {
+ return new SuperBuilderWithCustomBuilderMethod.Parent.ParentBuilderImpl<A>();
+ }
+ }
+ public static @lombok.experimental.SuperBuilder class Child<A> extends Parent<A> {
+ public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<A, C extends SuperBuilderWithCustomBuilderMethod.Child<A>, B extends SuperBuilderWithCustomBuilderMethod.Child.ChildBuilder<A, C, B>> extends Parent.ParentBuilder<A, C, B> {
+ private @java.lang.SuppressWarnings("all") double field3;
+ public ChildBuilder() {
+ super();
+ }
+ protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B field3(final double field3) {
+ this.field3 = field3;
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderWithCustomBuilderMethod.Child.ChildBuilder(super=" + super.toString()) + ", field3=") + this.field3) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl<A> extends SuperBuilderWithCustomBuilderMethod.Child.ChildBuilder<A, SuperBuilderWithCustomBuilderMethod.Child<A>, SuperBuilderWithCustomBuilderMethod.Child.ChildBuilderImpl<A>> {
+ private ChildBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithCustomBuilderMethod.Child.ChildBuilderImpl<A> self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithCustomBuilderMethod.Child<A> build() {
+ return new SuperBuilderWithCustomBuilderMethod.Child<A>(this);
+ }
+ }
+ double field3;
+ public static <A>ChildBuilder<A, ?, ?> builder() {
+ return new ChildBuilderImpl<A>().item("default item");
+ }
+ protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderWithCustomBuilderMethod.Child.ChildBuilder<A, ?, ?> b) {
+ super(b);
+ this.field3 = b.field3;
+ }
+ }
+ public SuperBuilderWithCustomBuilderMethod() {
+ super();
+ }
+ public static void test() {
+ Child<Integer> x = Child.<Integer>builder().field3(0.0).field1(5).item("").build();
+ }
+}
diff --git a/test/transform/resource/after-ecj/SuperBuilderWithDefaults.java b/test/transform/resource/after-ecj/SuperBuilderWithDefaults.java
index 72079b2f..7c5a344a 100644
--- a/test/transform/resource/after-ecj/SuperBuilderWithDefaults.java
+++ b/test/transform/resource/after-ecj/SuperBuilderWithDefaults.java
@@ -1,121 +1,121 @@
-import java.util.List;
-public class SuperBuilderWithDefaults {
- public static @lombok.experimental.SuperBuilder class Parent<N extends Number> {
- public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<N extends Number, C extends SuperBuilderWithDefaults.Parent<N>, B extends SuperBuilderWithDefaults.Parent.ParentBuilder<N, C, B>> {
- private @java.lang.SuppressWarnings("all") long millis$value;
- private @java.lang.SuppressWarnings("all") boolean millis$set;
- private @java.lang.SuppressWarnings("all") N numberField$value;
- private @java.lang.SuppressWarnings("all") boolean numberField$set;
- public ParentBuilder() {
- super();
- }
- protected abstract @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B millis(final long millis) {
- this.millis$value = millis;
- millis$set = true;
- return self();
- }
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B numberField(final N numberField) {
- this.numberField$value = numberField;
- numberField$set = true;
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderWithDefaults.Parent.ParentBuilder(millis$value=" + this.millis$value) + ", numberField$value=") + this.numberField$value) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl<N extends Number> extends SuperBuilderWithDefaults.Parent.ParentBuilder<N, SuperBuilderWithDefaults.Parent<N>, SuperBuilderWithDefaults.Parent.ParentBuilderImpl<N>> {
- private ParentBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithDefaults.Parent.ParentBuilderImpl<N> self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithDefaults.Parent<N> build() {
- return new SuperBuilderWithDefaults.Parent<N>(this);
- }
- }
- private @lombok.Builder.Default long millis;
- private @lombok.Builder.Default N numberField;
- private static @java.lang.SuppressWarnings("all") <N extends Number>long $default$millis() {
- return System.currentTimeMillis();
- }
- private static @java.lang.SuppressWarnings("all") <N extends Number>N $default$numberField() {
- return null;
- }
- protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderWithDefaults.Parent.ParentBuilder<N, ?, ?> b) {
- super();
- if (b.millis$set)
- this.millis = b.millis$value;
- else
- this.millis = SuperBuilderWithDefaults.Parent.<N>$default$millis();
- if (b.numberField$set)
- this.numberField = b.numberField$value;
- else
- this.numberField = SuperBuilderWithDefaults.Parent.<N>$default$numberField();
- }
- public static @java.lang.SuppressWarnings("all") <N extends Number>SuperBuilderWithDefaults.Parent.ParentBuilder<N, ?, ?> builder() {
- return new SuperBuilderWithDefaults.Parent.ParentBuilderImpl<N>();
- }
- }
- public static @lombok.experimental.SuperBuilder class Child extends Parent<Integer> {
- public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends SuperBuilderWithDefaults.Child, B extends SuperBuilderWithDefaults.Child.ChildBuilder<C, B>> extends Parent.ParentBuilder<Integer, C, B> {
- private @java.lang.SuppressWarnings("all") double doubleField$value;
- private @java.lang.SuppressWarnings("all") boolean doubleField$set;
- public ChildBuilder() {
- super();
- }
- protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B doubleField(final double doubleField) {
- this.doubleField$value = doubleField;
- doubleField$set = true;
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderWithDefaults.Child.ChildBuilder(super=" + super.toString()) + ", doubleField$value=") + this.doubleField$value) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl extends SuperBuilderWithDefaults.Child.ChildBuilder<SuperBuilderWithDefaults.Child, SuperBuilderWithDefaults.Child.ChildBuilderImpl> {
- private ChildBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithDefaults.Child.ChildBuilderImpl self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithDefaults.Child build() {
- return new SuperBuilderWithDefaults.Child(this);
- }
- }
- private @lombok.Builder.Default double doubleField;
- private static @java.lang.SuppressWarnings("all") double $default$doubleField() {
- return Math.PI;
- }
- protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderWithDefaults.Child.ChildBuilder<?, ?> b) {
- super(b);
- if (b.doubleField$set)
- this.doubleField = b.doubleField$value;
- else
- this.doubleField = SuperBuilderWithDefaults.Child.$default$doubleField();
- }
- public static @java.lang.SuppressWarnings("all") SuperBuilderWithDefaults.Child.ChildBuilder<?, ?> builder() {
- return new SuperBuilderWithDefaults.Child.ChildBuilderImpl();
- }
- }
- public SuperBuilderWithDefaults() {
- super();
- }
- public static void test() {
- Child x = Child.builder().doubleField(0.1).numberField(5).millis(1234567890L).build();
- }
-}
+import java.util.List;
+public class SuperBuilderWithDefaults {
+ public static @lombok.experimental.SuperBuilder class Parent<N extends Number> {
+ public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<N extends Number, C extends SuperBuilderWithDefaults.Parent<N>, B extends SuperBuilderWithDefaults.Parent.ParentBuilder<N, C, B>> {
+ private @java.lang.SuppressWarnings("all") long millis$value;
+ private @java.lang.SuppressWarnings("all") boolean millis$set;
+ private @java.lang.SuppressWarnings("all") N numberField$value;
+ private @java.lang.SuppressWarnings("all") boolean numberField$set;
+ public ParentBuilder() {
+ super();
+ }
+ protected abstract @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B millis(final long millis) {
+ this.millis$value = millis;
+ millis$set = true;
+ return self();
+ }
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B numberField(final N numberField) {
+ this.numberField$value = numberField;
+ numberField$set = true;
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderWithDefaults.Parent.ParentBuilder(millis$value=" + this.millis$value) + ", numberField$value=") + this.numberField$value) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl<N extends Number> extends SuperBuilderWithDefaults.Parent.ParentBuilder<N, SuperBuilderWithDefaults.Parent<N>, SuperBuilderWithDefaults.Parent.ParentBuilderImpl<N>> {
+ private ParentBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithDefaults.Parent.ParentBuilderImpl<N> self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithDefaults.Parent<N> build() {
+ return new SuperBuilderWithDefaults.Parent<N>(this);
+ }
+ }
+ private @lombok.Builder.Default long millis;
+ private @lombok.Builder.Default N numberField;
+ private static @java.lang.SuppressWarnings("all") <N extends Number>long $default$millis() {
+ return System.currentTimeMillis();
+ }
+ private static @java.lang.SuppressWarnings("all") <N extends Number>N $default$numberField() {
+ return null;
+ }
+ protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderWithDefaults.Parent.ParentBuilder<N, ?, ?> b) {
+ super();
+ if (b.millis$set)
+ this.millis = b.millis$value;
+ else
+ this.millis = SuperBuilderWithDefaults.Parent.<N>$default$millis();
+ if (b.numberField$set)
+ this.numberField = b.numberField$value;
+ else
+ this.numberField = SuperBuilderWithDefaults.Parent.<N>$default$numberField();
+ }
+ public static @java.lang.SuppressWarnings("all") <N extends Number>SuperBuilderWithDefaults.Parent.ParentBuilder<N, ?, ?> builder() {
+ return new SuperBuilderWithDefaults.Parent.ParentBuilderImpl<N>();
+ }
+ }
+ public static @lombok.experimental.SuperBuilder class Child extends Parent<Integer> {
+ public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends SuperBuilderWithDefaults.Child, B extends SuperBuilderWithDefaults.Child.ChildBuilder<C, B>> extends Parent.ParentBuilder<Integer, C, B> {
+ private @java.lang.SuppressWarnings("all") double doubleField$value;
+ private @java.lang.SuppressWarnings("all") boolean doubleField$set;
+ public ChildBuilder() {
+ super();
+ }
+ protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B doubleField(final double doubleField) {
+ this.doubleField$value = doubleField;
+ doubleField$set = true;
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderWithDefaults.Child.ChildBuilder(super=" + super.toString()) + ", doubleField$value=") + this.doubleField$value) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl extends SuperBuilderWithDefaults.Child.ChildBuilder<SuperBuilderWithDefaults.Child, SuperBuilderWithDefaults.Child.ChildBuilderImpl> {
+ private ChildBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithDefaults.Child.ChildBuilderImpl self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithDefaults.Child build() {
+ return new SuperBuilderWithDefaults.Child(this);
+ }
+ }
+ private @lombok.Builder.Default double doubleField;
+ private static @java.lang.SuppressWarnings("all") double $default$doubleField() {
+ return Math.PI;
+ }
+ protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderWithDefaults.Child.ChildBuilder<?, ?> b) {
+ super(b);
+ if (b.doubleField$set)
+ this.doubleField = b.doubleField$value;
+ else
+ this.doubleField = SuperBuilderWithDefaults.Child.$default$doubleField();
+ }
+ public static @java.lang.SuppressWarnings("all") SuperBuilderWithDefaults.Child.ChildBuilder<?, ?> builder() {
+ return new SuperBuilderWithDefaults.Child.ChildBuilderImpl();
+ }
+ }
+ public SuperBuilderWithDefaults() {
+ super();
+ }
+ public static void test() {
+ Child x = Child.builder().doubleField(0.1).numberField(5).millis(1234567890L).build();
+ }
+}
diff --git a/test/transform/resource/after-ecj/SuperBuilderWithGenerics.java b/test/transform/resource/after-ecj/SuperBuilderWithGenerics.java
index bc9db55f..db989687 100644
--- a/test/transform/resource/after-ecj/SuperBuilderWithGenerics.java
+++ b/test/transform/resource/after-ecj/SuperBuilderWithGenerics.java
@@ -1,122 +1,122 @@
-import java.util.List;
-public class SuperBuilderWithGenerics {
- public static @lombok.experimental.SuperBuilder class Parent<A> {
- public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<A, C extends SuperBuilderWithGenerics.Parent<A>, B extends SuperBuilderWithGenerics.Parent.ParentBuilder<A, C, B>> {
- private @java.lang.SuppressWarnings("all") A field1;
- private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items;
- public ParentBuilder() {
- super();
- }
- protected abstract @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B field1(final A field1) {
- this.field1 = field1;
- return self();
- }
- public @java.lang.SuppressWarnings("all") B item(final String item) {
- if ((this.items == null))
- this.items = new java.util.ArrayList<String>();
- this.items.add(item);
- return self();
- }
- public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
- if ((items == null))
- {
- throw new java.lang.NullPointerException("items cannot be null");
- }
- if ((this.items == null))
- this.items = new java.util.ArrayList<String>();
- this.items.addAll(items);
- return self();
- }
- public @java.lang.SuppressWarnings("all") B clearItems() {
- if ((this.items != null))
- this.items.clear();
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderWithGenerics.Parent.ParentBuilder(field1=" + this.field1) + ", items=") + this.items) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl<A> extends SuperBuilderWithGenerics.Parent.ParentBuilder<A, SuperBuilderWithGenerics.Parent<A>, SuperBuilderWithGenerics.Parent.ParentBuilderImpl<A>> {
- private ParentBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenerics.Parent.ParentBuilderImpl<A> self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenerics.Parent<A> build() {
- return new SuperBuilderWithGenerics.Parent<A>(this);
- }
- }
- A field1;
- @lombok.Singular List<String> items;
- protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderWithGenerics.Parent.ParentBuilder<A, ?, ?> b) {
- super();
- this.field1 = b.field1;
- java.util.List<String> items;
- switch (((b.items == null) ? 0 : b.items.size())) {
- case 0 :
- items = java.util.Collections.emptyList();
- break;
- case 1 :
- items = java.util.Collections.singletonList(b.items.get(0));
- break;
- default :
- items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(b.items));
- }
- this.items = items;
- }
- public static @java.lang.SuppressWarnings("all") <A>SuperBuilderWithGenerics.Parent.ParentBuilder<A, ?, ?> builder() {
- return new SuperBuilderWithGenerics.Parent.ParentBuilderImpl<A>();
- }
- }
- public static @lombok.experimental.SuperBuilder class Child<A> extends Parent<A> {
- public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<A, C extends SuperBuilderWithGenerics.Child<A>, B extends SuperBuilderWithGenerics.Child.ChildBuilder<A, C, B>> extends Parent.ParentBuilder<A, C, B> {
- private @java.lang.SuppressWarnings("all") double field3;
- public ChildBuilder() {
- super();
- }
- protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B field3(final double field3) {
- this.field3 = field3;
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderWithGenerics.Child.ChildBuilder(super=" + super.toString()) + ", field3=") + this.field3) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl<A> extends SuperBuilderWithGenerics.Child.ChildBuilder<A, SuperBuilderWithGenerics.Child<A>, SuperBuilderWithGenerics.Child.ChildBuilderImpl<A>> {
- private ChildBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenerics.Child.ChildBuilderImpl<A> self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenerics.Child<A> build() {
- return new SuperBuilderWithGenerics.Child<A>(this);
- }
- }
- double field3;
- protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderWithGenerics.Child.ChildBuilder<A, ?, ?> b) {
- super(b);
- this.field3 = b.field3;
- }
- public static @java.lang.SuppressWarnings("all") <A>SuperBuilderWithGenerics.Child.ChildBuilder<A, ?, ?> builder() {
- return new SuperBuilderWithGenerics.Child.ChildBuilderImpl<A>();
- }
- }
- public SuperBuilderWithGenerics() {
- super();
- }
- public static void test() {
- Child<Integer> x = Child.<Integer>builder().field3(0.0).field1(5).item("").build();
- }
-}
+import java.util.List;
+public class SuperBuilderWithGenerics {
+ public static @lombok.experimental.SuperBuilder class Parent<A> {
+ public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<A, C extends SuperBuilderWithGenerics.Parent<A>, B extends SuperBuilderWithGenerics.Parent.ParentBuilder<A, C, B>> {
+ private @java.lang.SuppressWarnings("all") A field1;
+ private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items;
+ public ParentBuilder() {
+ super();
+ }
+ protected abstract @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B field1(final A field1) {
+ this.field1 = field1;
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B item(final String item) {
+ if ((this.items == null))
+ this.items = new java.util.ArrayList<String>();
+ this.items.add(item);
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
+ if ((items == null))
+ {
+ throw new java.lang.NullPointerException("items cannot be null");
+ }
+ if ((this.items == null))
+ this.items = new java.util.ArrayList<String>();
+ this.items.addAll(items);
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B clearItems() {
+ if ((this.items != null))
+ this.items.clear();
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderWithGenerics.Parent.ParentBuilder(field1=" + this.field1) + ", items=") + this.items) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl<A> extends SuperBuilderWithGenerics.Parent.ParentBuilder<A, SuperBuilderWithGenerics.Parent<A>, SuperBuilderWithGenerics.Parent.ParentBuilderImpl<A>> {
+ private ParentBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenerics.Parent.ParentBuilderImpl<A> self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenerics.Parent<A> build() {
+ return new SuperBuilderWithGenerics.Parent<A>(this);
+ }
+ }
+ A field1;
+ @lombok.Singular List<String> items;
+ protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderWithGenerics.Parent.ParentBuilder<A, ?, ?> b) {
+ super();
+ this.field1 = b.field1;
+ java.util.List<String> items;
+ switch (((b.items == null) ? 0 : b.items.size())) {
+ case 0 :
+ items = java.util.Collections.emptyList();
+ break;
+ case 1 :
+ items = java.util.Collections.singletonList(b.items.get(0));
+ break;
+ default :
+ items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(b.items));
+ }
+ this.items = items;
+ }
+ public static @java.lang.SuppressWarnings("all") <A>SuperBuilderWithGenerics.Parent.ParentBuilder<A, ?, ?> builder() {
+ return new SuperBuilderWithGenerics.Parent.ParentBuilderImpl<A>();
+ }
+ }
+ public static @lombok.experimental.SuperBuilder class Child<A> extends Parent<A> {
+ public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<A, C extends SuperBuilderWithGenerics.Child<A>, B extends SuperBuilderWithGenerics.Child.ChildBuilder<A, C, B>> extends Parent.ParentBuilder<A, C, B> {
+ private @java.lang.SuppressWarnings("all") double field3;
+ public ChildBuilder() {
+ super();
+ }
+ protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B field3(final double field3) {
+ this.field3 = field3;
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderWithGenerics.Child.ChildBuilder(super=" + super.toString()) + ", field3=") + this.field3) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl<A> extends SuperBuilderWithGenerics.Child.ChildBuilder<A, SuperBuilderWithGenerics.Child<A>, SuperBuilderWithGenerics.Child.ChildBuilderImpl<A>> {
+ private ChildBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenerics.Child.ChildBuilderImpl<A> self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenerics.Child<A> build() {
+ return new SuperBuilderWithGenerics.Child<A>(this);
+ }
+ }
+ double field3;
+ protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderWithGenerics.Child.ChildBuilder<A, ?, ?> b) {
+ super(b);
+ this.field3 = b.field3;
+ }
+ public static @java.lang.SuppressWarnings("all") <A>SuperBuilderWithGenerics.Child.ChildBuilder<A, ?, ?> builder() {
+ return new SuperBuilderWithGenerics.Child.ChildBuilderImpl<A>();
+ }
+ }
+ public SuperBuilderWithGenerics() {
+ super();
+ }
+ public static void test() {
+ Child<Integer> x = Child.<Integer>builder().field3(0.0).field1(5).item("").build();
+ }
+}
diff --git a/test/transform/resource/after-ecj/SuperBuilderWithGenerics2.java b/test/transform/resource/after-ecj/SuperBuilderWithGenerics2.java
index 07d10798..96e681f4 100644
--- a/test/transform/resource/after-ecj/SuperBuilderWithGenerics2.java
+++ b/test/transform/resource/after-ecj/SuperBuilderWithGenerics2.java
@@ -1,122 +1,122 @@
-import java.util.List;
-public class SuperBuilderWithGenerics2 {
- public static @lombok.experimental.SuperBuilder class Parent<A> {
- public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<A, C extends SuperBuilderWithGenerics2.Parent<A>, B extends SuperBuilderWithGenerics2.Parent.ParentBuilder<A, C, B>> {
- private @java.lang.SuppressWarnings("all") A field1;
- private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items;
- public ParentBuilder() {
- super();
- }
- protected abstract @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B field1(final A field1) {
- this.field1 = field1;
- return self();
- }
- public @java.lang.SuppressWarnings("all") B item(final String item) {
- if ((this.items == null))
- this.items = new java.util.ArrayList<String>();
- this.items.add(item);
- return self();
- }
- public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
- if ((items == null))
- {
- throw new java.lang.NullPointerException("items cannot be null");
- }
- if ((this.items == null))
- this.items = new java.util.ArrayList<String>();
- this.items.addAll(items);
- return self();
- }
- public @java.lang.SuppressWarnings("all") B clearItems() {
- if ((this.items != null))
- this.items.clear();
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderWithGenerics2.Parent.ParentBuilder(field1=" + this.field1) + ", items=") + this.items) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl<A> extends SuperBuilderWithGenerics2.Parent.ParentBuilder<A, SuperBuilderWithGenerics2.Parent<A>, SuperBuilderWithGenerics2.Parent.ParentBuilderImpl<A>> {
- private ParentBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenerics2.Parent.ParentBuilderImpl<A> self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenerics2.Parent<A> build() {
- return new SuperBuilderWithGenerics2.Parent<A>(this);
- }
- }
- A field1;
- @lombok.Singular List<String> items;
- protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderWithGenerics2.Parent.ParentBuilder<A, ?, ?> b) {
- super();
- this.field1 = b.field1;
- java.util.List<String> items;
- switch (((b.items == null) ? 0 : b.items.size())) {
- case 0 :
- items = java.util.Collections.emptyList();
- break;
- case 1 :
- items = java.util.Collections.singletonList(b.items.get(0));
- break;
- default :
- items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(b.items));
- }
- this.items = items;
- }
- public static @java.lang.SuppressWarnings("all") <A>SuperBuilderWithGenerics2.Parent.ParentBuilder<A, ?, ?> builder() {
- return new SuperBuilderWithGenerics2.Parent.ParentBuilderImpl<A>();
- }
- }
- public static @lombok.experimental.SuperBuilder(builderMethodName = "builder2") class Child<A> extends Parent<String> {
- public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<A, C extends SuperBuilderWithGenerics2.Child<A>, B extends SuperBuilderWithGenerics2.Child.ChildBuilder<A, C, B>> extends Parent.ParentBuilder<String, C, B> {
- private @java.lang.SuppressWarnings("all") A field3;
- public ChildBuilder() {
- super();
- }
- protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B field3(final A field3) {
- this.field3 = field3;
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderWithGenerics2.Child.ChildBuilder(super=" + super.toString()) + ", field3=") + this.field3) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl<A> extends SuperBuilderWithGenerics2.Child.ChildBuilder<A, SuperBuilderWithGenerics2.Child<A>, SuperBuilderWithGenerics2.Child.ChildBuilderImpl<A>> {
- private ChildBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenerics2.Child.ChildBuilderImpl<A> self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenerics2.Child<A> build() {
- return new SuperBuilderWithGenerics2.Child<A>(this);
- }
- }
- A field3;
- protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderWithGenerics2.Child.ChildBuilder<A, ?, ?> b) {
- super(b);
- this.field3 = b.field3;
- }
- public static @java.lang.SuppressWarnings("all") <A>SuperBuilderWithGenerics2.Child.ChildBuilder<A, ?, ?> builder2() {
- return new SuperBuilderWithGenerics2.Child.ChildBuilderImpl<A>();
- }
- }
- public SuperBuilderWithGenerics2() {
- super();
- }
- public static void test() {
- Child<Integer> x = Child.<Integer>builder2().field3(1).field1("value").item("").build();
- }
-}
+import java.util.List;
+public class SuperBuilderWithGenerics2 {
+ public static @lombok.experimental.SuperBuilder class Parent<A> {
+ public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<A, C extends SuperBuilderWithGenerics2.Parent<A>, B extends SuperBuilderWithGenerics2.Parent.ParentBuilder<A, C, B>> {
+ private @java.lang.SuppressWarnings("all") A field1;
+ private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items;
+ public ParentBuilder() {
+ super();
+ }
+ protected abstract @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B field1(final A field1) {
+ this.field1 = field1;
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B item(final String item) {
+ if ((this.items == null))
+ this.items = new java.util.ArrayList<String>();
+ this.items.add(item);
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
+ if ((items == null))
+ {
+ throw new java.lang.NullPointerException("items cannot be null");
+ }
+ if ((this.items == null))
+ this.items = new java.util.ArrayList<String>();
+ this.items.addAll(items);
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B clearItems() {
+ if ((this.items != null))
+ this.items.clear();
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderWithGenerics2.Parent.ParentBuilder(field1=" + this.field1) + ", items=") + this.items) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl<A> extends SuperBuilderWithGenerics2.Parent.ParentBuilder<A, SuperBuilderWithGenerics2.Parent<A>, SuperBuilderWithGenerics2.Parent.ParentBuilderImpl<A>> {
+ private ParentBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenerics2.Parent.ParentBuilderImpl<A> self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenerics2.Parent<A> build() {
+ return new SuperBuilderWithGenerics2.Parent<A>(this);
+ }
+ }
+ A field1;
+ @lombok.Singular List<String> items;
+ protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderWithGenerics2.Parent.ParentBuilder<A, ?, ?> b) {
+ super();
+ this.field1 = b.field1;
+ java.util.List<String> items;
+ switch (((b.items == null) ? 0 : b.items.size())) {
+ case 0 :
+ items = java.util.Collections.emptyList();
+ break;
+ case 1 :
+ items = java.util.Collections.singletonList(b.items.get(0));
+ break;
+ default :
+ items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(b.items));
+ }
+ this.items = items;
+ }
+ public static @java.lang.SuppressWarnings("all") <A>SuperBuilderWithGenerics2.Parent.ParentBuilder<A, ?, ?> builder() {
+ return new SuperBuilderWithGenerics2.Parent.ParentBuilderImpl<A>();
+ }
+ }
+ public static @lombok.experimental.SuperBuilder(builderMethodName = "builder2") class Child<A> extends Parent<String> {
+ public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<A, C extends SuperBuilderWithGenerics2.Child<A>, B extends SuperBuilderWithGenerics2.Child.ChildBuilder<A, C, B>> extends Parent.ParentBuilder<String, C, B> {
+ private @java.lang.SuppressWarnings("all") A field3;
+ public ChildBuilder() {
+ super();
+ }
+ protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B field3(final A field3) {
+ this.field3 = field3;
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderWithGenerics2.Child.ChildBuilder(super=" + super.toString()) + ", field3=") + this.field3) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl<A> extends SuperBuilderWithGenerics2.Child.ChildBuilder<A, SuperBuilderWithGenerics2.Child<A>, SuperBuilderWithGenerics2.Child.ChildBuilderImpl<A>> {
+ private ChildBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenerics2.Child.ChildBuilderImpl<A> self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenerics2.Child<A> build() {
+ return new SuperBuilderWithGenerics2.Child<A>(this);
+ }
+ }
+ A field3;
+ protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderWithGenerics2.Child.ChildBuilder<A, ?, ?> b) {
+ super(b);
+ this.field3 = b.field3;
+ }
+ public static @java.lang.SuppressWarnings("all") <A>SuperBuilderWithGenerics2.Child.ChildBuilder<A, ?, ?> builder2() {
+ return new SuperBuilderWithGenerics2.Child.ChildBuilderImpl<A>();
+ }
+ }
+ public SuperBuilderWithGenerics2() {
+ super();
+ }
+ public static void test() {
+ Child<Integer> x = Child.<Integer>builder2().field3(1).field1("value").item("").build();
+ }
+}
diff --git a/test/transform/resource/after-ecj/SuperBuilderWithGenericsAndToBuilder.java b/test/transform/resource/after-ecj/SuperBuilderWithGenericsAndToBuilder.java
index c1eb42fd..be819a2f 100644
--- a/test/transform/resource/after-ecj/SuperBuilderWithGenericsAndToBuilder.java
+++ b/test/transform/resource/after-ecj/SuperBuilderWithGenericsAndToBuilder.java
@@ -1,162 +1,162 @@
-import java.util.Map;
-public class SuperBuilderWithGenericsAndToBuilder {
- public static @lombok.experimental.SuperBuilder(toBuilder = true) class Parent<A> {
- public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<A, C extends SuperBuilderWithGenericsAndToBuilder.Parent<A>, B extends SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilder<A, C, B>> {
- private @java.lang.SuppressWarnings("all") A field1;
- private @java.lang.SuppressWarnings("all") java.util.ArrayList<Integer> items$key;
- private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items$value;
- public ParentBuilder() {
- super();
- }
- protected @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
- SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
- return self();
- }
- private static @java.lang.SuppressWarnings("all") <A>void $fillValuesFromInstanceIntoBuilder(final SuperBuilderWithGenericsAndToBuilder.Parent<A> instance, final SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilder<A, ?, ?> b) {
- b.field1(instance.field1);
- b.items(((instance.items == null) ? java.util.Collections.emptyMap() : instance.items));
- }
- protected abstract @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B field1(final A field1) {
- this.field1 = field1;
- return self();
- }
- public @java.lang.SuppressWarnings("all") B item(final Integer itemKey, final String itemValue) {
- if ((this.items$key == null))
- {
- this.items$key = new java.util.ArrayList<Integer>();
- this.items$value = new java.util.ArrayList<String>();
- }
- this.items$key.add(itemKey);
- this.items$value.add(itemValue);
- return self();
- }
- public @java.lang.SuppressWarnings("all") B items(final java.util.Map<? extends Integer, ? extends String> items) {
- if ((items == null))
- {
- throw new java.lang.NullPointerException("items cannot be null");
- }
- if ((this.items$key == null))
- {
- this.items$key = new java.util.ArrayList<Integer>();
- this.items$value = new java.util.ArrayList<String>();
- }
- for (java.util.Map.Entry<? extends Integer, ? extends String> $lombokEntry : items.entrySet())
- {
- this.items$key.add($lombokEntry.getKey());
- this.items$value.add($lombokEntry.getValue());
- }
- return self();
- }
- public @java.lang.SuppressWarnings("all") B clearItems() {
- if ((this.items$key != null))
- {
- this.items$key.clear();
- this.items$value.clear();
- }
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((((("SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilder(field1=" + this.field1) + ", items$key=") + this.items$key) + ", items$value=") + this.items$value) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl<A> extends SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilder<A, SuperBuilderWithGenericsAndToBuilder.Parent<A>, SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilderImpl<A>> {
- private ParentBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilderImpl<A> self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenericsAndToBuilder.Parent<A> build() {
- return new SuperBuilderWithGenericsAndToBuilder.Parent<A>(this);
- }
- }
- A field1;
- @lombok.Singular Map<Integer, String> items;
- protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilder<A, ?, ?> b) {
- super();
- this.field1 = b.field1;
- java.util.Map<Integer, String> items;
- switch (((b.items$key == null) ? 0 : b.items$key.size())) {
- case 0 :
- items = java.util.Collections.emptyMap();
- break;
- case 1 :
- items = java.util.Collections.singletonMap(b.items$key.get(0), b.items$value.get(0));
- break;
- default :
- items = new java.util.LinkedHashMap<Integer, String>(((b.items$key.size() < 0x40000000) ? ((1 + b.items$key.size()) + ((b.items$key.size() - 3) / 3)) : java.lang.Integer.MAX_VALUE));
- for (int $i = 0;; ($i < b.items$key.size()); $i ++)
- items.put(b.items$key.get($i), b.items$value.get($i));
- items = java.util.Collections.unmodifiableMap(items);
- }
- this.items = items;
- }
- public @java.lang.SuppressWarnings("all") SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilder<A, ?, ?> toBuilder() {
- return new SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilderImpl<A>().$fillValuesFrom(this);
- }
- public static @java.lang.SuppressWarnings("all") <A>SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilder<A, ?, ?> builder() {
- return new SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilderImpl<A>();
- }
- }
- public static @lombok.experimental.SuperBuilder(toBuilder = true) class Child<A> extends Parent<A> {
- public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<A, C extends SuperBuilderWithGenericsAndToBuilder.Child<A>, B extends SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilder<A, C, B>> extends Parent.ParentBuilder<A, C, B> {
- private @java.lang.SuppressWarnings("all") double field3;
- public ChildBuilder() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
- super.$fillValuesFrom(instance);
- SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
- return self();
- }
- private static @java.lang.SuppressWarnings("all") <A>void $fillValuesFromInstanceIntoBuilder(final SuperBuilderWithGenericsAndToBuilder.Child<A> instance, final SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilder<A, ?, ?> b) {
- b.field3(instance.field3);
- }
- protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B field3(final double field3) {
- this.field3 = field3;
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilder(super=" + super.toString()) + ", field3=") + this.field3) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl<A> extends SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilder<A, SuperBuilderWithGenericsAndToBuilder.Child<A>, SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilderImpl<A>> {
- private ChildBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilderImpl<A> self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenericsAndToBuilder.Child<A> build() {
- return new SuperBuilderWithGenericsAndToBuilder.Child<A>(this);
- }
- }
- double field3;
- protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilder<A, ?, ?> b) {
- super(b);
- this.field3 = b.field3;
- }
- public @java.lang.SuppressWarnings("all") SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilder<A, ?, ?> toBuilder() {
- return new SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilderImpl<A>().$fillValuesFrom(this);
- }
- public static @java.lang.SuppressWarnings("all") <A>SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilder<A, ?, ?> builder() {
- return new SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilderImpl<A>();
- }
- }
- public SuperBuilderWithGenericsAndToBuilder() {
- super();
- }
- public static void test() {
- Child<Integer> x = Child.<Integer>builder().field3(0.0).field1(5).item(5, "").build().toBuilder().build();
- }
-}
+import java.util.Map;
+public class SuperBuilderWithGenericsAndToBuilder {
+ public static @lombok.experimental.SuperBuilder(toBuilder = true) class Parent<A> {
+ public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<A, C extends SuperBuilderWithGenericsAndToBuilder.Parent<A>, B extends SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilder<A, C, B>> {
+ private @java.lang.SuppressWarnings("all") A field1;
+ private @java.lang.SuppressWarnings("all") java.util.ArrayList<Integer> items$key;
+ private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items$value;
+ public ParentBuilder() {
+ super();
+ }
+ protected @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
+ SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
+ return self();
+ }
+ private static @java.lang.SuppressWarnings("all") <A>void $fillValuesFromInstanceIntoBuilder(final SuperBuilderWithGenericsAndToBuilder.Parent<A> instance, final SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilder<A, ?, ?> b) {
+ b.field1(instance.field1);
+ b.items(((instance.items == null) ? java.util.Collections.emptyMap() : instance.items));
+ }
+ protected abstract @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B field1(final A field1) {
+ this.field1 = field1;
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B item(final Integer itemKey, final String itemValue) {
+ if ((this.items$key == null))
+ {
+ this.items$key = new java.util.ArrayList<Integer>();
+ this.items$value = new java.util.ArrayList<String>();
+ }
+ this.items$key.add(itemKey);
+ this.items$value.add(itemValue);
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B items(final java.util.Map<? extends Integer, ? extends String> items) {
+ if ((items == null))
+ {
+ throw new java.lang.NullPointerException("items cannot be null");
+ }
+ if ((this.items$key == null))
+ {
+ this.items$key = new java.util.ArrayList<Integer>();
+ this.items$value = new java.util.ArrayList<String>();
+ }
+ for (java.util.Map.Entry<? extends Integer, ? extends String> $lombokEntry : items.entrySet())
+ {
+ this.items$key.add($lombokEntry.getKey());
+ this.items$value.add($lombokEntry.getValue());
+ }
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B clearItems() {
+ if ((this.items$key != null))
+ {
+ this.items$key.clear();
+ this.items$value.clear();
+ }
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((((("SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilder(field1=" + this.field1) + ", items$key=") + this.items$key) + ", items$value=") + this.items$value) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl<A> extends SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilder<A, SuperBuilderWithGenericsAndToBuilder.Parent<A>, SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilderImpl<A>> {
+ private ParentBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilderImpl<A> self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenericsAndToBuilder.Parent<A> build() {
+ return new SuperBuilderWithGenericsAndToBuilder.Parent<A>(this);
+ }
+ }
+ A field1;
+ @lombok.Singular Map<Integer, String> items;
+ protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilder<A, ?, ?> b) {
+ super();
+ this.field1 = b.field1;
+ java.util.Map<Integer, String> items;
+ switch (((b.items$key == null) ? 0 : b.items$key.size())) {
+ case 0 :
+ items = java.util.Collections.emptyMap();
+ break;
+ case 1 :
+ items = java.util.Collections.singletonMap(b.items$key.get(0), b.items$value.get(0));
+ break;
+ default :
+ items = new java.util.LinkedHashMap<Integer, String>(((b.items$key.size() < 0x40000000) ? ((1 + b.items$key.size()) + ((b.items$key.size() - 3) / 3)) : java.lang.Integer.MAX_VALUE));
+ for (int $i = 0;; ($i < b.items$key.size()); $i ++)
+ items.put(b.items$key.get($i), b.items$value.get($i));
+ items = java.util.Collections.unmodifiableMap(items);
+ }
+ this.items = items;
+ }
+ public @java.lang.SuppressWarnings("all") SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilder<A, ?, ?> toBuilder() {
+ return new SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilderImpl<A>().$fillValuesFrom(this);
+ }
+ public static @java.lang.SuppressWarnings("all") <A>SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilder<A, ?, ?> builder() {
+ return new SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilderImpl<A>();
+ }
+ }
+ public static @lombok.experimental.SuperBuilder(toBuilder = true) class Child<A> extends Parent<A> {
+ public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<A, C extends SuperBuilderWithGenericsAndToBuilder.Child<A>, B extends SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilder<A, C, B>> extends Parent.ParentBuilder<A, C, B> {
+ private @java.lang.SuppressWarnings("all") double field3;
+ public ChildBuilder() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
+ super.$fillValuesFrom(instance);
+ SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
+ return self();
+ }
+ private static @java.lang.SuppressWarnings("all") <A>void $fillValuesFromInstanceIntoBuilder(final SuperBuilderWithGenericsAndToBuilder.Child<A> instance, final SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilder<A, ?, ?> b) {
+ b.field3(instance.field3);
+ }
+ protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B field3(final double field3) {
+ this.field3 = field3;
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilder(super=" + super.toString()) + ", field3=") + this.field3) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl<A> extends SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilder<A, SuperBuilderWithGenericsAndToBuilder.Child<A>, SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilderImpl<A>> {
+ private ChildBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilderImpl<A> self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithGenericsAndToBuilder.Child<A> build() {
+ return new SuperBuilderWithGenericsAndToBuilder.Child<A>(this);
+ }
+ }
+ double field3;
+ protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilder<A, ?, ?> b) {
+ super(b);
+ this.field3 = b.field3;
+ }
+ public @java.lang.SuppressWarnings("all") SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilder<A, ?, ?> toBuilder() {
+ return new SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilderImpl<A>().$fillValuesFrom(this);
+ }
+ public static @java.lang.SuppressWarnings("all") <A>SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilder<A, ?, ?> builder() {
+ return new SuperBuilderWithGenericsAndToBuilder.Child.ChildBuilderImpl<A>();
+ }
+ }
+ public SuperBuilderWithGenericsAndToBuilder() {
+ super();
+ }
+ public static void test() {
+ Child<Integer> x = Child.<Integer>builder().field3(0.0).field1(5).item(5, "").build().toBuilder().build();
+ }
+}
diff --git a/test/transform/resource/after-ecj/SuperBuilderWithNonNull.java b/test/transform/resource/after-ecj/SuperBuilderWithNonNull.java
index b9c96a38..28504f29 100644
--- a/test/transform/resource/after-ecj/SuperBuilderWithNonNull.java
+++ b/test/transform/resource/after-ecj/SuperBuilderWithNonNull.java
@@ -1,111 +1,111 @@
-import java.util.List;
-public class SuperBuilderWithNonNull {
- public static @lombok.experimental.SuperBuilder class Parent {
- public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<C extends SuperBuilderWithNonNull.Parent, B extends SuperBuilderWithNonNull.Parent.ParentBuilder<C, B>> {
- private @java.lang.SuppressWarnings("all") String nonNullParentField$value;
- private @java.lang.SuppressWarnings("all") boolean nonNullParentField$set;
- public ParentBuilder() {
- super();
- }
- protected abstract @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B nonNullParentField(final @lombok.NonNull String nonNullParentField) {
- if ((nonNullParentField == null))
- {
- throw new java.lang.NullPointerException("nonNullParentField is marked non-null but is null");
- }
- this.nonNullParentField$value = nonNullParentField;
- nonNullParentField$set = true;
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (("SuperBuilderWithNonNull.Parent.ParentBuilder(nonNullParentField$value=" + this.nonNullParentField$value) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends SuperBuilderWithNonNull.Parent.ParentBuilder<SuperBuilderWithNonNull.Parent, SuperBuilderWithNonNull.Parent.ParentBuilderImpl> {
- private ParentBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithNonNull.Parent.ParentBuilderImpl self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithNonNull.Parent build() {
- return new SuperBuilderWithNonNull.Parent(this);
- }
- }
- final @lombok.NonNull @lombok.Builder.Default String nonNullParentField;
- private static @java.lang.SuppressWarnings("all") String $default$nonNullParentField() {
- return "default";
- }
- protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderWithNonNull.Parent.ParentBuilder<?, ?> b) {
- super();
- if (b.nonNullParentField$set)
- this.nonNullParentField = b.nonNullParentField$value;
- else
- this.nonNullParentField = SuperBuilderWithNonNull.Parent.$default$nonNullParentField();
- if ((nonNullParentField == null))
- {
- throw new java.lang.NullPointerException("nonNullParentField is marked non-null but is null");
- }
- }
- public static @java.lang.SuppressWarnings("all") SuperBuilderWithNonNull.Parent.ParentBuilder<?, ?> builder() {
- return new SuperBuilderWithNonNull.Parent.ParentBuilderImpl();
- }
- }
- public static @lombok.experimental.SuperBuilder class Child extends Parent {
- public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends SuperBuilderWithNonNull.Child, B extends SuperBuilderWithNonNull.Child.ChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
- private @java.lang.SuppressWarnings("all") String nonNullChildField;
- public ChildBuilder() {
- super();
- }
- protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B nonNullChildField(final @lombok.NonNull String nonNullChildField) {
- if ((nonNullChildField == null))
- {
- throw new java.lang.NullPointerException("nonNullChildField is marked non-null but is null");
- }
- this.nonNullChildField = nonNullChildField;
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderWithNonNull.Child.ChildBuilder(super=" + super.toString()) + ", nonNullChildField=") + this.nonNullChildField) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl extends SuperBuilderWithNonNull.Child.ChildBuilder<SuperBuilderWithNonNull.Child, SuperBuilderWithNonNull.Child.ChildBuilderImpl> {
- private ChildBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithNonNull.Child.ChildBuilderImpl self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithNonNull.Child build() {
- return new SuperBuilderWithNonNull.Child(this);
- }
- }
- @lombok.NonNull String nonNullChildField;
- protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderWithNonNull.Child.ChildBuilder<?, ?> b) {
- super(b);
- this.nonNullChildField = b.nonNullChildField;
- if ((nonNullChildField == null))
- {
- throw new java.lang.NullPointerException("nonNullChildField is marked non-null but is null");
- }
- }
- public static @java.lang.SuppressWarnings("all") SuperBuilderWithNonNull.Child.ChildBuilder<?, ?> builder() {
- return new SuperBuilderWithNonNull.Child.ChildBuilderImpl();
- }
- }
- public SuperBuilderWithNonNull() {
- super();
- }
- public static void test() {
- Child x = Child.builder().nonNullChildField("child").nonNullParentField("parent").build();
- }
-}
+import java.util.List;
+public class SuperBuilderWithNonNull {
+ public static @lombok.experimental.SuperBuilder class Parent {
+ public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<C extends SuperBuilderWithNonNull.Parent, B extends SuperBuilderWithNonNull.Parent.ParentBuilder<C, B>> {
+ private @java.lang.SuppressWarnings("all") String nonNullParentField$value;
+ private @java.lang.SuppressWarnings("all") boolean nonNullParentField$set;
+ public ParentBuilder() {
+ super();
+ }
+ protected abstract @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B nonNullParentField(final @lombok.NonNull String nonNullParentField) {
+ if ((nonNullParentField == null))
+ {
+ throw new java.lang.NullPointerException("nonNullParentField is marked non-null but is null");
+ }
+ this.nonNullParentField$value = nonNullParentField;
+ nonNullParentField$set = true;
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (("SuperBuilderWithNonNull.Parent.ParentBuilder(nonNullParentField$value=" + this.nonNullParentField$value) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends SuperBuilderWithNonNull.Parent.ParentBuilder<SuperBuilderWithNonNull.Parent, SuperBuilderWithNonNull.Parent.ParentBuilderImpl> {
+ private ParentBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithNonNull.Parent.ParentBuilderImpl self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithNonNull.Parent build() {
+ return new SuperBuilderWithNonNull.Parent(this);
+ }
+ }
+ final @lombok.NonNull @lombok.Builder.Default String nonNullParentField;
+ private static @java.lang.SuppressWarnings("all") String $default$nonNullParentField() {
+ return "default";
+ }
+ protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderWithNonNull.Parent.ParentBuilder<?, ?> b) {
+ super();
+ if (b.nonNullParentField$set)
+ this.nonNullParentField = b.nonNullParentField$value;
+ else
+ this.nonNullParentField = SuperBuilderWithNonNull.Parent.$default$nonNullParentField();
+ if ((nonNullParentField == null))
+ {
+ throw new java.lang.NullPointerException("nonNullParentField is marked non-null but is null");
+ }
+ }
+ public static @java.lang.SuppressWarnings("all") SuperBuilderWithNonNull.Parent.ParentBuilder<?, ?> builder() {
+ return new SuperBuilderWithNonNull.Parent.ParentBuilderImpl();
+ }
+ }
+ public static @lombok.experimental.SuperBuilder class Child extends Parent {
+ public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends SuperBuilderWithNonNull.Child, B extends SuperBuilderWithNonNull.Child.ChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
+ private @java.lang.SuppressWarnings("all") String nonNullChildField;
+ public ChildBuilder() {
+ super();
+ }
+ protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B nonNullChildField(final @lombok.NonNull String nonNullChildField) {
+ if ((nonNullChildField == null))
+ {
+ throw new java.lang.NullPointerException("nonNullChildField is marked non-null but is null");
+ }
+ this.nonNullChildField = nonNullChildField;
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderWithNonNull.Child.ChildBuilder(super=" + super.toString()) + ", nonNullChildField=") + this.nonNullChildField) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl extends SuperBuilderWithNonNull.Child.ChildBuilder<SuperBuilderWithNonNull.Child, SuperBuilderWithNonNull.Child.ChildBuilderImpl> {
+ private ChildBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithNonNull.Child.ChildBuilderImpl self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithNonNull.Child build() {
+ return new SuperBuilderWithNonNull.Child(this);
+ }
+ }
+ @lombok.NonNull String nonNullChildField;
+ protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderWithNonNull.Child.ChildBuilder<?, ?> b) {
+ super(b);
+ this.nonNullChildField = b.nonNullChildField;
+ if ((nonNullChildField == null))
+ {
+ throw new java.lang.NullPointerException("nonNullChildField is marked non-null but is null");
+ }
+ }
+ public static @java.lang.SuppressWarnings("all") SuperBuilderWithNonNull.Child.ChildBuilder<?, ?> builder() {
+ return new SuperBuilderWithNonNull.Child.ChildBuilderImpl();
+ }
+ }
+ public SuperBuilderWithNonNull() {
+ super();
+ }
+ public static void test() {
+ Child x = Child.builder().nonNullChildField("child").nonNullParentField("parent").build();
+ }
+}
diff --git a/test/transform/resource/after-ecj/SuperBuilderWithSetterPrefix.java b/test/transform/resource/after-ecj/SuperBuilderWithSetterPrefix.java
index 0edb6608..38a0a55b 100644
--- a/test/transform/resource/after-ecj/SuperBuilderWithSetterPrefix.java
+++ b/test/transform/resource/after-ecj/SuperBuilderWithSetterPrefix.java
@@ -1,183 +1,183 @@
-import java.util.List;
-public class SuperBuilderWithSetterPrefix {
- public static @lombok.experimental.SuperBuilder(toBuilder = true,setterPrefix = "with") class Parent {
- public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<C extends SuperBuilderWithSetterPrefix.Parent, B extends SuperBuilderWithSetterPrefix.Parent.ParentBuilder<C, B>> {
- private @java.lang.SuppressWarnings("all") int field1;
- private @java.lang.SuppressWarnings("all") int obtainViaField;
- private @java.lang.SuppressWarnings("all") int obtainViaMethod;
- private @java.lang.SuppressWarnings("all") String obtainViaStaticMethod;
- private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items;
- public ParentBuilder() {
- super();
- }
- protected @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
- SuperBuilderWithSetterPrefix.Parent.ParentBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
- return self();
- }
- private static @java.lang.SuppressWarnings("all") void $fillValuesFromInstanceIntoBuilder(final SuperBuilderWithSetterPrefix.Parent instance, final SuperBuilderWithSetterPrefix.Parent.ParentBuilder<?, ?> b) {
- b.withField1(instance.field1);
- b.withObtainViaField(instance.field1);
- b.withObtainViaMethod(instance.method());
- b.withObtainViaStaticMethod(SuperBuilderWithSetterPrefix.Parent.staticMethod(instance));
- b.withItems(((instance.items == null) ? java.util.Collections.emptyList() : instance.items));
- }
- protected abstract @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B withField1(final int field1) {
- this.field1 = field1;
- return self();
- }
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B withObtainViaField(final int obtainViaField) {
- this.obtainViaField = obtainViaField;
- return self();
- }
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B withObtainViaMethod(final int obtainViaMethod) {
- this.obtainViaMethod = obtainViaMethod;
- return self();
- }
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B withObtainViaStaticMethod(final String obtainViaStaticMethod) {
- this.obtainViaStaticMethod = obtainViaStaticMethod;
- return self();
- }
- public @java.lang.SuppressWarnings("all") B withItem(final String item) {
- if ((this.items == null))
- this.items = new java.util.ArrayList<String>();
- this.items.add(item);
- return self();
- }
- public @java.lang.SuppressWarnings("all") B withItems(final java.util.Collection<? extends String> items) {
- if ((items == null))
- {
- throw new java.lang.NullPointerException("items cannot be null");
- }
- if ((this.items == null))
- this.items = new java.util.ArrayList<String>();
- this.items.addAll(items);
- return self();
- }
- public @java.lang.SuppressWarnings("all") B clearItems() {
- if ((this.items != null))
- this.items.clear();
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((((((((("SuperBuilderWithSetterPrefix.Parent.ParentBuilder(field1=" + this.field1) + ", obtainViaField=") + this.obtainViaField) + ", obtainViaMethod=") + this.obtainViaMethod) + ", obtainViaStaticMethod=") + this.obtainViaStaticMethod) + ", items=") + this.items) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends SuperBuilderWithSetterPrefix.Parent.ParentBuilder<SuperBuilderWithSetterPrefix.Parent, SuperBuilderWithSetterPrefix.Parent.ParentBuilderImpl> {
- private ParentBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithSetterPrefix.Parent.ParentBuilderImpl self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithSetterPrefix.Parent build() {
- return new SuperBuilderWithSetterPrefix.Parent(this);
- }
- }
- private int field1;
- @lombok.Builder.ObtainVia(field = "field1") int obtainViaField;
- @lombok.Builder.ObtainVia(method = "method") int obtainViaMethod;
- @lombok.Builder.ObtainVia(method = "staticMethod",isStatic = true) String obtainViaStaticMethod;
- @lombok.Singular List<String> items;
- private int method() {
- return 2;
- }
- private static String staticMethod(Parent instance) {
- return "staticMethod";
- }
- protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderWithSetterPrefix.Parent.ParentBuilder<?, ?> b) {
- super();
- this.field1 = b.field1;
- this.obtainViaField = b.obtainViaField;
- this.obtainViaMethod = b.obtainViaMethod;
- this.obtainViaStaticMethod = b.obtainViaStaticMethod;
- java.util.List<String> items;
- switch (((b.items == null) ? 0 : b.items.size())) {
- case 0 :
- items = java.util.Collections.emptyList();
- break;
- case 1 :
- items = java.util.Collections.singletonList(b.items.get(0));
- break;
- default :
- items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(b.items));
- }
- this.items = items;
- }
- public @java.lang.SuppressWarnings("all") SuperBuilderWithSetterPrefix.Parent.ParentBuilder<?, ?> toBuilder() {
- return new SuperBuilderWithSetterPrefix.Parent.ParentBuilderImpl().$fillValuesFrom(this);
- }
- public static @java.lang.SuppressWarnings("all") SuperBuilderWithSetterPrefix.Parent.ParentBuilder<?, ?> builder() {
- return new SuperBuilderWithSetterPrefix.Parent.ParentBuilderImpl();
- }
- }
- public static @lombok.experimental.SuperBuilder(toBuilder = true,setterPrefix = "set") class Child extends Parent {
- public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends SuperBuilderWithSetterPrefix.Child, B extends SuperBuilderWithSetterPrefix.Child.ChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
- private @java.lang.SuppressWarnings("all") double field3;
- public ChildBuilder() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
- super.$fillValuesFrom(instance);
- SuperBuilderWithSetterPrefix.Child.ChildBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
- return self();
- }
- private static @java.lang.SuppressWarnings("all") void $fillValuesFromInstanceIntoBuilder(final SuperBuilderWithSetterPrefix.Child instance, final SuperBuilderWithSetterPrefix.Child.ChildBuilder<?, ?> b) {
- b.setField3(instance.field3);
- }
- protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
- public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
- /**
- * @return {@code this}.
- */
- public @java.lang.SuppressWarnings("all") B setField3(final double field3) {
- this.field3 = field3;
- return self();
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return (((("SuperBuilderWithSetterPrefix.Child.ChildBuilder(super=" + super.toString()) + ", field3=") + this.field3) + ")");
- }
- }
- private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl extends SuperBuilderWithSetterPrefix.Child.ChildBuilder<SuperBuilderWithSetterPrefix.Child, SuperBuilderWithSetterPrefix.Child.ChildBuilderImpl> {
- private ChildBuilderImpl() {
- super();
- }
- protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithSetterPrefix.Child.ChildBuilderImpl self() {
- return this;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithSetterPrefix.Child build() {
- return new SuperBuilderWithSetterPrefix.Child(this);
- }
- }
- private double field3;
- protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderWithSetterPrefix.Child.ChildBuilder<?, ?> b) {
- super(b);
- this.field3 = b.field3;
- }
- public @java.lang.SuppressWarnings("all") SuperBuilderWithSetterPrefix.Child.ChildBuilder<?, ?> toBuilder() {
- return new SuperBuilderWithSetterPrefix.Child.ChildBuilderImpl().$fillValuesFrom(this);
- }
- public static @java.lang.SuppressWarnings("all") SuperBuilderWithSetterPrefix.Child.ChildBuilder<?, ?> builder() {
- return new SuperBuilderWithSetterPrefix.Child.ChildBuilderImpl();
- }
- }
- public SuperBuilderWithSetterPrefix() {
- super();
- }
- public static void test() {
- Child x = Child.builder().setField3(0.0).withField1(5).withItem("").build().toBuilder().build();
- }
-}
+import java.util.List;
+public class SuperBuilderWithSetterPrefix {
+ public static @lombok.experimental.SuperBuilder(toBuilder = true,setterPrefix = "with") class Parent {
+ public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<C extends SuperBuilderWithSetterPrefix.Parent, B extends SuperBuilderWithSetterPrefix.Parent.ParentBuilder<C, B>> {
+ private @java.lang.SuppressWarnings("all") int field1;
+ private @java.lang.SuppressWarnings("all") int obtainViaField;
+ private @java.lang.SuppressWarnings("all") int obtainViaMethod;
+ private @java.lang.SuppressWarnings("all") String obtainViaStaticMethod;
+ private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items;
+ public ParentBuilder() {
+ super();
+ }
+ protected @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
+ SuperBuilderWithSetterPrefix.Parent.ParentBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
+ return self();
+ }
+ private static @java.lang.SuppressWarnings("all") void $fillValuesFromInstanceIntoBuilder(final SuperBuilderWithSetterPrefix.Parent instance, final SuperBuilderWithSetterPrefix.Parent.ParentBuilder<?, ?> b) {
+ b.withField1(instance.field1);
+ b.withObtainViaField(instance.field1);
+ b.withObtainViaMethod(instance.method());
+ b.withObtainViaStaticMethod(SuperBuilderWithSetterPrefix.Parent.staticMethod(instance));
+ b.withItems(((instance.items == null) ? java.util.Collections.emptyList() : instance.items));
+ }
+ protected abstract @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B withField1(final int field1) {
+ this.field1 = field1;
+ return self();
+ }
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B withObtainViaField(final int obtainViaField) {
+ this.obtainViaField = obtainViaField;
+ return self();
+ }
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B withObtainViaMethod(final int obtainViaMethod) {
+ this.obtainViaMethod = obtainViaMethod;
+ return self();
+ }
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B withObtainViaStaticMethod(final String obtainViaStaticMethod) {
+ this.obtainViaStaticMethod = obtainViaStaticMethod;
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B withItem(final String item) {
+ if ((this.items == null))
+ this.items = new java.util.ArrayList<String>();
+ this.items.add(item);
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B withItems(final java.util.Collection<? extends String> items) {
+ if ((items == null))
+ {
+ throw new java.lang.NullPointerException("items cannot be null");
+ }
+ if ((this.items == null))
+ this.items = new java.util.ArrayList<String>();
+ this.items.addAll(items);
+ return self();
+ }
+ public @java.lang.SuppressWarnings("all") B clearItems() {
+ if ((this.items != null))
+ this.items.clear();
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((((((((("SuperBuilderWithSetterPrefix.Parent.ParentBuilder(field1=" + this.field1) + ", obtainViaField=") + this.obtainViaField) + ", obtainViaMethod=") + this.obtainViaMethod) + ", obtainViaStaticMethod=") + this.obtainViaStaticMethod) + ", items=") + this.items) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends SuperBuilderWithSetterPrefix.Parent.ParentBuilder<SuperBuilderWithSetterPrefix.Parent, SuperBuilderWithSetterPrefix.Parent.ParentBuilderImpl> {
+ private ParentBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithSetterPrefix.Parent.ParentBuilderImpl self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithSetterPrefix.Parent build() {
+ return new SuperBuilderWithSetterPrefix.Parent(this);
+ }
+ }
+ private int field1;
+ @lombok.Builder.ObtainVia(field = "field1") int obtainViaField;
+ @lombok.Builder.ObtainVia(method = "method") int obtainViaMethod;
+ @lombok.Builder.ObtainVia(method = "staticMethod",isStatic = true) String obtainViaStaticMethod;
+ @lombok.Singular List<String> items;
+ private int method() {
+ return 2;
+ }
+ private static String staticMethod(Parent instance) {
+ return "staticMethod";
+ }
+ protected @java.lang.SuppressWarnings("all") Parent(final SuperBuilderWithSetterPrefix.Parent.ParentBuilder<?, ?> b) {
+ super();
+ this.field1 = b.field1;
+ this.obtainViaField = b.obtainViaField;
+ this.obtainViaMethod = b.obtainViaMethod;
+ this.obtainViaStaticMethod = b.obtainViaStaticMethod;
+ java.util.List<String> items;
+ switch (((b.items == null) ? 0 : b.items.size())) {
+ case 0 :
+ items = java.util.Collections.emptyList();
+ break;
+ case 1 :
+ items = java.util.Collections.singletonList(b.items.get(0));
+ break;
+ default :
+ items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(b.items));
+ }
+ this.items = items;
+ }
+ public @java.lang.SuppressWarnings("all") SuperBuilderWithSetterPrefix.Parent.ParentBuilder<?, ?> toBuilder() {
+ return new SuperBuilderWithSetterPrefix.Parent.ParentBuilderImpl().$fillValuesFrom(this);
+ }
+ public static @java.lang.SuppressWarnings("all") SuperBuilderWithSetterPrefix.Parent.ParentBuilder<?, ?> builder() {
+ return new SuperBuilderWithSetterPrefix.Parent.ParentBuilderImpl();
+ }
+ }
+ public static @lombok.experimental.SuperBuilder(toBuilder = true,setterPrefix = "set") class Child extends Parent {
+ public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends SuperBuilderWithSetterPrefix.Child, B extends SuperBuilderWithSetterPrefix.Child.ChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> {
+ private @java.lang.SuppressWarnings("all") double field3;
+ public ChildBuilder() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
+ super.$fillValuesFrom(instance);
+ SuperBuilderWithSetterPrefix.Child.ChildBuilder.$fillValuesFromInstanceIntoBuilder(instance, this);
+ return self();
+ }
+ private static @java.lang.SuppressWarnings("all") void $fillValuesFromInstanceIntoBuilder(final SuperBuilderWithSetterPrefix.Child instance, final SuperBuilderWithSetterPrefix.Child.ChildBuilder<?, ?> b) {
+ b.setField3(instance.field3);
+ }
+ protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.Override @java.lang.SuppressWarnings("all") C build();
+ /**
+ * @return {@code this}.
+ */
+ public @java.lang.SuppressWarnings("all") B setField3(final double field3) {
+ this.field3 = field3;
+ return self();
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((("SuperBuilderWithSetterPrefix.Child.ChildBuilder(super=" + super.toString()) + ", field3=") + this.field3) + ")");
+ }
+ }
+ private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl extends SuperBuilderWithSetterPrefix.Child.ChildBuilder<SuperBuilderWithSetterPrefix.Child, SuperBuilderWithSetterPrefix.Child.ChildBuilderImpl> {
+ private ChildBuilderImpl() {
+ super();
+ }
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithSetterPrefix.Child.ChildBuilderImpl self() {
+ return this;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderWithSetterPrefix.Child build() {
+ return new SuperBuilderWithSetterPrefix.Child(this);
+ }
+ }
+ private double field3;
+ protected @java.lang.SuppressWarnings("all") Child(final SuperBuilderWithSetterPrefix.Child.ChildBuilder<?, ?> b) {
+ super(b);
+ this.field3 = b.field3;
+ }
+ public @java.lang.SuppressWarnings("all") SuperBuilderWithSetterPrefix.Child.ChildBuilder<?, ?> toBuilder() {
+ return new SuperBuilderWithSetterPrefix.Child.ChildBuilderImpl().$fillValuesFrom(this);
+ }
+ public static @java.lang.SuppressWarnings("all") SuperBuilderWithSetterPrefix.Child.ChildBuilder<?, ?> builder() {
+ return new SuperBuilderWithSetterPrefix.Child.ChildBuilderImpl();
+ }
+ }
+ public SuperBuilderWithSetterPrefix() {
+ super();
+ }
+ public static void test() {
+ Child x = Child.builder().setField3(0.0).withField1(5).withItem("").build().toBuilder().build();
+ }
+}
diff --git a/test/transform/resource/after-ecj/ValueCallSuper.java b/test/transform/resource/after-ecj/ValueCallSuper.java
index 2fef08ab..72422a4a 100644
--- a/test/transform/resource/after-ecj/ValueCallSuper.java
+++ b/test/transform/resource/after-ecj/ValueCallSuper.java
@@ -1,32 +1,32 @@
-class ValueParent {
- ValueParent() {
- super();
- }
-}
-final @lombok.Value class ValueCallSuper extends ValueParent {
- public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
- if ((o == this))
- return true;
- if ((! (o instanceof ValueCallSuper)))
- return false;
- final ValueCallSuper other = (ValueCallSuper) o;
- if ((! other.canEqual((java.lang.Object) this)))
- return false;
- if ((! super.equals(o)))
- return false;
- return true;
- }
- protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
- return (other instanceof ValueCallSuper);
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
- final int result = super.hashCode();
- return result;
- }
- public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
- return "ValueCallSuper()";
- }
- public @java.lang.SuppressWarnings("all") ValueCallSuper() {
- super();
- }
-}
+class ValueParent {
+ ValueParent() {
+ super();
+ }
+}
+final @lombok.Value class ValueCallSuper extends ValueParent {
+ public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
+ if ((o == this))
+ return true;
+ if ((! (o instanceof ValueCallSuper)))
+ return false;
+ final ValueCallSuper other = (ValueCallSuper) o;
+ if ((! other.canEqual((java.lang.Object) this)))
+ return false;
+ if ((! super.equals(o)))
+ return false;
+ return true;
+ }
+ protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
+ return (other instanceof ValueCallSuper);
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
+ final int result = super.hashCode();
+ return result;
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return "ValueCallSuper()";
+ }
+ public @java.lang.SuppressWarnings("all") ValueCallSuper() {
+ super();
+ }
+}