Skip to content

Commit

Permalink
[#2355] fixed tests for clashes in the generics for superbuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
rzwitserloot committed Feb 6, 2020
1 parent f12b705 commit 2e06cb3
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 53 deletions.
50 changes: 24 additions & 26 deletions test/transform/resource/after-delombok/SuperBuilderNameClashes.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
public class SuperBuilderNameClashes {
public static class GenericsClash<B, C, C2> {
@java.lang.SuppressWarnings("all")
public static abstract class GenericsClashBuilder<B, C, C2, C3 extends GenericsClash<B, C, C2>, B2 extends GenericsClashBuilder<B, C, C2, C3, B2>> {
public static abstract class GenericsClashBuilder<B, C, C2, C3 extends SuperBuilderNameClashes.GenericsClash<B, C, C2>, B2 extends SuperBuilderNameClashes.GenericsClash.GenericsClashBuilder<B, C, C2, C3, B2>> {
@java.lang.SuppressWarnings("all")
protected abstract B2 self();
@java.lang.SuppressWarnings("all")
Expand All @@ -13,32 +13,32 @@ public java.lang.String toString() {
}
}
@java.lang.SuppressWarnings("all")
private static final class GenericsClashBuilderImpl<B, C, C2> extends GenericsClashBuilder<B, C, C2, GenericsClash<B, C, C2>, GenericsClashBuilderImpl<B, C, C2>> {
private static final class GenericsClashBuilderImpl<B, C, C2> extends SuperBuilderNameClashes.GenericsClash.GenericsClashBuilder<B, C, C2, SuperBuilderNameClashes.GenericsClash<B, C, C2>, SuperBuilderNameClashes.GenericsClash.GenericsClashBuilderImpl<B, C, C2>> {
@java.lang.SuppressWarnings("all")
private GenericsClashBuilderImpl() {
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
protected GenericsClashBuilderImpl<B, C, C2> self() {
protected SuperBuilderNameClashes.GenericsClash.GenericsClashBuilderImpl<B, C, C2> self() {
return this;
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public GenericsClash<B, C, C2> build() {
return new GenericsClash<B, C, C2>(this);
public SuperBuilderNameClashes.GenericsClash<B, C, C2> build() {
return new SuperBuilderNameClashes.GenericsClash<B, C, C2>(this);
}
}
@java.lang.SuppressWarnings("all")
protected GenericsClash(final GenericsClashBuilder<B, C, C2, ?, ?> b) {
protected GenericsClash(final SuperBuilderNameClashes.GenericsClash.GenericsClashBuilder<B, C, C2, ?, ?> b) {
}
@java.lang.SuppressWarnings("all")
public static <B, C, C2> GenericsClashBuilder<B, C, C2, ?, ?> builder() {
return new GenericsClashBuilderImpl<B, C, C2>();
public static <B, C, C2> SuperBuilderNameClashes.GenericsClash.GenericsClashBuilder<B, C, C2, ?, ?> builder() {
return new SuperBuilderNameClashes.GenericsClash.GenericsClashBuilderImpl<B, C, C2>();
}
}
public static class B {
@java.lang.SuppressWarnings("all")
public static abstract class BBuilder<C extends B, B2 extends BBuilder<C, B2>> {
public static abstract class BBuilder<C extends SuperBuilderNameClashes.B, B2 extends SuperBuilderNameClashes.B.BBuilder<C, B2>> {
@java.lang.SuppressWarnings("all")
protected abstract B2 self();
@java.lang.SuppressWarnings("all")
Expand All @@ -50,35 +50,35 @@ public java.lang.String toString() {
}
}
@java.lang.SuppressWarnings("all")
private static final class BBuilderImpl extends BBuilder<B, BBuilderImpl> {
private static final class BBuilderImpl extends SuperBuilderNameClashes.B.BBuilder<SuperBuilderNameClashes.B, SuperBuilderNameClashes.B.BBuilderImpl> {
@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 {
}
public static class C {
C2 c2;
@java.lang.SuppressWarnings("all")
public static abstract class CBuilder<C3 extends C, B extends CBuilder<C3, B>> {
public static abstract class CBuilder<C3 extends SuperBuilderNameClashes.C, B extends SuperBuilderNameClashes.C.CBuilder<C3, B>> {
@java.lang.SuppressWarnings("all")
private C2 c2;
@java.lang.SuppressWarnings("all")
Expand All @@ -97,30 +97,28 @@ public java.lang.String toString() {
}
}
@java.lang.SuppressWarnings("all")
private static final class CBuilderImpl extends CBuilder<C, CBuilderImpl> {
private static final class CBuilderImpl extends SuperBuilderNameClashes.C.CBuilder<SuperBuilderNameClashes.C, SuperBuilderNameClashes.C.CBuilderImpl> {
@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();
}
}
}
48 changes: 24 additions & 24 deletions test/transform/resource/after-ecj/SuperBuilderNameClashes.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
public class SuperBuilderNameClashes {
public static @lombok.experimental.SuperBuilder class GenericsClash<B, C, C2> {
public static abstract @java.lang.SuppressWarnings("all") class GenericsClashBuilder<B, C, C2, C3 extends GenericsClash<B, C, C2>, B2 extends GenericsClashBuilder<B, C, C2, C3, B2>> {
public static abstract @java.lang.SuppressWarnings("all") class GenericsClashBuilder<B, C, C2, C3 extends SuperBuilderNameClashes.GenericsClash<B, C, C2>, B2 extends SuperBuilderNameClashes.GenericsClash.GenericsClashBuilder<B, C, C2, C3, B2>> {
public GenericsClashBuilder() {
super();
}
Expand All @@ -10,26 +10,26 @@ public GenericsClashBuilder() {
return "SuperBuilderNameClashes.GenericsClash.GenericsClashBuilder()";
}
}
private static final @java.lang.SuppressWarnings("all") class GenericsClashBuilderImpl<B, C, C2> extends GenericsClashBuilder<B, C, C2, GenericsClash<B, C, C2>, GenericsClashBuilderImpl<B, C, C2>> {
private static final @java.lang.SuppressWarnings("all") class GenericsClashBuilderImpl<B, C, C2> extends SuperBuilderNameClashes.GenericsClash.GenericsClashBuilder<B, C, C2, SuperBuilderNameClashes.GenericsClash<B, C, C2>, SuperBuilderNameClashes.GenericsClash.GenericsClashBuilderImpl<B, C, C2>> {
private GenericsClashBuilderImpl() {
super();
}
protected @java.lang.Override @java.lang.SuppressWarnings("all") GenericsClashBuilderImpl<B, C, C2> self() {
protected @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderNameClashes.GenericsClash.GenericsClashBuilderImpl<B, C, C2> self() {
return this;
}
public @java.lang.Override @java.lang.SuppressWarnings("all") GenericsClash<B, C, C2> build() {
return new GenericsClash<B, C, C2>(this);
public @java.lang.Override @java.lang.SuppressWarnings("all") SuperBuilderNameClashes.GenericsClash<B, C, C2> build() {
return new SuperBuilderNameClashes.GenericsClash<B, C, C2>(this);
}
}
protected @java.lang.SuppressWarnings("all") GenericsClash(final GenericsClashBuilder<B, C, C2, ?, ?> b) {
protected @java.lang.SuppressWarnings("all") GenericsClash(final SuperBuilderNameClashes.GenericsClash.GenericsClashBuilder<B, C, C2, ?, ?> b) {
super();
}
public static @java.lang.SuppressWarnings("all") <B, C, C2>GenericsClashBuilder<B, C, C2, ?, ?> builder() {
return new GenericsClashBuilderImpl<B, C, C2>();
public static @java.lang.SuppressWarnings("all") <B, C, C2>SuperBuilderNameClashes.GenericsClash.GenericsClashBuilder<B, C, C2, ?, ?> builder() {
return new SuperBuilderNameClashes.GenericsClash.GenericsClashBuilderImpl<B, C, C2>();
}
}
public static @lombok.experimental.SuperBuilder class B {
public static abstract @java.lang.SuppressWarnings("all") class BBuilder<C extends B, B2 extends BBuilder<C, B2>> {
public static abstract @java.lang.SuppressWarnings("all") class BBuilder<C extends SuperBuilderNameClashes.B, B2 extends SuperBuilderNameClashes.B.BBuilder<C, B2>> {
public BBuilder() {
super();
}
Expand All @@ -39,22 +39,22 @@ public BBuilder() {
return "SuperBuilderNameClashes.B.BBuilder()";
}
}
private static final @java.lang.SuppressWarnings("all") class BBuilderImpl extends BBuilder<B, BBuilderImpl> {
private static final @java.lang.SuppressWarnings("all") class BBuilderImpl extends SuperBuilderNameClashes.B.BBuilder<SuperBuilderNameClashes.B, SuperBuilderNameClashes.B.BBuilderImpl> {
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 {
Expand All @@ -63,7 +63,7 @@ public C2() {
}
}
public static @lombok.experimental.SuperBuilder class C {
public static abstract @java.lang.SuppressWarnings("all") class CBuilder<C3 extends C, B extends CBuilder<C3, B>> {
public static abstract @java.lang.SuppressWarnings("all") class CBuilder<C3 extends SuperBuilderNameClashes.C, B extends SuperBuilderNameClashes.C.CBuilder<C3, B>> {
private @java.lang.SuppressWarnings("all") C2 c2;
public CBuilder() {
super();
Expand All @@ -78,24 +78,24 @@ public CBuilder() {
return (("SuperBuilderNameClashes.C.CBuilder(c2=" + this.c2) + ")");
}
}
private static final @java.lang.SuppressWarnings("all") class CBuilderImpl extends CBuilder<C, CBuilderImpl> {
private static final @java.lang.SuppressWarnings("all") class CBuilderImpl extends SuperBuilderNameClashes.C.CBuilder<SuperBuilderNameClashes.C, SuperBuilderNameClashes.C.CBuilderImpl> {
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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
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

0 comments on commit 2e06cb3

Please sign in to comment.