aboutsummaryrefslogtreecommitdiff
path: root/test/transform
diff options
context:
space:
mode:
authorJan Rieke <rieke@subshell.com>2018-05-11 14:41:38 +0200
committerJan Rieke <rieke@subshell.com>2018-05-11 14:41:38 +0200
commitee51d77dd664ec13d3d3748798bfc74531594171 (patch)
tree8f2b171b6babfceece20b375599072b72937dfa4 /test/transform
parente12a956c2579ae6d38ef9850fb29f3f720ddac47 (diff)
downloadlombok-ee51d77dd664ec13d3d3748798bfc74531594171.tar.gz
lombok-ee51d77dd664ec13d3d3748798bfc74531594171.tar.bz2
lombok-ee51d77dd664ec13d3d3748798bfc74531594171.zip
ecj: type params for constructor, abstract builder class, self method
Diffstat (limited to 'test/transform')
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderBasic.java100
1 files changed, 32 insertions, 68 deletions
diff --git a/test/transform/resource/after-ecj/SuperBuilderBasic.java b/test/transform/resource/after-ecj/SuperBuilderBasic.java
index cc86e05c..cecf82f7 100644
--- a/test/transform/resource/after-ecj/SuperBuilderBasic.java
+++ b/test/transform/resource/after-ecj/SuperBuilderBasic.java
@@ -1,99 +1,63 @@
import java.util.List;
-
public class SuperBuilderBasic {
public static @lombok.experimental.SuperBuilder class Parent {
- int field1;
- @lombok.Singular List<String> items;
-
- protected Parent(final ParentBuilder<?, ?> b) {
- 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;
- }
-
-
- @java.lang.SuppressWarnings("all")
- public static abstract class ParentBuilder<C extends Parent, B extends ParentBuilder<C, B>> {
- @java.lang.SuppressWarnings("all")
- private int field1;
- @java.lang.SuppressWarnings("all")
- private java.util.ArrayList<String> items;
-
- @java.lang.SuppressWarnings("all")
- protected abstract B self();
-
- @java.lang.SuppressWarnings("all")
- public abstract C build();
-
- @java.lang.SuppressWarnings("all")
- public B field1(final int field1) {
+ public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<C extends Parent, B extends ParentBuilder<C, B>> {
+ private @java.lang.SuppressWarnings("all") int field1;
+ private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> items;
+ protected abstract @java.lang.SuppressWarnings("all") B self();
+ public abstract @java.lang.SuppressWarnings("all") C build();
+ public @java.lang.SuppressWarnings("all") B field1(final int field1) {
this.field1 = field1;
return self();
}
-
- @java.lang.SuppressWarnings("all")
- public B item(final String item) {
+ 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();
}
-
- @java.lang.SuppressWarnings("all")
- public B items(final java.util.Collection<? extends String> items) {
+ public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
if (this.items == null) this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
return self();
}
-
- @java.lang.SuppressWarnings("all")
- public B clearItems() {
+ public @java.lang.SuppressWarnings("all") B clearItems() {
if (this.items != null) this.items.clear();
return self();
}
-
- @java.lang.Override
- @java.lang.SuppressWarnings("all")
- public java.lang.String toString() {
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
return "SuperBuilderBasic.Parent.ParentBuilder(field1=" + this.field1 + ", items=" + this.items + ")";
}
}
-
-
- @java.lang.SuppressWarnings("all")
- private static final class ParentBuilderImpl extends ParentBuilder<Parent, ParentBuilderImpl> {
- @java.lang.SuppressWarnings("all")
- private ParentBuilderImpl() {
+ private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends ParentBuilder<Parent, ParentBuilderImpl> {
+ private @java.lang.SuppressWarnings("all") ParentBuilderImpl() {
}
-
- @java.lang.Override
- @java.lang.SuppressWarnings("all")
- protected ParentBuilderImpl self() {
+ protected @java.lang.Override @java.lang.SuppressWarnings("all") ParentBuilderImpl self() {
return this;
}
-
- @java.lang.Override
- @java.lang.SuppressWarnings("all")
- public Parent build() {
+ public @java.lang.Override @java.lang.SuppressWarnings("all") Parent build() {
return new Parent(this);
}
}
-
- @java.lang.SuppressWarnings("all")
- public static ParentBuilder<?, ?> builder() {
+ public @java.lang.SuppressWarnings("all") static ParentBuilder<?, ?> builder() {
return new ParentBuilderImpl();
}
+ int field1;
+ @lombok.Singular List<String> items;
+ protected @java.lang.SuppressWarnings("all") Parent(final ParentBuilder<?, ?> b) {
+ 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 @lombok.experimental.SuperBuilder class Child extends Parent {