From c11edbf032ce27e448faa00d37245665942095af Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 26 Aug 2019 21:41:10 +0200 Subject: [With] renaming lombok.experimental.Wither to lombok.experimental.With --- .../resource/before/BuilderInvalidUse.java | 2 +- .../resource/before/CheckerFrameworkBasic.java | 4 +- test/transform/resource/before/FlagUsages.java | 3 +- .../before/SetterAndWithMethodJavadoc.java | 26 +++++++ .../resource/before/SetterAndWitherJavadoc.java | 26 ------- .../resource/before/WithAlreadyExists.java | 89 ++++++++++++++++++++++ .../resource/before/WithAndAllArgsConstructor.java | 12 +++ .../resource/before/WithMethodAbstract.java | 3 + .../before/WithMethodMarkedDeprecated.java | 15 ++++ test/transform/resource/before/WithOnClass.java | 45 +++++++++++ test/transform/resource/before/WithOnStatic.java | 4 + test/transform/resource/before/WithPlain.java | 10 +++ test/transform/resource/before/WithWithDollar.java | 3 + .../resource/before/WithWithGenerics.java | 9 +++ .../resource/before/WithWithTypeAnnos.java | 18 +++++ .../resource/before/WitherAlreadyExists.java | 89 ---------------------- .../before/WitherAndAllArgsConstructor.java | 12 --- .../resource/before/WitherDeprecated.java | 15 ---- test/transform/resource/before/WitherOnClass.java | 45 ----------- test/transform/resource/before/WitherOnStatic.java | 4 - test/transform/resource/before/WitherPlain.java | 10 --- .../transform/resource/before/WitherTypeAnnos.java | 18 ----- .../resource/before/WitherWithAbstract.java | 3 - .../resource/before/WitherWithDollar.java | 3 - .../resource/before/WitherWithGenerics.java | 9 --- 25 files changed, 239 insertions(+), 238 deletions(-) create mode 100644 test/transform/resource/before/SetterAndWithMethodJavadoc.java delete mode 100644 test/transform/resource/before/SetterAndWitherJavadoc.java create mode 100644 test/transform/resource/before/WithAlreadyExists.java create mode 100644 test/transform/resource/before/WithAndAllArgsConstructor.java create mode 100644 test/transform/resource/before/WithMethodAbstract.java create mode 100644 test/transform/resource/before/WithMethodMarkedDeprecated.java create mode 100644 test/transform/resource/before/WithOnClass.java create mode 100644 test/transform/resource/before/WithOnStatic.java create mode 100644 test/transform/resource/before/WithPlain.java create mode 100644 test/transform/resource/before/WithWithDollar.java create mode 100644 test/transform/resource/before/WithWithGenerics.java create mode 100644 test/transform/resource/before/WithWithTypeAnnos.java delete mode 100644 test/transform/resource/before/WitherAlreadyExists.java delete mode 100644 test/transform/resource/before/WitherAndAllArgsConstructor.java delete mode 100644 test/transform/resource/before/WitherDeprecated.java delete mode 100644 test/transform/resource/before/WitherOnClass.java delete mode 100644 test/transform/resource/before/WitherOnStatic.java delete mode 100644 test/transform/resource/before/WitherPlain.java delete mode 100644 test/transform/resource/before/WitherTypeAnnos.java delete mode 100644 test/transform/resource/before/WitherWithAbstract.java delete mode 100644 test/transform/resource/before/WitherWithDollar.java delete mode 100644 test/transform/resource/before/WitherWithGenerics.java (limited to 'test/transform/resource/before') diff --git a/test/transform/resource/before/BuilderInvalidUse.java b/test/transform/resource/before/BuilderInvalidUse.java index 1a5f2950..3945e64c 100644 --- a/test/transform/resource/before/BuilderInvalidUse.java +++ b/test/transform/resource/before/BuilderInvalidUse.java @@ -3,7 +3,7 @@ class BuilderInvalidUse { private int something; - @lombok.Getter @lombok.Setter @lombok.experimental.FieldDefaults(makeFinal = true) @lombok.experimental.Wither @lombok.Data @lombok.ToString @lombok.EqualsAndHashCode + @lombok.Getter @lombok.Setter @lombok.experimental.FieldDefaults(makeFinal = true) @lombok.With @lombok.Data @lombok.ToString @lombok.EqualsAndHashCode @lombok.AllArgsConstructor public static class BuilderInvalidUseBuilder { diff --git a/test/transform/resource/before/CheckerFrameworkBasic.java b/test/transform/resource/before/CheckerFrameworkBasic.java index 5b59165a..7dd40b54 100644 --- a/test/transform/resource/before/CheckerFrameworkBasic.java +++ b/test/transform/resource/before/CheckerFrameworkBasic.java @@ -1,11 +1,11 @@ //CONF: checkerframework = 3.0 import lombok.Data; import lombok.experimental.Accessors; -import lombok.experimental.Wither; +import lombok.With; @Data @Accessors(chain = true) class CheckerFrameworkBasic { - @Wither private final int x; + @With private final int x; private final int y; private int z; } diff --git a/test/transform/resource/before/FlagUsages.java b/test/transform/resource/before/FlagUsages.java index 6631224f..df3e8044 100644 --- a/test/transform/resource/before/FlagUsages.java +++ b/test/transform/resource/before/FlagUsages.java @@ -1,10 +1,11 @@ //skip compare content //CONF: lombok.Getter.flagUsage = WARNING //CONF: lombok.experimental.flagUsage = ERROR +@lombok.experimental.FieldNameConstants public class FlagUsages { @lombok.Getter String x; - @lombok.experimental.Wither String z; + String z; public FlagUsages(String x, String y) { } diff --git a/test/transform/resource/before/SetterAndWithMethodJavadoc.java b/test/transform/resource/before/SetterAndWithMethodJavadoc.java new file mode 100644 index 00000000..ba10b7f2 --- /dev/null +++ b/test/transform/resource/before/SetterAndWithMethodJavadoc.java @@ -0,0 +1,26 @@ +import lombok.With; +class SetterAndWithMethodJavadoc { + /** + * Some value. + * @param the new value + */ + @lombok.Setter @lombok.With int i; + + /** + * Some other value. + * + * --- SETTER --- + * Set some other value. + * @param the new other value + * + * --- WITH --- + * Reinstantiate with some other value. + * @param the other new other value + */ + @lombok.Setter @lombok.With int j; + + SetterAndWithMethodJavadoc(int i, int j) { + this.i = i; + this.j = j; + } +} diff --git a/test/transform/resource/before/SetterAndWitherJavadoc.java b/test/transform/resource/before/SetterAndWitherJavadoc.java deleted file mode 100644 index 6953eb39..00000000 --- a/test/transform/resource/before/SetterAndWitherJavadoc.java +++ /dev/null @@ -1,26 +0,0 @@ -import lombok.experimental.Wither; -class SetterAndWitherJavadoc { - /** - * Some value. - * @param the new value - */ - @lombok.Setter @lombok.experimental.Wither int i; - - /** - * Some other value. - * - * --- SETTER --- - * Set some other value. - * @param the new other value - * - * --- WITHER --- - * Reinstantiate with some other value. - * @param the other new other value - */ - @lombok.Setter @lombok.experimental.Wither int j; - - SetterAndWitherJavadoc(int i, int j) { - this.i = i; - this.j = j; - } -} diff --git a/test/transform/resource/before/WithAlreadyExists.java b/test/transform/resource/before/WithAlreadyExists.java new file mode 100644 index 00000000..ac1414b6 --- /dev/null +++ b/test/transform/resource/before/WithAlreadyExists.java @@ -0,0 +1,89 @@ +class With1 { + @lombok.With boolean foo; + + void withFoo(boolean foo) { + } + + With1(boolean foo) { + } +} + +class With2 { + @lombok.With boolean foo; + + void withFoo(String foo) { + } + + With2(boolean foo) { + } +} + +class With3 { + @lombok.With String foo; + + void withFoo(boolean foo) { + } + + With3(String foo) { + } +} + +class With4 { + @lombok.With String foo; + + void withFoo(String foo) { + } + + With4(String foo) { + } +} + +class With5 { + @lombok.With String foo; + + void withFoo() { + } + + With5(String foo) { + } +} + +class With6 { + @lombok.With String foo; + + void withFoo(String foo, int x) { + } + + With6(String foo) { + } +} + +class With7 { + @lombok.With String foo; + + void withFoo(String foo, Object... x) { + } + + With7(String foo) { + } +} + +class With8 { + @lombok.With boolean isFoo; + + void withIsFoo(boolean foo) { + } + + With8(boolean foo) { + } +} + +class With9 { + @lombok.With boolean isFoo; + + void withFoo(boolean foo) { + } + + With9(boolean foo) { + } +} diff --git a/test/transform/resource/before/WithAndAllArgsConstructor.java b/test/transform/resource/before/WithAndAllArgsConstructor.java new file mode 100644 index 00000000..d11d4faa --- /dev/null +++ b/test/transform/resource/before/WithAndAllArgsConstructor.java @@ -0,0 +1,12 @@ +@lombok.AllArgsConstructor +class WithAndAllArgsConstructor { + @lombok.With J test; + + @lombok.With java.util.List test2; + + final int x = 10; + + int y = 20; + + final int z; +} \ No newline at end of file diff --git a/test/transform/resource/before/WithMethodAbstract.java b/test/transform/resource/before/WithMethodAbstract.java new file mode 100644 index 00000000..fd6edbc9 --- /dev/null +++ b/test/transform/resource/before/WithMethodAbstract.java @@ -0,0 +1,3 @@ +abstract class WithMethodAbstract { + @lombok.With String foo; +} \ No newline at end of file diff --git a/test/transform/resource/before/WithMethodMarkedDeprecated.java b/test/transform/resource/before/WithMethodMarkedDeprecated.java new file mode 100644 index 00000000..7a6549e5 --- /dev/null +++ b/test/transform/resource/before/WithMethodMarkedDeprecated.java @@ -0,0 +1,15 @@ +import lombok.With; + +class WithMethodMarkedDeprecated { + + @Deprecated + @With int annotation; + + /** + * @deprecated + */ + @With int javadoc; + + WithMethodMarkedDeprecated(int annotation, int javadoc) { + } +} \ No newline at end of file diff --git a/test/transform/resource/before/WithOnClass.java b/test/transform/resource/before/WithOnClass.java new file mode 100644 index 00000000..a6215b54 --- /dev/null +++ b/test/transform/resource/before/WithOnClass.java @@ -0,0 +1,45 @@ +@lombok.With +class WithOnClass1 { + @lombok.With(lombok.AccessLevel.NONE) + boolean isNone; + + boolean isPublic; + + WithOnClass1(boolean isNone, boolean 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) { + } +} + +@lombok.With +class WithOnClass3 { + String couldBeNull; + + @lombok.NonNull String nonNull; + + WithOnClass3(String couldBeNull, String nonNull) { + } +} + +@lombok.With @lombok.experimental.Accessors(prefix="f") +class WithOnClass4 { + final int fX = 10; + + final int fY; + + WithOnClass4(int y) { + this.fY = y; + } +} diff --git a/test/transform/resource/before/WithOnStatic.java b/test/transform/resource/before/WithOnStatic.java new file mode 100644 index 00000000..f8105e0e --- /dev/null +++ b/test/transform/resource/before/WithOnStatic.java @@ -0,0 +1,4 @@ +class WithOnStatic { + @lombok.With static boolean foo; + @lombok.With static int bar; +} diff --git a/test/transform/resource/before/WithPlain.java b/test/transform/resource/before/WithPlain.java new file mode 100644 index 00000000..1b2a19c4 --- /dev/null +++ b/test/transform/resource/before/WithPlain.java @@ -0,0 +1,10 @@ +import lombok.With; +class WithPlain { + @lombok.With int i; + @With final int foo; + + WithPlain(int i, int foo) { + this.i = i; + this.foo = foo; + } +} diff --git a/test/transform/resource/before/WithWithDollar.java b/test/transform/resource/before/WithWithDollar.java new file mode 100644 index 00000000..1dd5d47d --- /dev/null +++ b/test/transform/resource/before/WithWithDollar.java @@ -0,0 +1,3 @@ +class WithWithDollar { + @lombok.With int $i; +} diff --git a/test/transform/resource/before/WithWithGenerics.java b/test/transform/resource/before/WithWithGenerics.java new file mode 100644 index 00000000..d94405d8 --- /dev/null +++ b/test/transform/resource/before/WithWithGenerics.java @@ -0,0 +1,9 @@ +class WithWithGenerics { + @lombok.With J test; + @lombok.With java.util.List test2; + @lombok.With java.util.List test3; + int $i; + + public WithWithGenerics(J test, java.util.List test2, java.util.List test3) { + } +} \ No newline at end of file diff --git a/test/transform/resource/before/WithWithTypeAnnos.java b/test/transform/resource/before/WithWithTypeAnnos.java new file mode 100644 index 00000000..ceef6d61 --- /dev/null +++ b/test/transform/resource/before/WithWithTypeAnnos.java @@ -0,0 +1,18 @@ +//CONF: lombok.copyableAnnotations += TA +import lombok.With; +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TA { +} +@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) +@interface TB { +} +class WithWithTypeAnnos { + @With final @TA @TB List foo; + + WithWithTypeAnnos(@TA @TB List foo) { + this.foo = foo; + } +} diff --git a/test/transform/resource/before/WitherAlreadyExists.java b/test/transform/resource/before/WitherAlreadyExists.java deleted file mode 100644 index 7833173a..00000000 --- a/test/transform/resource/before/WitherAlreadyExists.java +++ /dev/null @@ -1,89 +0,0 @@ -class Wither1 { - @lombok.experimental.Wither boolean foo; - - void withFoo(boolean foo) { - } - - Wither1(boolean foo) { - } -} - -class Wither2 { - @lombok.experimental.Wither boolean foo; - - void withFoo(String foo) { - } - - Wither2(boolean foo) { - } -} - -class Wither3 { - @lombok.experimental.Wither String foo; - - void withFoo(boolean foo) { - } - - Wither3(String foo) { - } -} - -class Wither4 { - @lombok.experimental.Wither String foo; - - void withFoo(String foo) { - } - - Wither4(String foo) { - } -} - -class Wither5 { - @lombok.experimental.Wither String foo; - - void withFoo() { - } - - Wither5(String foo) { - } -} - -class Wither6 { - @lombok.experimental.Wither String foo; - - void withFoo(String foo, int x) { - } - - Wither6(String foo) { - } -} - -class Wither7 { - @lombok.experimental.Wither String foo; - - void withFoo(String foo, Object... x) { - } - - Wither7(String foo) { - } -} - -class Wither8 { - @lombok.experimental.Wither boolean isFoo; - - void withIsFoo(boolean foo) { - } - - Wither8(boolean foo) { - } -} - -class Wither9 { - @lombok.experimental.Wither boolean isFoo; - - void withFoo(boolean foo) { - } - - Wither9(boolean foo) { - } -} diff --git a/test/transform/resource/before/WitherAndAllArgsConstructor.java b/test/transform/resource/before/WitherAndAllArgsConstructor.java deleted file mode 100644 index d531b3f4..00000000 --- a/test/transform/resource/before/WitherAndAllArgsConstructor.java +++ /dev/null @@ -1,12 +0,0 @@ -@lombok.AllArgsConstructor -class WitherAndAllArgsConstructor { - @lombok.experimental.Wither J test; - - @lombok.experimental.Wither java.util.List test2; - - final int x = 10; - - int y = 20; - - final int z; -} \ No newline at end of file diff --git a/test/transform/resource/before/WitherDeprecated.java b/test/transform/resource/before/WitherDeprecated.java deleted file mode 100644 index efd1af43..00000000 --- a/test/transform/resource/before/WitherDeprecated.java +++ /dev/null @@ -1,15 +0,0 @@ -import lombok.experimental.Wither; - -class WitherDeprecated { - - @Deprecated - @Wither int annotation; - - /** - * @deprecated - */ - @Wither int javadoc; - - WitherDeprecated(int annotation, int javadoc) { - } -} \ No newline at end of file diff --git a/test/transform/resource/before/WitherOnClass.java b/test/transform/resource/before/WitherOnClass.java deleted file mode 100644 index d6a3d3c8..00000000 --- a/test/transform/resource/before/WitherOnClass.java +++ /dev/null @@ -1,45 +0,0 @@ -@lombok.experimental.Wither -class WitherOnClass1 { - @lombok.experimental.Wither(lombok.AccessLevel.NONE) - boolean isNone; - - boolean isPublic; - - WitherOnClass1(boolean isNone, boolean 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) { - } -} - -@lombok.experimental.Wither -class WitherOnClass3 { - String couldBeNull; - - @lombok.NonNull String nonNull; - - WitherOnClass3(String couldBeNull, String nonNull) { - } -} - -@lombok.experimental.Wither @lombok.experimental.Accessors(prefix="f") -class WitherOnClass4 { - final int fX = 10; - - final int fY; - - WitherOnClass4(int y) { - this.fY = y; - } -} diff --git a/test/transform/resource/before/WitherOnStatic.java b/test/transform/resource/before/WitherOnStatic.java deleted file mode 100644 index 566c8154..00000000 --- a/test/transform/resource/before/WitherOnStatic.java +++ /dev/null @@ -1,4 +0,0 @@ -class WitherOnStatic { - @lombok.experimental.Wither static boolean foo; - @lombok.experimental.Wither static int bar; -} diff --git a/test/transform/resource/before/WitherPlain.java b/test/transform/resource/before/WitherPlain.java deleted file mode 100644 index 436e6f3b..00000000 --- a/test/transform/resource/before/WitherPlain.java +++ /dev/null @@ -1,10 +0,0 @@ -import lombok.experimental.Wither; -class WitherPlain { - @lombok.experimental.Wither int i; - @Wither final int foo; - - WitherPlain(int i, int foo) { - this.i = i; - this.foo = foo; - } -} diff --git a/test/transform/resource/before/WitherTypeAnnos.java b/test/transform/resource/before/WitherTypeAnnos.java deleted file mode 100644 index 97cd3d9f..00000000 --- a/test/transform/resource/before/WitherTypeAnnos.java +++ /dev/null @@ -1,18 +0,0 @@ -//CONF: lombok.copyableAnnotations += TA -import lombok.experimental.Wither; -import java.lang.annotation.ElementType; -import java.lang.annotation.Target; -import java.util.List; -@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) -@interface TA { -} -@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER}) -@interface TB { -} -class WitherTypeAnnos { - @Wither final @TA @TB List foo; - - WitherTypeAnnos(@TA @TB List foo) { - this.foo = foo; - } -} diff --git a/test/transform/resource/before/WitherWithAbstract.java b/test/transform/resource/before/WitherWithAbstract.java deleted file mode 100644 index acc9094b..00000000 --- a/test/transform/resource/before/WitherWithAbstract.java +++ /dev/null @@ -1,3 +0,0 @@ -abstract class WitherWithAbstract { - @lombok.experimental.Wither String foo; -} \ No newline at end of file diff --git a/test/transform/resource/before/WitherWithDollar.java b/test/transform/resource/before/WitherWithDollar.java deleted file mode 100644 index 8dd2572f..00000000 --- a/test/transform/resource/before/WitherWithDollar.java +++ /dev/null @@ -1,3 +0,0 @@ -class WitherWithDollar { - @lombok.experimental.Wither int $i; -} diff --git a/test/transform/resource/before/WitherWithGenerics.java b/test/transform/resource/before/WitherWithGenerics.java deleted file mode 100644 index 0b0fdd46..00000000 --- a/test/transform/resource/before/WitherWithGenerics.java +++ /dev/null @@ -1,9 +0,0 @@ -class WitherWithGenerics { - @lombok.experimental.Wither J test; - @lombok.experimental.Wither java.util.List test2; - @lombok.experimental.Wither java.util.List test3; - int $i; - - public WitherWithGenerics(J test, java.util.List test2, java.util.List test3) { - } -} \ No newline at end of file -- cgit