From b2f44c326430fd2e46e2830af7bbaa010f571a44 Mon Sep 17 00:00:00 2001 From: Jan Rieke Date: Wed, 30 May 2018 13:10:34 +0200 Subject: ecj: type parameters for methods and constructor param --- .../after-ecj/SuperBuilderWithGenerics.java | 48 +++++++++++----------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'test/transform') diff --git a/test/transform/resource/after-ecj/SuperBuilderWithGenerics.java b/test/transform/resource/after-ecj/SuperBuilderWithGenerics.java index 0ec8efe5..cb717bcf 100644 --- a/test/transform/resource/after-ecj/SuperBuilderWithGenerics.java +++ b/test/transform/resource/after-ecj/SuperBuilderWithGenerics.java @@ -46,43 +46,37 @@ public class SuperBuilderWithGenerics { protected @java.lang.SuppressWarnings("all") Parent(final ParentBuilder b) { this.field1 = b.field1; java.util.List 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(b.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(b.items)); } this.items = items; } - public static @java.lang.SuppressWarnings("all") ParentBuilder builder() { + public static @java.lang.SuppressWarnings("all") ParentBuilder builder() { return new ParentBuilderImpl(); } } - @lombok.experimental.SuperBuilder - public static class Child extends Parent { - double field3; - protected @java.lang.SuppressWarnings("all") Child(final ChildBuilder b) { - super(b); - this.field3 = b.field3; - } - public static abstract class ChildBuilder, B extends ChildBuilder> extends Parent.ParentBuilder { + public static @lombok.experimental.SuperBuilder class Child extends Parent { + public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder, B extends ChildBuilder> extends Parent.ParentBuilder { private @java.lang.SuppressWarnings("all") double field3; - protected @java.lang.Override @java.lang.SuppressWarnings("all") abstract B self(); - public @java.lang.Override @java.lang.SuppressWarnings("all") abstract C build(); + 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.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 + ")"; + return (((("SuperBuilderWithGenerics.Child.ChildBuilder(super=" + super.toString()) + ", field3=") + this.field3) + ")"); } } private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl extends ChildBuilder, ChildBuilderImpl> { - private ChildBuilderImpl() { + private @java.lang.SuppressWarnings("all") ChildBuilderImpl() { } protected @java.lang.Override @java.lang.SuppressWarnings("all") ChildBuilderImpl self() { return this; @@ -91,10 +85,18 @@ public class SuperBuilderWithGenerics { return new Child(this); } } - public static @java.lang.SuppressWarnings("all") ChildBuilder builder() { + double field3; + protected @java.lang.SuppressWarnings("all") Child(final ChildBuilder b) { + super(b); + this.field3 = b.field3; + } + public static @java.lang.SuppressWarnings("all") ChildBuilder builder() { return new ChildBuilderImpl(); } } + public SuperBuilderWithGenerics() { + super(); + } public static void test() { Child x = Child.builder().field3(0.0).field1(5).item("").build(); } -- cgit