aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-ecj
diff options
context:
space:
mode:
authorJan Rieke <it@janrieke.de>2018-09-11 21:39:10 +0200
committerJan Rieke <it@janrieke.de>2018-09-11 21:39:10 +0200
commitddd42acb599d45c432a200313a0f403a8a2a3928 (patch)
tree1fbf00d54ca787d91e169046a1888e7028e19d45 /test/transform/resource/after-ecj
parenta2b884c71194c780d37ccbd84561abd6a0f63741 (diff)
downloadlombok-ddd42acb599d45c432a200313a0f403a8a2a3928.tar.gz
lombok-ddd42acb599d45c432a200313a0f403a8a2a3928.tar.bz2
lombok-ddd42acb599d45c432a200313a0f403a8a2a3928.zip
adjusted toBuilder tests to cover private variables (impl not yet done)
Diffstat (limited to 'test/transform/resource/after-ecj')
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java24
1 files changed, 15 insertions, 9 deletions
diff --git a/test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java b/test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java
index 974d933d..6ff2849d 100644
--- a/test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java
+++ b/test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java
@@ -11,11 +11,7 @@ public class SuperBuilderBasicToBuilder {
super();
}
protected @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
- field1(instance.field1);
- obtainViaField(instance.field1);
- obtainViaMethod(instance.method());
- obtainViaStaticMethod(Parent.staticMethod(instance));
- items(((instance.items == null) ? java.util.Collections.emptyList() : instance.items));
+ ParentBuilderImpl.$fillValuesFromInto(instance, this);
return self();
}
protected abstract @java.lang.SuppressWarnings("all") B self();
@@ -61,6 +57,13 @@ public class SuperBuilderBasicToBuilder {
private ParentBuilderImpl() {
super();
}
+ private static @java.lang.SuppressWarnings("all") void $fillValuesFromInto(Parent instance, ParentBuilder<?,?> b) {
+ b.field1(instance.field1);
+ b.obtainViaField(instance.field1);
+ b.obtainViaMethod(instance.method());
+ b.obtainViaStaticMethod(Parent.staticMethod(instance));
+ b.items(((instance.items == null) ? java.util.Collections.emptyList() : instance.items));
+ }
protected @java.lang.Override @java.lang.SuppressWarnings("all") ParentBuilderImpl self() {
return this;
}
@@ -68,12 +71,12 @@ public class SuperBuilderBasicToBuilder {
return new Parent(this);
}
}
- int field1;
+ 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;
- int method() {
+ private int method() {
return 2;
}
private static String staticMethod(Parent instance) {
@@ -113,7 +116,7 @@ public class SuperBuilderBasicToBuilder {
}
protected @java.lang.Override @java.lang.SuppressWarnings("all") B $fillValuesFrom(final C instance) {
super.$fillValuesFrom(instance);
- field3(instance.field3);
+ ChildBuilderImpl.$fillValuesFromInto(instance, this);
return self();
}
protected abstract @java.lang.Override @java.lang.SuppressWarnings("all") B self();
@@ -130,6 +133,9 @@ public class SuperBuilderBasicToBuilder {
private ChildBuilderImpl() {
super();
}
+ private static @java.lang.SuppressWarnings("all") void $fillValuesFromInto(Child instance, ChildBuilder<?,?> b) {
+ b.field3(instance.field3);
+ }
protected @java.lang.Override @java.lang.SuppressWarnings("all") ChildBuilderImpl self() {
return this;
}
@@ -137,7 +143,7 @@ public class SuperBuilderBasicToBuilder {
return new Child(this);
}
}
- double field3;
+ private double field3;
protected @java.lang.SuppressWarnings("all") Child(final ChildBuilder<?, ?> b) {
super(b);
this.field3 = b.field3;