diff options
author | Caleb Brinkman <cbrinkman@sonatype.com> | 2019-09-11 09:17:02 -0500 |
---|---|---|
committer | Caleb Brinkman <cbrinkman@sonatype.com> | 2019-09-11 09:17:02 -0500 |
commit | dc56309dada0ae0fba2c939d3fc300d6abac145c (patch) | |
tree | f79b31cb086a368aa467f359b84923bca1ecaa6b /test/transform/resource/after-ecj | |
parent | 4dc5c32d6b47264b5c8abb6fdf24077eec5aa7e7 (diff) | |
parent | 8c32769f18361ed626ebd06962d924c288950d26 (diff) | |
download | lombok-dc56309dada0ae0fba2c939d3fc300d6abac145c.tar.gz lombok-dc56309dada0ae0fba2c939d3fc300d6abac145c.tar.bz2 lombok-dc56309dada0ae0fba2c939d3fc300d6abac145c.zip |
Merge branch 'master' of github.com:rzwitserloot/lombok into feature/builder-setter-prefixes
Diffstat (limited to 'test/transform/resource/after-ecj')
24 files changed, 528 insertions, 248 deletions
diff --git a/test/transform/resource/after-ecj/CheckerFrameworkBasic.java b/test/transform/resource/after-ecj/CheckerFrameworkBasic.java new file mode 100644 index 00000000..25b28c4b --- /dev/null +++ b/test/transform/resource/after-ecj/CheckerFrameworkBasic.java @@ -0,0 +1,59 @@ +import lombok.Data; +import lombok.experimental.Accessors; +import lombok.With; +@Data @Accessors(chain = true) class CheckerFrameworkBasic { + private final @With int x; + private final int y; + private int z; + public @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") CheckerFrameworkBasic withX(final int x) { + return ((this.x == x) ? this : new CheckerFrameworkBasic(x, this.y, this.z)); + } + public @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") int getX() { + return this.x; + } + public @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") int getY() { + return this.y; + } + public @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") int getZ() { + return this.z; + } + public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") CheckerFrameworkBasic setZ(final int z) { + this.z = z; + return this; + } + public @java.lang.Override @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof CheckerFrameworkBasic))) + return false; + final CheckerFrameworkBasic other = (CheckerFrameworkBasic) o; + if ((! other.canEqual((java.lang.Object) this))) + return false; + if ((this.getX() != other.getX())) + return false; + if ((this.getY() != other.getY())) + return false; + if ((this.getZ() != other.getZ())) + return false; + return true; + } + protected @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + return (other instanceof CheckerFrameworkBasic); + } + public @java.lang.Override @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") int hashCode() { + final int PRIME = 59; + int result = 1; + result = ((result * PRIME) + this.getX()); + result = ((result * PRIME) + this.getY()); + result = ((result * PRIME) + this.getZ()); + return result; + } + public @java.lang.Override @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((((("CheckerFrameworkBasic(x=" + this.getX()) + ", y=") + this.getY()) + ", z=") + this.getZ()) + ")"); + } + public @org.checkerframework.common.aliasing.qual.Unique @java.lang.SuppressWarnings("all") CheckerFrameworkBasic(final int x, final int y) { + super(); + this.x = x; + this.y = y; + } +} diff --git a/test/transform/resource/after-ecj/CheckerFrameworkBuilder.java b/test/transform/resource/after-ecj/CheckerFrameworkBuilder.java new file mode 100644 index 00000000..2baad9d9 --- /dev/null +++ b/test/transform/resource/after-ecj/CheckerFrameworkBuilder.java @@ -0,0 +1,79 @@ +import java.util.List; +import lombok.Builder; +import lombok.Singular; +@Builder class CheckerFrameworkBuilder { + public static @java.lang.SuppressWarnings("all") class CheckerFrameworkBuilderBuilder { + private @java.lang.SuppressWarnings("all") int x$value; + private @java.lang.SuppressWarnings("all") boolean x$set; + private @java.lang.SuppressWarnings("all") int y; + private @java.lang.SuppressWarnings("all") int z; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> names; + @org.checkerframework.common.aliasing.qual.Unique @java.lang.SuppressWarnings("all") CheckerFrameworkBuilderBuilder() { + super(); + } + public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") CheckerFrameworkBuilderBuilder x(final @org.checkerframework.checker.builder.qual.NotCalledMethods("x") CheckerFrameworkBuilderBuilder this, final int x) { + this.x$value = x; + x$set = true; + return this; + } + public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") CheckerFrameworkBuilderBuilder y(final @org.checkerframework.checker.builder.qual.NotCalledMethods("y") CheckerFrameworkBuilderBuilder this, final int y) { + this.y = y; + return this; + } + public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") CheckerFrameworkBuilderBuilder z(final @org.checkerframework.checker.builder.qual.NotCalledMethods("z") CheckerFrameworkBuilderBuilder this, final int z) { + this.z = z; + return this; + } + public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") CheckerFrameworkBuilderBuilder name(final String name) { + if ((this.names == null)) + this.names = new java.util.ArrayList<String>(); + this.names.add(name); + return this; + } + public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") CheckerFrameworkBuilderBuilder names(final java.util.Collection<? extends String> names) { + if ((this.names == null)) + this.names = new java.util.ArrayList<String>(); + this.names.addAll(names); + return this; + } + public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") CheckerFrameworkBuilderBuilder clearNames() { + if ((this.names != null)) + this.names.clear(); + return this; + } + public @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") CheckerFrameworkBuilder build(final @org.checkerframework.checker.builder.qual.CalledMethods({"y", "z"}) CheckerFrameworkBuilderBuilder this) { + java.util.List<String> names; + switch (((this.names == null) ? 0 : this.names.size())) { + case 0 : + names = java.util.Collections.emptyList(); + break; + case 1 : + names = java.util.Collections.singletonList(this.names.get(0)); + break; + default : + names = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.names)); + } + return new CheckerFrameworkBuilder((x$set ? x$value : CheckerFrameworkBuilder.$default$x()), y, z, names); + } + public @java.lang.Override @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((((((("CheckerFrameworkBuilder.CheckerFrameworkBuilderBuilder(x$value=" + this.x$value) + ", y=") + this.y) + ", z=") + this.z) + ", names=") + this.names) + ")"); + } + } + @Builder.Default int x; + int y; + int z; + @Singular List<String> names; + private static @java.lang.SuppressWarnings("all") int $default$x() { + return 5; + } + @org.checkerframework.common.aliasing.qual.Unique @java.lang.SuppressWarnings("all") CheckerFrameworkBuilder(final int x, final int y, final int z, final List<String> names) { + super(); + this.x = x; + this.y = y; + this.z = z; + this.names = names; + } + public static @org.checkerframework.common.aliasing.qual.Unique @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") CheckerFrameworkBuilderBuilder builder() { + return new CheckerFrameworkBuilderBuilder(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/CheckerFrameworkSuperBuilder.java b/test/transform/resource/after-ecj/CheckerFrameworkSuperBuilder.java new file mode 100644 index 00000000..ffbcf44e --- /dev/null +++ b/test/transform/resource/after-ecj/CheckerFrameworkSuperBuilder.java @@ -0,0 +1,142 @@ +import java.util.List; +import lombok.Singular; +class CheckerFrameworkSuperBuilder { + public static @lombok.experimental.SuperBuilder class Parent { + public static abstract @java.lang.SuppressWarnings("all") class ParentBuilder<C extends Parent, B extends ParentBuilder<C, B>> { + private @java.lang.SuppressWarnings("all") int x$value; + private @java.lang.SuppressWarnings("all") boolean x$set; + private @java.lang.SuppressWarnings("all") int y; + private @java.lang.SuppressWarnings("all") int z; + private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> names; + public ParentBuilder() { + } + protected abstract @org.checkerframework.checker.builder.qual.ReturnsReceiver @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") B self(); + public abstract @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") C build(final @org.checkerframework.checker.builder.qual.CalledMethods({"y", "z"}) ParentBuilder this); + public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") B x(final @org.checkerframework.checker.builder.qual.NotCalledMethods("x") ParentBuilder this, final int x) { + this.x$value = x; + x$set = true; + return self(); + } + public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") B y(final @org.checkerframework.checker.builder.qual.NotCalledMethods("y") ParentBuilder this, final int y) { + this.y = y; + return self(); + } + public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") B z(final @org.checkerframework.checker.builder.qual.NotCalledMethods("z") ParentBuilder this, final int z) { + this.z = z; + return self(); + } + public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") B name(final String name) { + if ((this.names == null)) + this.names = new java.util.ArrayList<String>(); + this.names.add(name); + return self(); + } + public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") B names(final java.util.Collection<? extends String> names) { + if ((this.names == null)) + this.names = new java.util.ArrayList<String>(); + this.names.addAll(names); + return self(); + } + public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") B clearNames() { + if ((this.names != null)) + this.names.clear(); + return self(); + } + public @java.lang.Override @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((((((("CheckerFrameworkSuperBuilder.Parent.ParentBuilder(x$value=" + this.x$value) + ", y=") + this.y) + ", z=") + this.z) + ", names=") + this.names) + ")"); + } + } + private static final @java.lang.SuppressWarnings("all") class ParentBuilderImpl extends ParentBuilder<Parent, ParentBuilderImpl> { + private ParentBuilderImpl() { + } + protected @java.lang.Override @org.checkerframework.checker.builder.qual.ReturnsReceiver @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") ParentBuilderImpl self() { + return this; + } + public @java.lang.Override @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") Parent build(final @org.checkerframework.checker.builder.qual.CalledMethods({"y", "z"}) ParentBuilderImpl this) { + return new Parent(this); + } + } + @lombok.Builder.Default int x; + int y; + int z; + @Singular List<String> names; + private static @java.lang.SuppressWarnings("all") int $default$x() { + return 5; + } + protected @org.checkerframework.common.aliasing.qual.Unique @java.lang.SuppressWarnings("all") Parent(final ParentBuilder<?, ?> b) { + super(); + if (b.x$set) + this.x = b.x$value; + else + this.x = Parent.$default$x(); + this.y = b.y; + this.z = b.z; + java.util.List<String> names; + switch (((b.names == null) ? 0 : b.names.size())) { + case 0 : + names = java.util.Collections.emptyList(); + break; + case 1 : + names = java.util.Collections.singletonList(b.names.get(0)); + break; + default : + names = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(b.names)); + } + this.names = names; + } + public static @org.checkerframework.common.aliasing.qual.Unique @java.lang.SuppressWarnings("all") ParentBuilder<?, ?> builder() { + return new ParentBuilderImpl(); + } + } + public static @lombok.experimental.SuperBuilder class Child extends Parent { + public static abstract @java.lang.SuppressWarnings("all") class ChildBuilder<C extends Child, B extends ChildBuilder<C, B>> extends Parent.ParentBuilder<C, B> { + private @java.lang.SuppressWarnings("all") int a$value; + private @java.lang.SuppressWarnings("all") boolean a$set; + private @java.lang.SuppressWarnings("all") int b; + public ChildBuilder() { + } + protected abstract @java.lang.Override @org.checkerframework.checker.builder.qual.ReturnsReceiver @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") B self(); + public abstract @java.lang.Override @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") C build(final @org.checkerframework.checker.builder.qual.CalledMethods("b") ChildBuilder this); + public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") B a(final @org.checkerframework.checker.builder.qual.NotCalledMethods("a") ChildBuilder this, final int a) { + this.a$value = a; + a$set = true; + return self(); + } + public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") B b(final @org.checkerframework.checker.builder.qual.NotCalledMethods("b") ChildBuilder this, final int b) { + this.b = b; + return self(); + } + public @java.lang.Override @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((((("CheckerFrameworkSuperBuilder.Child.ChildBuilder(super=" + super.toString()) + ", a$value=") + this.a$value) + ", b=") + this.b) + ")"); + } + } + private static final @java.lang.SuppressWarnings("all") class ChildBuilderImpl extends ChildBuilder<Child, ChildBuilderImpl> { + private ChildBuilderImpl() { + } + protected @java.lang.Override @org.checkerframework.checker.builder.qual.ReturnsReceiver @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") ChildBuilderImpl self() { + return this; + } + public @java.lang.Override @org.checkerframework.dataflow.qual.SideEffectFree @java.lang.SuppressWarnings("all") Child build(final @org.checkerframework.checker.builder.qual.CalledMethods("b") ChildBuilderImpl this) { + return new Child(this); + } + } + @lombok.Builder.Default int a; + int b; + private static @java.lang.SuppressWarnings("all") int $default$a() { + return 1; + } + protected @org.checkerframework.common.aliasing.qual.Unique @java.lang.SuppressWarnings("all") Child(final ChildBuilder<?, ?> b) { + super(b); + if (b.a$set) + this.a = b.a$value; + else + this.a = Child.$default$a(); + this.b = b.b; + } + public static @org.checkerframework.common.aliasing.qual.Unique @java.lang.SuppressWarnings("all") ChildBuilder<?, ?> builder() { + return new ChildBuilderImpl(); + } + } + CheckerFrameworkSuperBuilder() { + } +} diff --git a/test/transform/resource/after-ecj/SetterAndWithMethodJavadoc.java b/test/transform/resource/after-ecj/SetterAndWithMethodJavadoc.java new file mode 100644 index 00000000..dd64e358 --- /dev/null +++ b/test/transform/resource/after-ecj/SetterAndWithMethodJavadoc.java @@ -0,0 +1,22 @@ +import lombok.With; +class SetterAndWithMethodJavadoc { + @lombok.Setter @lombok.With int i; + @lombok.Setter @lombok.With int j; + SetterAndWithMethodJavadoc(int i, int j) { + super(); + this.i = i; + this.j = j; + } + public @java.lang.SuppressWarnings("all") void setI(final int i) { + this.i = i; + } + public @java.lang.SuppressWarnings("all") SetterAndWithMethodJavadoc withI(final int i) { + return ((this.i == i) ? this : new SetterAndWithMethodJavadoc(i, this.j)); + } + public @java.lang.SuppressWarnings("all") void setJ(final int j) { + this.j = j; + } + public @java.lang.SuppressWarnings("all") SetterAndWithMethodJavadoc withJ(final int j) { + return ((this.j == j) ? this : new SetterAndWithMethodJavadoc(this.i, j)); + } +} diff --git a/test/transform/resource/after-ecj/SetterAndWitherJavadoc.java b/test/transform/resource/after-ecj/SetterAndWitherJavadoc.java deleted file mode 100644 index 623277a0..00000000 --- a/test/transform/resource/after-ecj/SetterAndWitherJavadoc.java +++ /dev/null @@ -1,22 +0,0 @@ -import lombok.experimental.Wither; -class SetterAndWitherJavadoc { - @lombok.Setter @lombok.experimental.Wither int i; - @lombok.Setter @lombok.experimental.Wither int j; - SetterAndWitherJavadoc(int i, int j) { - super(); - this.i = i; - this.j = j; - } - public @java.lang.SuppressWarnings("all") void setI(final int i) { - this.i = i; - } - public @java.lang.SuppressWarnings("all") SetterAndWitherJavadoc withI(final int i) { - return ((this.i == i) ? this : new SetterAndWitherJavadoc(i, this.j)); - } - public @java.lang.SuppressWarnings("all") void setJ(final int j) { - this.j = j; - } - public @java.lang.SuppressWarnings("all") SetterAndWitherJavadoc withJ(final int j) { - return ((this.j == j) ? this : new SetterAndWitherJavadoc(this.i, j)); - } -} diff --git a/test/transform/resource/after-ecj/WithAlreadyExists.java b/test/transform/resource/after-ecj/WithAlreadyExists.java new file mode 100644 index 00000000..a868cde5 --- /dev/null +++ b/test/transform/resource/after-ecj/WithAlreadyExists.java @@ -0,0 +1,78 @@ +class With1 { + @lombok.With boolean foo; + void withFoo(boolean foo) { + } + With1(boolean foo) { + super(); + } +} +class With2 { + @lombok.With boolean foo; + void withFoo(String foo) { + } + With2(boolean foo) { + super(); + } +} +class With3 { + @lombok.With String foo; + void withFoo(boolean foo) { + } + With3(String foo) { + super(); + } +} +class With4 { + @lombok.With String foo; + void withFoo(String foo) { + } + With4(String foo) { + super(); + } +} +class With5 { + @lombok.With String foo; + void withFoo() { + } + With5(String foo) { + super(); + } + public @java.lang.SuppressWarnings("all") With5 withFoo(final String foo) { + return ((this.foo == foo) ? this : new With5(foo)); + } +} +class With6 { + @lombok.With String foo; + void withFoo(String foo, int x) { + } + With6(String foo) { + super(); + } + public @java.lang.SuppressWarnings("all") With6 withFoo(final String foo) { + return ((this.foo == foo) ? this : new With6(foo)); + } +} +class With7 { + @lombok.With String foo; + void withFoo(String foo, Object... x) { + } + With7(String foo) { + super(); + } +} +class With8 { + @lombok.With boolean isFoo; + void withIsFoo(boolean foo) { + } + With8(boolean foo) { + super(); + } +} +class With9 { + @lombok.With boolean isFoo; + void withFoo(boolean foo) { + } + With9(boolean foo) { + super(); + } +} diff --git a/test/transform/resource/after-ecj/WithAndAllArgsConstructor.java b/test/transform/resource/after-ecj/WithAndAllArgsConstructor.java new file mode 100644 index 00000000..d3fcded2 --- /dev/null +++ b/test/transform/resource/after-ecj/WithAndAllArgsConstructor.java @@ -0,0 +1,20 @@ +@lombok.AllArgsConstructor class WithAndAllArgsConstructor<T, J extends T, L extends java.lang.Number> { + @lombok.With J test; + @lombok.With java.util.List<L> test2; + final int x = 10; + int y = 20; + final int z; + public @java.lang.SuppressWarnings("all") WithAndAllArgsConstructor<T, J, L> withTest(final J test) { + return ((this.test == test) ? this : new WithAndAllArgsConstructor<T, J, L>(test, this.test2, this.y, this.z)); + } + public @java.lang.SuppressWarnings("all") WithAndAllArgsConstructor<T, J, L> withTest2(final java.util.List<L> test2) { + return ((this.test2 == test2) ? this : new WithAndAllArgsConstructor<T, J, L>(this.test, test2, this.y, this.z)); + } + public @java.lang.SuppressWarnings("all") WithAndAllArgsConstructor(final J test, final java.util.List<L> test2, final int y, final int z) { + super(); + this.test = test; + this.test2 = test2; + this.y = y; + this.z = z; + } +} diff --git a/test/transform/resource/after-ecj/WithMethodAbstract.java b/test/transform/resource/after-ecj/WithMethodAbstract.java new file mode 100644 index 00000000..cb71357a --- /dev/null +++ b/test/transform/resource/after-ecj/WithMethodAbstract.java @@ -0,0 +1,7 @@ +abstract class WithMethodAbstract { + @lombok.With String foo; + WithMethodAbstract() { + super(); + } + public abstract @java.lang.SuppressWarnings("all") WithMethodAbstract withFoo(final String foo); +} diff --git a/test/transform/resource/after-ecj/WithMethodMarkedDeprecated.java b/test/transform/resource/after-ecj/WithMethodMarkedDeprecated.java new file mode 100644 index 00000000..cd123fe8 --- /dev/null +++ b/test/transform/resource/after-ecj/WithMethodMarkedDeprecated.java @@ -0,0 +1,14 @@ +import lombok.With; +class WithMethodMarkedDeprecated { + @Deprecated @With int annotation; + @With int javadoc; + WithMethodMarkedDeprecated(int annotation, int javadoc) { + super(); + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") WithMethodMarkedDeprecated withAnnotation(final int annotation) { + return ((this.annotation == annotation) ? this : new WithMethodMarkedDeprecated(annotation, this.javadoc)); + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") WithMethodMarkedDeprecated withJavadoc(final int javadoc) { + return ((this.javadoc == javadoc) ? this : new WithMethodMarkedDeprecated(this.annotation, javadoc)); + } +} diff --git a/test/transform/resource/after-ecj/WithOnClass.java b/test/transform/resource/after-ecj/WithOnClass.java new file mode 100644 index 00000000..ca3e8c6b --- /dev/null +++ b/test/transform/resource/after-ecj/WithOnClass.java @@ -0,0 +1,52 @@ +@lombok.With class WithOnClass1 { + @lombok.With(lombok.AccessLevel.NONE) boolean isNone; + boolean isPublic; + WithOnClass1(boolean isNone, boolean isPublic) { + super(); + } + public @java.lang.SuppressWarnings("all") WithOnClass1 withPublic(final boolean isPublic) { + return ((this.isPublic == isPublic) ? this : new WithOnClass1(this.isNone, isPublic)); + } +} +@lombok.With(lombok.AccessLevel.PROTECTED) class WithOnClass2 { + @lombok.With(lombok.AccessLevel.NONE) boolean isNone; + boolean isProtected; + @lombok.With(lombok.AccessLevel.PACKAGE) boolean isPackage; + WithOnClass2(boolean isNone, boolean isProtected, boolean isPackage) { + super(); + } + @java.lang.SuppressWarnings("all") WithOnClass2 withPackage(final boolean isPackage) { + return ((this.isPackage == isPackage) ? this : new WithOnClass2(this.isNone, this.isProtected, isPackage)); + } + protected @java.lang.SuppressWarnings("all") WithOnClass2 withProtected(final boolean isProtected) { + return ((this.isProtected == isProtected) ? this : new WithOnClass2(this.isNone, isProtected, this.isPackage)); + } +} +@lombok.With class WithOnClass3 { + String couldBeNull; + @lombok.NonNull String nonNull; + WithOnClass3(String couldBeNull, String nonNull) { + super(); + } + public @java.lang.SuppressWarnings("all") WithOnClass3 withCouldBeNull(final String couldBeNull) { + return ((this.couldBeNull == couldBeNull) ? this : new WithOnClass3(couldBeNull, this.nonNull)); + } + public @java.lang.SuppressWarnings("all") WithOnClass3 withNonNull(final @lombok.NonNull String nonNull) { + if ((nonNull == null)) + { + throw new java.lang.NullPointerException("nonNull is marked non-null but is null"); + } + return ((this.nonNull == nonNull) ? this : new WithOnClass3(this.couldBeNull, nonNull)); + } +} +@lombok.With @lombok.experimental.Accessors(prefix = "f") class WithOnClass4 { + final int fX = 10; + final int fY; + WithOnClass4(int y) { + super(); + this.fY = y; + } + public @java.lang.SuppressWarnings("all") WithOnClass4 withY(final int fY) { + return ((this.fY == fY) ? this : new WithOnClass4(fY)); + } +} diff --git a/test/transform/resource/after-ecj/WithOnStatic.java b/test/transform/resource/after-ecj/WithOnStatic.java new file mode 100644 index 00000000..7094ae5e --- /dev/null +++ b/test/transform/resource/after-ecj/WithOnStatic.java @@ -0,0 +1,9 @@ +class WithOnStatic { + static @lombok.With boolean foo; + static @lombok.With int bar; + <clinit>() { + } + WithOnStatic() { + super(); + } +} diff --git a/test/transform/resource/after-ecj/WithPlain.java b/test/transform/resource/after-ecj/WithPlain.java new file mode 100644 index 00000000..4203f540 --- /dev/null +++ b/test/transform/resource/after-ecj/WithPlain.java @@ -0,0 +1,16 @@ +import lombok.With; +class WithPlain { + @lombok.With int i; + final @With int foo; + WithPlain(int i, int foo) { + super(); + this.i = i; + this.foo = foo; + } + public @java.lang.SuppressWarnings("all") WithPlain withI(final int i) { + return ((this.i == i) ? this : new WithPlain(i, this.foo)); + } + public @java.lang.SuppressWarnings("all") WithPlain withFoo(final int foo) { + return ((this.foo == foo) ? this : new WithPlain(this.i, foo)); + } +} diff --git a/test/transform/resource/after-ecj/WithWithDollar.java b/test/transform/resource/after-ecj/WithWithDollar.java new file mode 100644 index 00000000..1fa830d4 --- /dev/null +++ b/test/transform/resource/after-ecj/WithWithDollar.java @@ -0,0 +1,6 @@ +class WithWithDollar { + @lombok.With int $i; + WithWithDollar() { + super(); + } +} diff --git a/test/transform/resource/after-ecj/WithWithGenerics.java b/test/transform/resource/after-ecj/WithWithGenerics.java new file mode 100644 index 00000000..b6985b99 --- /dev/null +++ b/test/transform/resource/after-ecj/WithWithGenerics.java @@ -0,0 +1,18 @@ +class WithWithGenerics<T, J extends T, L extends java.lang.Number> { + @lombok.With J test; + @lombok.With java.util.List<L> test2; + @lombok.With java.util.List<? extends L> test3; + int $i; + public WithWithGenerics(J test, java.util.List<L> test2, java.util.List<? extends L> test3) { + super(); + } + public @java.lang.SuppressWarnings("all") WithWithGenerics<T, J, L> withTest(final J test) { + return ((this.test == test) ? this : new WithWithGenerics<T, J, L>(test, this.test2, this.test3)); + } + public @java.lang.SuppressWarnings("all") WithWithGenerics<T, J, L> withTest2(final java.util.List<L> test2) { + return ((this.test2 == test2) ? this : new WithWithGenerics<T, J, L>(this.test, test2, this.test3)); + } + public @java.lang.SuppressWarnings("all") WithWithGenerics<T, J, L> withTest3(final java.util.List<? extends L> test3) { + return ((this.test3 == test3) ? this : new WithWithGenerics<T, J, L>(this.test, this.test2, test3)); + } +} diff --git a/test/transform/resource/after-ecj/WitherTypeAnnos.java b/test/transform/resource/after-ecj/WithWithTypeAnnos.java index e41d9e13..ff73869b 100644 --- a/test/transform/resource/after-ecj/WitherTypeAnnos.java +++ b/test/transform/resource/after-ecj/WithWithTypeAnnos.java @@ -1,4 +1,4 @@ -import lombok.experimental.Wither; +import lombok.With; import java.lang.annotation.ElementType; import java.lang.annotation.Target; import java.util.List; @@ -6,13 +6,13 @@ import java.util.List; } @Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TB { } -class WitherTypeAnnos { - final @Wither @TA @TB List<String> foo; - WitherTypeAnnos(@TA @TB List<String> foo) { +class WithWithTypeAnnos { + final @With @TA @TB List<String> foo; + WithWithTypeAnnos(@TA @TB List<String> foo) { super(); this.foo = foo; } - public @java.lang.SuppressWarnings("all") WitherTypeAnnos withFoo(final @TA List<String> foo) { - return ((this.foo == foo) ? this : new WitherTypeAnnos(foo)); + public @java.lang.SuppressWarnings("all") WithWithTypeAnnos withFoo(final @TA List<String> foo) { + return ((this.foo == foo) ? this : new WithWithTypeAnnos(foo)); } } diff --git a/test/transform/resource/after-ecj/WitherAlreadyExists.java b/test/transform/resource/after-ecj/WitherAlreadyExists.java deleted file mode 100644 index ded10755..00000000 --- a/test/transform/resource/after-ecj/WitherAlreadyExists.java +++ /dev/null @@ -1,78 +0,0 @@ -class Wither1 { - @lombok.experimental.Wither boolean foo; - void withFoo(boolean foo) { - } - Wither1(boolean foo) { - super(); - } -} -class Wither2 { - @lombok.experimental.Wither boolean foo; - void withFoo(String foo) { - } - Wither2(boolean foo) { - super(); - } -} -class Wither3 { - @lombok.experimental.Wither String foo; - void withFoo(boolean foo) { - } - Wither3(String foo) { - super(); - } -} -class Wither4 { - @lombok.experimental.Wither String foo; - void withFoo(String foo) { - } - Wither4(String foo) { - super(); - } -} -class Wither5 { - @lombok.experimental.Wither String foo; - void withFoo() { - } - Wither5(String foo) { - super(); - } - public @java.lang.SuppressWarnings("all") Wither5 withFoo(final String foo) { - return ((this.foo == foo) ? this : new Wither5(foo)); - } -} -class Wither6 { - @lombok.experimental.Wither String foo; - void withFoo(String foo, int x) { - } - Wither6(String foo) { - super(); - } - public @java.lang.SuppressWarnings("all") Wither6 withFoo(final String foo) { - return ((this.foo == foo) ? this : new Wither6(foo)); - } -} -class Wither7 { - @lombok.experimental.Wither String foo; - void withFoo(String foo, Object... x) { - } - Wither7(String foo) { - super(); - } -} -class Wither8 { - @lombok.experimental.Wither boolean isFoo; - void withIsFoo(boolean foo) { - } - Wither8(boolean foo) { - super(); - } -} -class Wither9 { - @lombok.experimental.Wither boolean isFoo; - void withFoo(boolean foo) { - } - Wither9(boolean foo) { - super(); - } -} diff --git a/test/transform/resource/after-ecj/WitherAndAllArgsConstructor.java b/test/transform/resource/after-ecj/WitherAndAllArgsConstructor.java deleted file mode 100644 index 10e993e1..00000000 --- a/test/transform/resource/after-ecj/WitherAndAllArgsConstructor.java +++ /dev/null @@ -1,20 +0,0 @@ -@lombok.AllArgsConstructor class WitherAndAllArgsConstructor<T, J extends T, L extends java.lang.Number> { - @lombok.experimental.Wither J test; - @lombok.experimental.Wither java.util.List<L> test2; - final int x = 10; - int y = 20; - final int z; - public @java.lang.SuppressWarnings("all") WitherAndAllArgsConstructor<T, J, L> withTest(final J test) { - return ((this.test == test) ? this : new WitherAndAllArgsConstructor<T, J, L>(test, this.test2, this.y, this.z)); - } - public @java.lang.SuppressWarnings("all") WitherAndAllArgsConstructor<T, J, L> withTest2(final java.util.List<L> test2) { - return ((this.test2 == test2) ? this : new WitherAndAllArgsConstructor<T, J, L>(this.test, test2, this.y, this.z)); - } - public @java.lang.SuppressWarnings("all") WitherAndAllArgsConstructor(final J test, final java.util.List<L> test2, final int y, final int z) { - super(); - this.test = test; - this.test2 = test2; - this.y = y; - this.z = z; - } -} diff --git a/test/transform/resource/after-ecj/WitherDeprecated.java b/test/transform/resource/after-ecj/WitherDeprecated.java deleted file mode 100644 index b57d0d79..00000000 --- a/test/transform/resource/after-ecj/WitherDeprecated.java +++ /dev/null @@ -1,14 +0,0 @@ -import lombok.experimental.Wither; -class WitherDeprecated { - @Deprecated @Wither int annotation; - @Wither int javadoc; - WitherDeprecated(int annotation, int javadoc) { - super(); - } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") WitherDeprecated withAnnotation(final int annotation) { - return ((this.annotation == annotation) ? this : new WitherDeprecated(annotation, this.javadoc)); - } - public @java.lang.Deprecated @java.lang.SuppressWarnings("all") WitherDeprecated withJavadoc(final int javadoc) { - return ((this.javadoc == javadoc) ? this : new WitherDeprecated(this.annotation, javadoc)); - } -} diff --git a/test/transform/resource/after-ecj/WitherOnClass.java b/test/transform/resource/after-ecj/WitherOnClass.java deleted file mode 100644 index 166d1842..00000000 --- a/test/transform/resource/after-ecj/WitherOnClass.java +++ /dev/null @@ -1,52 +0,0 @@ -@lombok.experimental.Wither class WitherOnClass1 { - @lombok.experimental.Wither(lombok.AccessLevel.NONE) boolean isNone; - boolean isPublic; - WitherOnClass1(boolean isNone, boolean isPublic) { - super(); - } - public @java.lang.SuppressWarnings("all") WitherOnClass1 withPublic(final boolean isPublic) { - return ((this.isPublic == isPublic) ? this : new WitherOnClass1(this.isNone, isPublic)); - } -} -@lombok.experimental.Wither(lombok.AccessLevel.PROTECTED) class WitherOnClass2 { - @lombok.experimental.Wither(lombok.AccessLevel.NONE) boolean isNone; - boolean isProtected; - @lombok.experimental.Wither(lombok.AccessLevel.PACKAGE) boolean isPackage; - WitherOnClass2(boolean isNone, boolean isProtected, boolean isPackage) { - super(); - } - @java.lang.SuppressWarnings("all") WitherOnClass2 withPackage(final boolean isPackage) { - return ((this.isPackage == isPackage) ? this : new WitherOnClass2(this.isNone, this.isProtected, isPackage)); - } - protected @java.lang.SuppressWarnings("all") WitherOnClass2 withProtected(final boolean isProtected) { - return ((this.isProtected == isProtected) ? this : new WitherOnClass2(this.isNone, isProtected, this.isPackage)); - } -} -@lombok.experimental.Wither class WitherOnClass3 { - String couldBeNull; - @lombok.NonNull String nonNull; - WitherOnClass3(String couldBeNull, String nonNull) { - super(); - } - public @java.lang.SuppressWarnings("all") WitherOnClass3 withCouldBeNull(final String couldBeNull) { - return ((this.couldBeNull == couldBeNull) ? this : new WitherOnClass3(couldBeNull, this.nonNull)); - } - public @java.lang.SuppressWarnings("all") WitherOnClass3 withNonNull(final @lombok.NonNull String nonNull) { - if ((nonNull == null)) - { - throw new java.lang.NullPointerException("nonNull is marked non-null but is null"); - } - return ((this.nonNull == nonNull) ? this : new WitherOnClass3(this.couldBeNull, nonNull)); - } -} -@lombok.experimental.Wither @lombok.experimental.Accessors(prefix = "f") class WitherOnClass4 { - final int fX = 10; - final int fY; - WitherOnClass4(int y) { - super(); - this.fY = y; - } - public @java.lang.SuppressWarnings("all") WitherOnClass4 withY(final int fY) { - return ((this.fY == fY) ? this : new WitherOnClass4(fY)); - } -} diff --git a/test/transform/resource/after-ecj/WitherOnStatic.java b/test/transform/resource/after-ecj/WitherOnStatic.java deleted file mode 100644 index 8f385e09..00000000 --- a/test/transform/resource/after-ecj/WitherOnStatic.java +++ /dev/null @@ -1,9 +0,0 @@ -class WitherOnStatic { - static @lombok.experimental.Wither boolean foo; - static @lombok.experimental.Wither int bar; - <clinit>() { - } - WitherOnStatic() { - super(); - } -} diff --git a/test/transform/resource/after-ecj/WitherPlain.java b/test/transform/resource/after-ecj/WitherPlain.java deleted file mode 100644 index ae1988bc..00000000 --- a/test/transform/resource/after-ecj/WitherPlain.java +++ /dev/null @@ -1,16 +0,0 @@ -import lombok.experimental.Wither; -class WitherPlain { - @lombok.experimental.Wither int i; - final @Wither int foo; - WitherPlain(int i, int foo) { - super(); - this.i = i; - this.foo = foo; - } - public @java.lang.SuppressWarnings("all") WitherPlain withI(final int i) { - return ((this.i == i) ? this : new WitherPlain(i, this.foo)); - } - public @java.lang.SuppressWarnings("all") WitherPlain withFoo(final int foo) { - return ((this.foo == foo) ? this : new WitherPlain(this.i, foo)); - } -} diff --git a/test/transform/resource/after-ecj/WitherWithAbstract.java b/test/transform/resource/after-ecj/WitherWithAbstract.java deleted file mode 100644 index ed71347e..00000000 --- a/test/transform/resource/after-ecj/WitherWithAbstract.java +++ /dev/null @@ -1,7 +0,0 @@ -abstract class WitherWithAbstract { - @lombok.experimental.Wither String foo; - WitherWithAbstract() { - super(); - } - public abstract @java.lang.SuppressWarnings("all") WitherWithAbstract withFoo(final String foo); -} diff --git a/test/transform/resource/after-ecj/WitherWithDollar.java b/test/transform/resource/after-ecj/WitherWithDollar.java deleted file mode 100644 index db46e259..00000000 --- a/test/transform/resource/after-ecj/WitherWithDollar.java +++ /dev/null @@ -1,6 +0,0 @@ -class WitherWithDollar { - @lombok.experimental.Wither int $i; - WitherWithDollar() { - super(); - } -} diff --git a/test/transform/resource/after-ecj/WitherWithGenerics.java b/test/transform/resource/after-ecj/WitherWithGenerics.java deleted file mode 100644 index ee73297c..00000000 --- a/test/transform/resource/after-ecj/WitherWithGenerics.java +++ /dev/null @@ -1,18 +0,0 @@ -class WitherWithGenerics<T, J extends T, L extends java.lang.Number> { - @lombok.experimental.Wither J test; - @lombok.experimental.Wither java.util.List<L> test2; - @lombok.experimental.Wither java.util.List<? extends L> test3; - int $i; - public WitherWithGenerics(J test, java.util.List<L> test2, java.util.List<? extends L> test3) { - super(); - } - public @java.lang.SuppressWarnings("all") WitherWithGenerics<T, J, L> withTest(final J test) { - return ((this.test == test) ? this : new WitherWithGenerics<T, J, L>(test, this.test2, this.test3)); - } - public @java.lang.SuppressWarnings("all") WitherWithGenerics<T, J, L> withTest2(final java.util.List<L> test2) { - return ((this.test2 == test2) ? this : new WitherWithGenerics<T, J, L>(this.test, test2, this.test3)); - } - public @java.lang.SuppressWarnings("all") WitherWithGenerics<T, J, L> withTest3(final java.util.List<? extends L> test3) { - return ((this.test3 == test3) ? this : new WitherWithGenerics<T, J, L>(this.test, this.test2, test3)); - } -} |