diff options
Diffstat (limited to 'test/transform/resource')
79 files changed, 693 insertions, 691 deletions
diff --git a/test/transform/resource/after-delombok/SetterAndWitherJavadoc.java b/test/transform/resource/after-delombok/SetterAndWithMethodJavadoc.java index 8c0505e7..97524b9d 100644 --- a/test/transform/resource/after-delombok/SetterAndWitherJavadoc.java +++ b/test/transform/resource/after-delombok/SetterAndWithMethodJavadoc.java @@ -1,4 +1,4 @@ -class SetterAndWitherJavadoc { +class SetterAndWithMethodJavadoc { /** * Some value. */ @@ -7,7 +7,7 @@ class SetterAndWitherJavadoc { * Some other value. */ int j; - SetterAndWitherJavadoc(int i, int j) { + SetterAndWithMethodJavadoc(int i, int j) { this.i = i; this.j = j; } @@ -24,8 +24,8 @@ class SetterAndWitherJavadoc { * @param the new value */ @java.lang.SuppressWarnings("all") - public SetterAndWitherJavadoc withI(final int i) { - return this.i == i ? this : new SetterAndWitherJavadoc(i, this.j); + public SetterAndWithMethodJavadoc withI(final int i) { + return this.i == i ? this : new SetterAndWithMethodJavadoc(i, this.j); } /** * Set some other value. @@ -40,7 +40,7 @@ class SetterAndWitherJavadoc { * @param the other new other value */ @java.lang.SuppressWarnings("all") - public SetterAndWitherJavadoc withJ(final int j) { - return this.j == j ? this : new SetterAndWitherJavadoc(this.i, j); + public SetterAndWithMethodJavadoc withJ(final int j) { + return this.j == j ? this : new SetterAndWithMethodJavadoc(this.i, j); } } diff --git a/test/transform/resource/after-delombok/WithAlreadyExists.java b/test/transform/resource/after-delombok/WithAlreadyExists.java new file mode 100644 index 00000000..a9cb975d --- /dev/null +++ b/test/transform/resource/after-delombok/WithAlreadyExists.java @@ -0,0 +1,71 @@ +class With1 { + boolean foo; + void withFoo(boolean foo) { + } + With1(boolean foo) { + } +} +class With2 { + boolean foo; + void withFoo(String foo) { + } + With2(boolean foo) { + } +} +class With3 { + String foo; + void withFoo(boolean foo) { + } + With3(String foo) { + } +} +class With4 { + String foo; + void withFoo(String foo) { + } + With4(String foo) { + } +} +class With5 { + String foo; + void withFoo() { + } + With5(String foo) { + } + @java.lang.SuppressWarnings("all") + public With5 withFoo(final String foo) { + return this.foo == foo ? this : new With5(foo); + } +} +class With6 { + String foo; + void withFoo(String foo, int x) { + } + With6(String foo) { + } + @java.lang.SuppressWarnings("all") + public With6 withFoo(final String foo) { + return this.foo == foo ? this : new With6(foo); + } +} +class With7 { + String foo; + void withFoo(String foo, Object... x) { + } + With7(String foo) { + } +} +class With8 { + boolean isFoo; + void withIsFoo(boolean foo) { + } + With8(boolean foo) { + } +} +class With9 { + boolean isFoo; + void withFoo(boolean foo) { + } + With9(boolean foo) { + } +} diff --git a/test/transform/resource/after-delombok/WithAndAllArgsConstructor.java b/test/transform/resource/after-delombok/WithAndAllArgsConstructor.java new file mode 100644 index 00000000..131e792c --- /dev/null +++ b/test/transform/resource/after-delombok/WithAndAllArgsConstructor.java @@ -0,0 +1,22 @@ +class WithAndAllArgsConstructor<T, J extends T, L extends java.lang.Number> { + J test; + java.util.List<L> test2; + final int x = 10; + int y = 20; + final int z; + @java.lang.SuppressWarnings("all") + public WithAndAllArgsConstructor(final J test, final java.util.List<L> test2, final int y, final int z) { + this.test = test; + this.test2 = test2; + this.y = y; + this.z = z; + } + @java.lang.SuppressWarnings("all") + public 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); + } + @java.lang.SuppressWarnings("all") + public 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); + } +} diff --git a/test/transform/resource/after-delombok/WithMethodAbstract.java b/test/transform/resource/after-delombok/WithMethodAbstract.java new file mode 100644 index 00000000..16f6f060 --- /dev/null +++ b/test/transform/resource/after-delombok/WithMethodAbstract.java @@ -0,0 +1,5 @@ +abstract class WithMethodAbstract { + String foo; + @java.lang.SuppressWarnings("all") + public abstract WithMethodAbstract withFoo(final String foo); +} diff --git a/test/transform/resource/after-delombok/WithMethodMarkedDeprecated.java b/test/transform/resource/after-delombok/WithMethodMarkedDeprecated.java new file mode 100644 index 00000000..03b96d33 --- /dev/null +++ b/test/transform/resource/after-delombok/WithMethodMarkedDeprecated.java @@ -0,0 +1,23 @@ +class WithMethodMarkedDeprecated { + @Deprecated + int annotation; + /** + * @deprecated + */ + int javadoc; + WithMethodMarkedDeprecated(int annotation, int javadoc) { + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public WithMethodMarkedDeprecated withAnnotation(final int annotation) { + return this.annotation == annotation ? this : new WithMethodMarkedDeprecated(annotation, this.javadoc); + } + /** + * @deprecated + */ + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public WithMethodMarkedDeprecated withJavadoc(final int javadoc) { + return this.javadoc == javadoc ? this : new WithMethodMarkedDeprecated(this.annotation, javadoc); + } +} diff --git a/test/transform/resource/after-delombok/WithOnClass.java b/test/transform/resource/after-delombok/WithOnClass.java new file mode 100644 index 00000000..d6fb6fdf --- /dev/null +++ b/test/transform/resource/after-delombok/WithOnClass.java @@ -0,0 +1,54 @@ +class WithOnClass1 { + boolean isNone; + boolean isPublic; + WithOnClass1(boolean isNone, boolean isPublic) { + } + @java.lang.SuppressWarnings("all") + public WithOnClass1 withPublic(final boolean isPublic) { + return this.isPublic == isPublic ? this : new WithOnClass1(this.isNone, isPublic); + } +} +class WithOnClass2 { + boolean isNone; + boolean isProtected; + boolean isPackage; + WithOnClass2(boolean isNone, boolean isProtected, boolean isPackage) { + } + @java.lang.SuppressWarnings("all") + protected WithOnClass2 withProtected(final boolean isProtected) { + return this.isProtected == isProtected ? this : new WithOnClass2(this.isNone, isProtected, this.isPackage); + } + @java.lang.SuppressWarnings("all") + WithOnClass2 withPackage(final boolean isPackage) { + return this.isPackage == isPackage ? this : new WithOnClass2(this.isNone, this.isProtected, isPackage); + } +} +class WithOnClass3 { + String couldBeNull; + @lombok.NonNull + String nonNull; + WithOnClass3(String couldBeNull, String nonNull) { + } + @java.lang.SuppressWarnings("all") + public WithOnClass3 withCouldBeNull(final String couldBeNull) { + return this.couldBeNull == couldBeNull ? this : new WithOnClass3(couldBeNull, this.nonNull); + } + @java.lang.SuppressWarnings("all") + public WithOnClass3 withNonNull(@lombok.NonNull final 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); + } +} +class WithOnClass4 { + final int fX = 10; + final int fY; + WithOnClass4(int y) { + this.fY = y; + } + @java.lang.SuppressWarnings("all") + public WithOnClass4 withY(final int fY) { + return this.fY == fY ? this : new WithOnClass4(fY); + } +} diff --git a/test/transform/resource/after-delombok/WitherOnStatic.java b/test/transform/resource/after-delombok/WithOnStatic.java index e481beb7..b234f0d6 100644 --- a/test/transform/resource/after-delombok/WitherOnStatic.java +++ b/test/transform/resource/after-delombok/WithOnStatic.java @@ -1,4 +1,4 @@ -class WitherOnStatic { +class WithOnStatic { static boolean foo; static int bar; } diff --git a/test/transform/resource/after-delombok/WithPlain.java b/test/transform/resource/after-delombok/WithPlain.java new file mode 100644 index 00000000..1a6ff22f --- /dev/null +++ b/test/transform/resource/after-delombok/WithPlain.java @@ -0,0 +1,16 @@ +class WithPlain { + int i; + final int foo; + WithPlain(int i, int foo) { + this.i = i; + this.foo = foo; + } + @java.lang.SuppressWarnings("all") + public WithPlain withI(final int i) { + return this.i == i ? this : new WithPlain(i, this.foo); + } + @java.lang.SuppressWarnings("all") + public WithPlain withFoo(final int foo) { + return this.foo == foo ? this : new WithPlain(this.i, foo); + } +} diff --git a/test/transform/resource/after-delombok/WithWithDollar.java b/test/transform/resource/after-delombok/WithWithDollar.java new file mode 100644 index 00000000..79abcc12 --- /dev/null +++ b/test/transform/resource/after-delombok/WithWithDollar.java @@ -0,0 +1,3 @@ +class WithWithDollar { + int $i; +} diff --git a/test/transform/resource/after-delombok/WithWithGenerics.java b/test/transform/resource/after-delombok/WithWithGenerics.java new file mode 100644 index 00000000..ac34f01a --- /dev/null +++ b/test/transform/resource/after-delombok/WithWithGenerics.java @@ -0,0 +1,20 @@ +class WithWithGenerics<T, J extends T, L extends java.lang.Number> { + J test; + java.util.List<L> test2; + java.util.List<? extends L> test3; + int $i; + public WithWithGenerics(J test, java.util.List<L> test2, java.util.List<? extends L> test3) { + } + @java.lang.SuppressWarnings("all") + public WithWithGenerics<T, J, L> withTest(final J test) { + return this.test == test ? this : new WithWithGenerics<T, J, L>(test, this.test2, this.test3); + } + @java.lang.SuppressWarnings("all") + public 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); + } + @java.lang.SuppressWarnings("all") + public 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-delombok/WitherTypeAnnos.java b/test/transform/resource/after-delombok/WithWithTypeAnnos.java index b57438af..bf7559ba 100644 --- a/test/transform/resource/after-delombok/WitherTypeAnnos.java +++ b/test/transform/resource/after-delombok/WithWithTypeAnnos.java @@ -7,15 +7,15 @@ import java.util.List; @Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) @interface TB { } -class WitherTypeAnnos { +class WithWithTypeAnnos { @TA @TB final List<String> foo; - WitherTypeAnnos(@TA @TB List<String> foo) { + WithWithTypeAnnos(@TA @TB List<String> foo) { this.foo = foo; } @java.lang.SuppressWarnings("all") - public WitherTypeAnnos withFoo(@TA final List<String> foo) { - return this.foo == foo ? this : new WitherTypeAnnos(foo); + public WithWithTypeAnnos withFoo(@TA final List<String> foo) { + return this.foo == foo ? this : new WithWithTypeAnnos(foo); } } diff --git a/test/transform/resource/after-delombok/WitherAlreadyExists.java b/test/transform/resource/after-delombok/WitherAlreadyExists.java deleted file mode 100644 index d609bc7b..00000000 --- a/test/transform/resource/after-delombok/WitherAlreadyExists.java +++ /dev/null @@ -1,71 +0,0 @@ -class Wither1 { - boolean foo; - void withFoo(boolean foo) { - } - Wither1(boolean foo) { - } -} -class Wither2 { - boolean foo; - void withFoo(String foo) { - } - Wither2(boolean foo) { - } -} -class Wither3 { - String foo; - void withFoo(boolean foo) { - } - Wither3(String foo) { - } -} -class Wither4 { - String foo; - void withFoo(String foo) { - } - Wither4(String foo) { - } -} -class Wither5 { - String foo; - void withFoo() { - } - Wither5(String foo) { - } - @java.lang.SuppressWarnings("all") |
