From 2e06cb3ff19fb25b709ddfe5513a953c3d658b2e Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Thu, 6 Feb 2020 22:06:21 +0100 Subject: [#2355] fixed tests for clashes in the generics for superbuilder --- .../after-delombok/SuperBuilderNameClashes.java | 50 +++++++++++----------- .../after-ecj/SuperBuilderNameClashes.java | 48 ++++++++++----------- .../SuperBuilderNameClashes.java.messages | 6 +-- 3 files changed, 51 insertions(+), 53 deletions(-) (limited to 'test/transform') diff --git a/test/transform/resource/after-delombok/SuperBuilderNameClashes.java b/test/transform/resource/after-delombok/SuperBuilderNameClashes.java index a33fd6b4..baf47dc4 100644 --- a/test/transform/resource/after-delombok/SuperBuilderNameClashes.java +++ b/test/transform/resource/after-delombok/SuperBuilderNameClashes.java @@ -1,7 +1,7 @@ public class SuperBuilderNameClashes { public static class GenericsClash { @java.lang.SuppressWarnings("all") - public static abstract class GenericsClashBuilder, B2 extends GenericsClashBuilder> { + public static abstract class GenericsClashBuilder, B2 extends SuperBuilderNameClashes.GenericsClash.GenericsClashBuilder> { @java.lang.SuppressWarnings("all") protected abstract B2 self(); @java.lang.SuppressWarnings("all") @@ -13,32 +13,32 @@ public class SuperBuilderNameClashes { } } @java.lang.SuppressWarnings("all") - private static final class GenericsClashBuilderImpl extends GenericsClashBuilder, GenericsClashBuilderImpl> { + private static final class GenericsClashBuilderImpl extends SuperBuilderNameClashes.GenericsClash.GenericsClashBuilder, SuperBuilderNameClashes.GenericsClash.GenericsClashBuilderImpl> { @java.lang.SuppressWarnings("all") private GenericsClashBuilderImpl() { } @java.lang.Override @java.lang.SuppressWarnings("all") - protected GenericsClashBuilderImpl self() { + protected SuperBuilderNameClashes.GenericsClash.GenericsClashBuilderImpl self() { return this; } @java.lang.Override @java.lang.SuppressWarnings("all") - public GenericsClash build() { - return new GenericsClash(this); + public SuperBuilderNameClashes.GenericsClash build() { + return new SuperBuilderNameClashes.GenericsClash(this); } } @java.lang.SuppressWarnings("all") - protected GenericsClash(final GenericsClashBuilder b) { + protected GenericsClash(final SuperBuilderNameClashes.GenericsClash.GenericsClashBuilder b) { } @java.lang.SuppressWarnings("all") - public static GenericsClashBuilder builder() { - return new GenericsClashBuilderImpl(); + public static SuperBuilderNameClashes.GenericsClash.GenericsClashBuilder builder() { + return new SuperBuilderNameClashes.GenericsClash.GenericsClashBuilderImpl(); } } public static class B { @java.lang.SuppressWarnings("all") - public static abstract class BBuilder> { + public static abstract class BBuilder> { @java.lang.SuppressWarnings("all") protected abstract B2 self(); @java.lang.SuppressWarnings("all") @@ -50,27 +50,27 @@ public class SuperBuilderNameClashes { } } @java.lang.SuppressWarnings("all") - private static final class BBuilderImpl extends BBuilder { + private static final class BBuilderImpl extends SuperBuilderNameClashes.B.BBuilder { @java.lang.SuppressWarnings("all") private BBuilderImpl() { } @java.lang.Override @java.lang.SuppressWarnings("all") - protected BBuilderImpl self() { + protected SuperBuilderNameClashes.B.BBuilderImpl self() { return this; } @java.lang.Override @java.lang.SuppressWarnings("all") - public B build() { - return new B(this); + public SuperBuilderNameClashes.B build() { + return new SuperBuilderNameClashes.B(this); } } @java.lang.SuppressWarnings("all") - protected B(final BBuilder b) { + protected B(final SuperBuilderNameClashes.B.BBuilder b) { } @java.lang.SuppressWarnings("all") - public static BBuilder builder() { - return new BBuilderImpl(); + public static SuperBuilderNameClashes.B.BBuilder builder() { + return new SuperBuilderNameClashes.B.BBuilderImpl(); } } public static class C2 { @@ -78,7 +78,7 @@ public class SuperBuilderNameClashes { public static class C { C2 c2; @java.lang.SuppressWarnings("all") - public static abstract class CBuilder> { + public static abstract class CBuilder> { @java.lang.SuppressWarnings("all") private C2 c2; @java.lang.SuppressWarnings("all") @@ -97,30 +97,28 @@ public class SuperBuilderNameClashes { } } @java.lang.SuppressWarnings("all") - private static final class CBuilderImpl extends CBuilder { + private static final class CBuilderImpl extends SuperBuilderNameClashes.C.CBuilder { @java.lang.SuppressWarnings("all") private CBuilderImpl() { } - @java.lang.Override @java.lang.SuppressWarnings("all") - protected CBuilderImpl self() { + protected SuperBuilderNameClashes.C.CBuilderImpl self() { return this; } - @java.lang.Override @java.lang.SuppressWarnings("all") - public C build() { - return new C(this); + public SuperBuilderNameClashes.C build() { + return new SuperBuilderNameClashes.C(this); } } @java.lang.SuppressWarnings("all") - protected C(final CBuilder b) { + protected C(final SuperBuilderNameClashes.C.CBuilder b) { this.c2 = b.c2; } @java.lang.SuppressWarnings("all") - public static CBuilder builder() { - return new CBuilderImpl(); + public static SuperBuilderNameClashes.C.CBuilder builder() { + return new SuperBuilderNameClashes.C.CBuilderImpl(); } } } diff --git a/test/transform/resource/after-ecj/SuperBuilderNameClashes.java b/test/transform/resource/after-ecj/SuperBuilderNameClashes.java index dd238b5d..89ce3824 100644 --- a/test/transform/resource/after-ecj/SuperBuilderNameClashes.java +++ b/test/transform/resource/after-ecj/SuperBuilderNameClashes.java @@ -1,6 +1,6 @@ public class SuperBuilderNameClashes { public static @lombok.experimental.SuperBuilder class GenericsClash { - public static abstract @java.lang.SuppressWarnings("all") class GenericsClashBuilder, B2 extends GenericsClashBuilder> { + public static abstract @java.lang.SuppressWarnings("all") class GenericsClashBuilder, B2 extends SuperBuilderNameClashes.GenericsClash.GenericsClashBuilder> { public GenericsClashBuilder() { super(); } @@ -10,26 +10,26 @@ public class SuperBuilderNameClashes { return "SuperBuilderNameClashes.GenericsClash.GenericsClashBuilder()"; } } - private static final @java.lang.SuppressWarnings("all") class GenericsClashBuilderImpl extends GenericsClashBuilder, GenericsClashBuilderImpl> { + private static final @java.lang.SuppressWarnings("all") class GenericsClashBuilderImpl extends SuperBuilderNameClashes.GenericsClash.GenericsClashBuilder, SuperBuilderNameClashes.GenericsClash.GenericsClashBuilderImpl> { private GenericsClashBuilderImpl() { super(); } - protected @java.lang.Override @java.lang.SuppressWarnings("all") GenericsClashBuilderImpl self() { + protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderNameClashes.GenericsClash.GenericsClashBuilderImpl self() { return this; } - public @java.lang.Override @java.lang.SuppressWarnings("all") GenericsClash build() { - return new GenericsClash(this); + public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderNameClashes.GenericsClash build() { + return new SuperBuilderNameClashes.GenericsClash(this); } } - protected @java.lang.SuppressWarnings("all") GenericsClash(final GenericsClashBuilder b) { + protected @java.lang.SuppressWarnings("all") GenericsClash(final SuperBuilderNameClashes.GenericsClash.GenericsClashBuilder b) { super(); } - public static @java.lang.SuppressWarnings("all") GenericsClashBuilder builder() { - return new GenericsClashBuilderImpl(); + public static @java.lang.SuppressWarnings("all") SuperBuilderNameClashes.GenericsClash.GenericsClashBuilder builder() { + return new SuperBuilderNameClashes.GenericsClash.GenericsClashBuilderImpl(); } } public static @lombok.experimental.SuperBuilder class B { - public static abstract @java.lang.SuppressWarnings("all") class BBuilder> { + public static abstract @java.lang.SuppressWarnings("all") class BBuilder> { public BBuilder() { super(); } @@ -39,22 +39,22 @@ public class SuperBuilderNameClashes { return "SuperBuilderNameClashes.B.BBuilder()"; } } - private static final @java.lang.SuppressWarnings("all") class BBuilderImpl extends BBuilder { + private static final @java.lang.SuppressWarnings("all") class BBuilderImpl extends SuperBuilderNameClashes.B.BBuilder { private BBuilderImpl() { super(); } - protected @java.lang.Override @java.lang.SuppressWarnings("all") BBuilderImpl self() { + protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderNameClashes.B.BBuilderImpl self() { return this; } - public @java.lang.Override @java.lang.SuppressWarnings("all") B build() { - return new B(this); + public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderNameClashes.B build() { + return new SuperBuilderNameClashes.B(this); } } - protected @java.lang.SuppressWarnings("all") B(final BBuilder b) { + protected @java.lang.SuppressWarnings("all") B(final SuperBuilderNameClashes.B.BBuilder b) { super(); } - public static @java.lang.SuppressWarnings("all") BBuilder builder() { - return new BBuilderImpl(); + public static @java.lang.SuppressWarnings("all") SuperBuilderNameClashes.B.BBuilder builder() { + return new SuperBuilderNameClashes.B.BBuilderImpl(); } } public static class C2 { @@ -63,7 +63,7 @@ public class SuperBuilderNameClashes { } } public static @lombok.experimental.SuperBuilder class C { - public static abstract @java.lang.SuppressWarnings("all") class CBuilder> { + public static abstract @java.lang.SuppressWarnings("all") class CBuilder> { private @java.lang.SuppressWarnings("all") C2 c2; public CBuilder() { super(); @@ -78,24 +78,24 @@ public class SuperBuilderNameClashes { return (("SuperBuilderNameClashes.C.CBuilder(c2=" + this.c2) + ")"); } } - private static final @java.lang.SuppressWarnings("all") class CBuilderImpl extends CBuilder { + private static final @java.lang.SuppressWarnings("all") class CBuilderImpl extends SuperBuilderNameClashes.C.CBuilder { private CBuilderImpl() { super(); } - protected @java.lang.Override @java.lang.SuppressWarnings("all") CBuilderImpl self() { + protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderNameClashes.C.CBuilderImpl self() { return this; } - public @java.lang.Override @java.lang.SuppressWarnings("all") C build() { - return new C(this); + public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderNameClashes.C build() { + return new SuperBuilderNameClashes.C(this); } } C2 c2; - protected @java.lang.SuppressWarnings("all") C(final CBuilder b) { + protected @java.lang.SuppressWarnings("all") C(final SuperBuilderNameClashes.C.CBuilder b) { super(); this.c2 = b.c2; } - public static @java.lang.SuppressWarnings("all") CBuilder builder() { - return new CBuilderImpl(); + public static @java.lang.SuppressWarnings("all") SuperBuilderNameClashes.C.CBuilder builder() { + return new SuperBuilderNameClashes.C.CBuilderImpl(); } } public SuperBuilderNameClashes() { diff --git a/test/transform/resource/messages-ecj/SuperBuilderNameClashes.java.messages b/test/transform/resource/messages-ecj/SuperBuilderNameClashes.java.messages index 59774b92..3f371ab2 100644 --- a/test/transform/resource/messages-ecj/SuperBuilderNameClashes.java.messages +++ b/test/transform/resource/messages-ecj/SuperBuilderNameClashes.java.messages @@ -1,3 +1,3 @@ -3 WARNING The type parameter B is hiding the type SuperBuilderNameClashes.B -3 WARNING The type parameter C is hiding the type SuperBuilderNameClashes.C -3 WARNING The type parameter C2 is hiding the type SuperBuilderNameClashes.C2 \ No newline at end of file +3 The type parameter B is hiding the type SuperBuilderNameClashes.B +3 The type parameter C is hiding the type SuperBuilderNameClashes.C +3 The type parameter C2 is hiding the type SuperBuilderNameClashes.C2 -- cgit