diff options
Diffstat (limited to 'test')
25 files changed, 544 insertions, 62 deletions
diff --git a/test/core/src/lombok/DirectoryRunner.java b/test/core/src/lombok/DirectoryRunner.java index 72f01de1..ea15cdb9 100644 --- a/test/core/src/lombok/DirectoryRunner.java +++ b/test/core/src/lombok/DirectoryRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2015 The Project Lombok Authors. + * Copyright (C) 2009-2019 The Project Lombok Authors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -36,6 +36,8 @@ import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunNotifier; public class DirectoryRunner extends Runner { + private static final String DEBUG_FOCUS_ON_FILE = null; + public enum Compiler { DELOMBOK { @Override public int getVersion() { @@ -73,10 +75,11 @@ public class DirectoryRunner extends Runner { public abstract boolean expectChanges(); } - + private static final FileFilter JAVA_FILE_FILTER = new FileFilter() { @Override public boolean accept(File file) { - return file.isFile() && file.getName().endsWith(".java"); + return file.isFile() && file.getName().endsWith(".java") && + (DEBUG_FOCUS_ON_FILE == null || file.getName().equals(DEBUG_FOCUS_ON_FILE)); } }; diff --git a/test/pretty/resource/after/TypeAnnotations.java b/test/pretty/resource/after/TypeAnnotations.java index 760b5ef8..aa93f173 100644 --- a/test/pretty/resource/after/TypeAnnotations.java +++ b/test/pretty/resource/after/TypeAnnotations.java @@ -9,6 +9,12 @@ public class TypeAnnotations { @Target(ElementType.TYPE_USE) @interface Bar { } + @Target(ElementType.TYPE_USE) + @interface Baz { + } + @Target(ElementType.TYPE_USE) + @interface Bat { + } public List<@Foo String> test(@Foo String param) { @Bar String local = "bar"; @@ -19,4 +25,10 @@ public class TypeAnnotations { public <@Foo T extends java.lang.@Foo Number> T test2(@Bar String... varargs) { return null; } + public void test3(String[][] arg, String[]... arg2) { + @Baz + String @Bar [] @Foo [] x; + } + public void test4(@Foo String @Bar [] @Baz [] @Bat ... y) { + } } diff --git a/test/pretty/resource/before/TypeAnnotations.java b/test/pretty/resource/before/TypeAnnotations.java index a39337da..25982a7a 100644 --- a/test/pretty/resource/before/TypeAnnotations.java +++ b/test/pretty/resource/before/TypeAnnotations.java @@ -11,6 +11,12 @@ public class TypeAnnotations { @Target(ElementType.TYPE_USE) @interface Bar {} + @Target(ElementType.TYPE_USE) + @interface Baz {} + + @Target(ElementType.TYPE_USE) + @interface Bat {} + public List<@Foo String> test(@Foo String param) { @Bar String local = "bar"; @Foo java.io.@Foo File[] array = {}; @@ -20,4 +26,11 @@ public class TypeAnnotations { public <@Foo T extends java.lang.@Foo Number> T test2(@Bar String... varargs) { return null; } + + public void test3(String[][] arg, String[]... arg2) { + @Baz String @Bar [] @Foo [] x; + } + + public void test4(@Foo String @Bar [] @Baz [] @Bat ... y) { + } } diff --git a/test/transform/resource/after-delombok/BuilderJavadoc.java b/test/transform/resource/after-delombok/BuilderJavadoc.java new file mode 100644 index 00000000..196ced3b --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderJavadoc.java @@ -0,0 +1,116 @@ +import java.util.List; +class BuilderJavadoc<T> { + /** + * basic gets only a builder setter. + * @see #getsetwith + * + * @return tag is removed from the setter. + */ + private final int basic; + /** + * getsetwith gets a builder setter, an instance getter and setter, and a wither. + */ + private int getsetwith; + /** + * Predef has a predefined builder setter with no javadoc, and the builder setter does not get this one. + * @param tag remains on the field. + * @return tag remains on the field. + */ + private final int predef; + /** + * predefWithJavadoc has a predefined builder setter with javadoc, so it keeps that one untouched. + * @param tag is removed from the field. + * @return tag remains on the field. + */ + private final int predefWithJavadoc; + public static class BuilderJavadocBuilder<T> { + @java.lang.SuppressWarnings("all") + private int basic; + @java.lang.SuppressWarnings("all") + private int getsetwith; + @java.lang.SuppressWarnings("all") + private int predef; + @java.lang.SuppressWarnings("all") + private int predefWithJavadoc; + public BuilderJavadocBuilder<T> predef(final int x) { + this.predef = x * 10; + return this; + } + /** + * This javadoc remains untouched. + * @param x 1/100 of the thing + * @return the updated builder + */ + public BuilderJavadocBuilder<T> predefWithJavadoc(final int x) { + this.predefWithJavadoc = x * 100; + return this; + } + @java.lang.SuppressWarnings("all") + BuilderJavadocBuilder() { + } + /** + * basic gets only a builder setter. + * @see #getsetwith + * @param tag is moved to the setter. + */ + @java.lang.SuppressWarnings("all") + public BuilderJavadocBuilder<T> basic(final int basic) { + this.basic = basic; + return this; + } + /** + * getsetwith gets a builder setter, an instance getter and setter, and a wither. + * @param tag is moved to the setters and wither. + */ + @java.lang.SuppressWarnings("all") + public BuilderJavadocBuilder<T> getsetwith(final int getsetwith) { + this.getsetwith = getsetwith; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderJavadoc<T> build() { + return new BuilderJavadoc<T>(basic, getsetwith, predef, predefWithJavadoc); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderJavadoc.BuilderJavadocBuilder(basic=" + this.basic + ", getsetwith=" + this.getsetwith + ", predef=" + this.predef + ", predefWithJavadoc=" + this.predefWithJavadoc + ")"; + } + } + @java.lang.SuppressWarnings("all") + BuilderJavadoc(final int basic, final int getsetwith, final int predef, final int predefWithJavadoc) { + this.basic = basic; + this.getsetwith = getsetwith; + this.predef = predef; + this.predefWithJavadoc = predefWithJavadoc; + } + @java.lang.SuppressWarnings("all") + public static <T> BuilderJavadocBuilder<T> builder() { + return new BuilderJavadocBuilder<T>(); + } + /** + * getsetwith gets a builder setter, an instance getter and setter, and a wither. + * + * @return tag is moved to the getter. + */ + @java.lang.SuppressWarnings("all") + public int getGetsetwith() { + return this.getsetwith; + } + /** + * getsetwith gets a builder setter, an instance getter and setter, and a wither. + * @param tag is moved to the setters and wither. + */ + @java.lang.SuppressWarnings("all") + public void setGetsetwith(final int getsetwith) { + this.getsetwith = getsetwith; + } + /** + * getsetwith gets a builder setter, an instance getter and setter, and a wither. + * @param tag is moved to the setters and wither. + */ + @java.lang.SuppressWarnings("all") + public BuilderJavadoc<T> withGetsetwith(final int getsetwith) { + return this.getsetwith == getsetwith ? this : new BuilderJavadoc<T>(this.basic, getsetwith, this.predef, this.predefWithJavadoc); + } +} diff --git a/test/transform/resource/after-delombok/BuilderWithBadNames.java b/test/transform/resource/after-delombok/BuilderWithBadNames.java new file mode 100644 index 00000000..f413be23 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderWithBadNames.java @@ -0,0 +1,42 @@ +public class BuilderWithBadNames { + String build; + String toString; + @java.lang.SuppressWarnings("all") + BuilderWithBadNames(final String build, final String toString) { + this.build = build; + this.toString = toString; + } + @java.lang.SuppressWarnings("all") + public static class BuilderWithBadNamesBuilder { + @java.lang.SuppressWarnings("all") + private String build; + @java.lang.SuppressWarnings("all") + private String toString; + @java.lang.SuppressWarnings("all") + BuilderWithBadNamesBuilder() { + } + @java.lang.SuppressWarnings("all") + public BuilderWithBadNamesBuilder build(final String build) { + this.build = build; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderWithBadNamesBuilder toString(final String toString) { + this.toString = toString; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderWithBadNames build() { + return new BuilderWithBadNames(build, toString); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderWithBadNames.BuilderWithBadNamesBuilder(build=" + this.build + ", toString=" + this.toString + ")"; + } + } + @java.lang.SuppressWarnings("all") + public static BuilderWithBadNamesBuilder builder() { + return new BuilderWithBadNamesBuilder(); + } +} diff --git a/test/transform/resource/after-delombok/BuilderWithDeprecated.java b/test/transform/resource/after-delombok/BuilderWithDeprecated.java index cd887529..f06a11f2 100644 --- a/test/transform/resource/after-delombok/BuilderWithDeprecated.java +++ b/test/transform/resource/after-delombok/BuilderWithDeprecated.java @@ -1,7 +1,7 @@ import com.google.common.collect.ImmutableList; public class BuilderWithDeprecated { /** - * @deprecated + * @deprecated since always */ String dep1; @Deprecated @@ -30,6 +30,9 @@ public class BuilderWithDeprecated { @java.lang.SuppressWarnings("all") BuilderWithDeprecatedBuilder() { } + /** + * @deprecated since always + */ @java.lang.Deprecated @java.lang.SuppressWarnings("all") public BuilderWithDeprecatedBuilder dep1(final String dep1) { diff --git a/test/transform/resource/after-delombok/DataPlain.java b/test/transform/resource/after-delombok/DataPlain.java index e7d452b6..15b834d9 100644 --- a/test/transform/resource/after-delombok/DataPlain.java +++ b/test/transform/resource/after-delombok/DataPlain.java @@ -152,6 +152,7 @@ final class Data3 { final class Data4 extends java.util.Timer { int x; Data4() { + super(); } @java.lang.SuppressWarnings("all") public int getX() { diff --git a/test/transform/resource/after-delombok/NonNullTypeUse.java b/test/transform/resource/after-delombok/NonNullTypeUse.java new file mode 100644 index 00000000..27719480 --- /dev/null +++ b/test/transform/resource/after-delombok/NonNullTypeUse.java @@ -0,0 +1,32 @@ +import lombok.NonNull; +class NonNullTypeUse { + void test1(@NonNull String[][][] args) { + if (args == null) { + throw new java.lang.NullPointerException("args is marked @NonNull but is null"); + } + } + void test2(String @NonNull [][][] args) { + if (args == null) { + throw new java.lang.NullPointerException("args is marked @NonNull but is null"); + } + } + void test3(String[] @NonNull [][] args) { + } + void test4(String[][] @NonNull [] args) { + } + void test5(@NonNull String simple) { + if (simple == null) { + throw new java.lang.NullPointerException("simple is marked @NonNull but is null"); + } + } + void test6(java.lang.@NonNull String weird) { + if (weird == null) { + throw new java.lang.NullPointerException("weird is marked @NonNull but is null"); + } + } + void test7(java.lang.String @NonNull [][] weird) { + if (weird == null) { + throw new java.lang.NullPointerException("weird is marked @NonNull but is null"); + } + } +} diff --git a/test/transform/resource/after-delombok/SetterAndWitherJavadoc.java b/test/transform/resource/after-delombok/SetterAndWitherJavadoc.java new file mode 100644 index 00000000..8c0505e7 --- /dev/null +++ b/test/transform/resource/after-delombok/SetterAndWitherJavadoc.java @@ -0,0 +1,46 @@ +class SetterAndWitherJavadoc { + /** + * Some value. + */ + int i; + /** + * Some other value. + */ + int j; + SetterAndWitherJavadoc(int i, int j) { + this.i = i; + this.j = j; + } + /** + * Some value. + * @param the new value + */ + @java.lang.SuppressWarnings("all") + public void setI(final int i) { + this.i = i; + } + /** + * Some value. + * @param the new value + */ + @java.lang.SuppressWarnings("all") + public SetterAndWitherJavadoc withI(final int i) { + return this.i == i ? this : new SetterAndWitherJavadoc(i, this.j); + } + /** + * Set some other value. + * @param the new other value + */ + @java.lang.SuppressWarnings("all") + public void setJ(final int j) { + this.j = j; + } + /** + * Reinstantiate with some other value. + * @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); + } +} diff --git a/test/transform/resource/after-delombok/SetterWitherJavadocParamCopy.java b/test/transform/resource/after-delombok/SetterWitherJavadocParamCopy.java deleted file mode 100644 index e6f5ab75..00000000 --- a/test/transform/resource/after-delombok/SetterWitherJavadocParamCopy.java +++ /dev/null @@ -1,28 +0,0 @@ -class SetterWitherJavadocParamCopy { - /** - * Some text - */ - private int fieldName; - - public SetterWitherJavadocParamCopy(int f) { - this.fieldName = f; - } - /** - * Some text - * - * @param fieldName Hello, World1 - */ - @java.lang.SuppressWarnings("all") - public void setFieldName(final int fieldName) { - this.fieldName = fieldName; - } - /** - * Some text - * - * @param fieldName Hello, World1 - */ - @java.lang.SuppressWarnings("all") - public SetterWitherJavadocParamCopy withFieldName(final int fieldName) { - return this.fieldName == fieldName ? this : new SetterWitherJavadocParamCopy(fieldName); - } -}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/SneakyThrowsPlain.java b/test/transform/resource/after-delombok/SneakyThrowsPlain.java index 86f7790c..32ab8054 100644 --- a/test/transform/resource/after-delombok/SneakyThrowsPlain.java +++ b/test/transform/resource/after-delombok/SneakyThrowsPlain.java @@ -1,5 +1,6 @@ class SneakyThrowsPlain { SneakyThrowsPlain() { + super(); try { System.out.println("constructor"); } catch (final java.lang.Throwable $ex) { diff --git a/test/transform/resource/after-ecj/BuilderJavadoc.java b/test/transform/resource/after-ecj/BuilderJavadoc.java new file mode 100644 index 00000000..b7403835 --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderJavadoc.java @@ -0,0 +1,57 @@ +import java.util.List; +@lombok.Builder class BuilderJavadoc<T> { + public static class BuilderJavadocBuilder<T> { + private @java.lang.SuppressWarnings("all") int basic; + private @java.lang.SuppressWarnings("all") int getsetwith; + private @java.lang.SuppressWarnings("all") int predef; + private @java.lang.SuppressWarnings("all") int predefWithJavadoc; + public BuilderJavadocBuilder<T> predef(final int x) { + this.predef = (x * 10); + return this; + } + public BuilderJavadocBuilder<T> predefWithJavadoc(final int x) { + this.predefWithJavadoc = (x * 100); + return this; + } + @java.lang.SuppressWarnings("all") BuilderJavadocBuilder() { + super(); + } + public @java.lang.SuppressWarnings("all") BuilderJavadocBuilder<T> basic(final int basic) { + this.basic = basic; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderJavadocBuilder<T> getsetwith(final int getsetwith) { + this.getsetwith = getsetwith; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderJavadoc<T> build() { + return new BuilderJavadoc<T>(basic, getsetwith, predef, predefWithJavadoc); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((((((("BuilderJavadoc.BuilderJavadocBuilder(basic=" + this.basic) + ", getsetwith=") + this.getsetwith) + ", predef=") + this.predef) + ", predefWithJavadoc=") + this.predefWithJavadoc) + ")"); + } + } + private final int basic; + private @lombok.Getter @lombok.Setter @lombok.experimental.Wither int getsetwith; + private final int predef; + private final int predefWithJavadoc; + @java.lang.SuppressWarnings("all") BuilderJavadoc(final int basic, final int getsetwith, final int predef, final int predefWithJavadoc) { + super(); + this.basic = basic; + this.getsetwith = getsetwith; + this.predef = predef; + this.predefWithJavadoc = predefWithJavadoc; + } + public static @java.lang.SuppressWarnings("all") <T>BuilderJavadocBuilder<T> builder() { + return new BuilderJavadocBuilder<T>(); + } + public @java.lang.SuppressWarnings("all") int getGetsetwith() { + return this.getsetwith; + } + public @java.lang.SuppressWarnings("all") void setGetsetwith(final int getsetwith) { + this.getsetwith = getsetwith; + } + public @java.lang.SuppressWarnings("all") BuilderJavadoc<T> withGetsetwith(final int getsetwith) { + return ((this.getsetwith == getsetwith) ? this : new BuilderJavadoc<T>(this.basic, getsetwith, this.predef, this.predefWithJavadoc)); + } +} diff --git a/test/transform/resource/after-ecj/BuilderWithBadNames.java b/test/transform/resource/after-ecj/BuilderWithBadNames.java new file mode 100644 index 00000000..a31b2f16 --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderWithBadNames.java @@ -0,0 +1,33 @@ +public @lombok.Builder class BuilderWithBadNames { + public static @java.lang.SuppressWarnings("all") class BuilderWithBadNamesBuilder { + private @java.lang.SuppressWarnings("all") String build; + private @java.lang.SuppressWarnings("all") String toString; + @java.lang.SuppressWarnings("all") BuilderWithBadNamesBuilder() { + super(); + } + public @java.lang.SuppressWarnings("all") BuilderWithBadNamesBuilder build(final String build) { + this.build = build; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderWithBadNamesBuilder toString(final String toString) { + this.toString = toString; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderWithBadNames build() { + return new BuilderWithBadNames(build, toString); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((("BuilderWithBadNames.BuilderWithBadNamesBuilder(build=" + this.build) + ", toString=") + this.toString) + ")"); + } + } + String build; + String toString; + @java.lang.SuppressWarnings("all") BuilderWithBadNames(final String build, final String toString) { + super(); + this.build = build; + this.toString = toString; + } + public static @java.lang.SuppressWarnings("all") BuilderWithBadNamesBuilder builder() { + return new BuilderWithBadNamesBuilder(); + } +} diff --git a/test/transform/resource/after-ecj/NonNullTypeUse.java b/test/transform/resource/after-ecj/NonNullTypeUse.java new file mode 100644 index 00000000..4cf1aa5a --- /dev/null +++ b/test/transform/resource/after-ecj/NonNullTypeUse.java @@ -0,0 +1,40 @@ +import lombok.NonNull; +class NonNullTypeUse { + NonNullTypeUse() { + super(); + } + void test1(@NonNull String[][][] args) { + if ((args == null)) + { + throw new java.lang.NullPointerException("args is marked @NonNull but is null"); + } + } + void test2(String @NonNull [][][] args) { + if ((args == null)) + { + throw new java.lang.NullPointerException("args is marked @NonNull but is null"); + } + } + void test3(String[] @NonNull [][] args) { + } + void test4(String[][] @NonNull [] args) { + } + void test5(@NonNull String simple) { + if ((simple == null)) + { + throw new java.lang.NullPointerException("simple is marked @NonNull but is null"); + } + } + void test6(java.lang.@NonNull String weird) { + if ((weird == null)) + { + throw new java.lang.NullPointerException("weird is marked @NonNull but is null"); + } + } + void test7(java.lang.String @NonNull [][] weird) { + if ((weird == null)) + { + throw new java.lang.NullPointerException("weird is marked @NonNull but is null"); + } + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/SetterAndWitherJavadoc.java b/test/transform/resource/after-ecj/SetterAndWitherJavadoc.java new file mode 100644 index 00000000..623277a0 --- /dev/null +++ b/test/transform/resource/after-ecj/SetterAndWitherJavadoc.java @@ -0,0 +1,22 @@ +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/SetterWitherJavadocParamCopy.java b/test/transform/resource/after-ecj/SetterWitherJavadocParamCopy.java deleted file mode 100644 index 741342f7..00000000 --- a/test/transform/resource/after-ecj/SetterWitherJavadocParamCopy.java +++ /dev/null @@ -1,13 +0,0 @@ -class SetterWitherJavadocParamCopy { - private @lombok.Setter @lombok.experimental.Wither int fieldName; - public SetterWitherJavadocParamCopy(int f) { - super(); - this.fieldName = f; - } - public @java.lang.SuppressWarnings("all") void setFieldName(final int fieldName) { - this.fieldName = fieldName; - } - public @java.lang.SuppressWarnings("all") SetterWitherJavadocParamCopy withFieldName(final int fieldName) { - return ((this.fieldName == fieldName) ? this : new SetterWitherJavadocParamCopy(fieldName)); - } -} diff --git a/test/transform/resource/before/BuilderJavadoc.java b/test/transform/resource/before/BuilderJavadoc.java new file mode 100644 index 00000000..c2e0a6e0 --- /dev/null +++ b/test/transform/resource/before/BuilderJavadoc.java @@ -0,0 +1,54 @@ +import java.util.List; + +@lombok.Builder +class BuilderJavadoc<T> { + /** + * basic gets only a builder setter. + * @see #getsetwith + * @param tag is moved to the setter. + * @return tag is removed from the setter. + */ + private final int basic; + + /** + * getsetwith gets a builder setter, an instance getter and setter, and a wither. + * @param tag is moved to the setters and wither. + * @return tag is moved to the getter. + */ + @lombok.Getter + @lombok.Setter + @lombok.experimental.Wither + private int getsetwith; + + /** + * Predef has a predefined builder setter with no javadoc, and the builder setter does not get this one. + * @param tag remains on the field. + * @return tag remains on the field. + */ + private final int predef; + + /** + * predefWithJavadoc has a predefined builder setter with javadoc, so it keeps that one untouched. + * @param tag is removed from the field. + * @return tag remains on the field. + */ + private final int predefWithJavadoc; + + public static class BuilderJavadocBuilder<T> { + public BuilderJavadocBuilder<T> predef(final int x) { + this.predef = x * 10; + return this; + } + + /** + * This javadoc remains untouched. + * @param x 1/100 of the thing + * @return the updated builder + */ + public BuilderJavadocBuilder<T> predefWithJavadoc(final int x) { + this.predefWithJavadoc = x * 100; + return this; + } + } + +} diff --git a/test/transform/resource/before/BuilderWithBadNames.java b/test/transform/resource/before/BuilderWithBadNames.java new file mode 100644 index 00000000..07f99b64 --- /dev/null +++ b/test/transform/resource/before/BuilderWithBadNames.java @@ -0,0 +1,5 @@ +@lombok.Builder +public class BuilderWithBadNames { + String build; + String toString; +} diff --git a/test/transform/resource/before/BuilderWithDeprecated.java b/test/transform/resource/before/BuilderWithDeprecated.java index cd8ffad9..1641ccb4 100644 --- a/test/transform/resource/before/BuilderWithDeprecated.java +++ b/test/transform/resource/before/BuilderWithDeprecated.java @@ -4,7 +4,7 @@ import lombok.Singular; @Builder public class BuilderWithDeprecated { - /** @deprecated */ String dep1; + /** @deprecated since always */ String dep1; @Deprecated int dep2; @Singular @Deprecated java.util.List<String> strings; @Singular @Deprecated ImmutableList<Integer> numbers; diff --git a/test/transform/resource/before/EqualsAndHashCodeOfAndExcludeWarn.java b/test/transform/resource/before/EqualsAndHashCodeOfAndExcludeWarn.java new file mode 100644 index 00000000..9babf443 --- /dev/null +++ b/test/transform/resource/before/EqualsAndHashCodeOfAndExcludeWarn.java @@ -0,0 +1,10 @@ +// skip-compare-contents +@lombok.EqualsAndHashCode(of={"y"}) +final class EqualsAndHashCodeWarnOf { + int x; +} + +@lombok.EqualsAndHashCode(exclude={"y"}) +final class EqualsAndHashCodeWarnExclude { + int x; +} diff --git a/test/transform/resource/before/NonNullTypeUse.java b/test/transform/resource/before/NonNullTypeUse.java new file mode 100644 index 00000000..32179351 --- /dev/null +++ b/test/transform/resource/before/NonNullTypeUse.java @@ -0,0 +1,19 @@ +//version 8: +import lombok.NonNull; + +class NonNullTypeUse { + void test1(@NonNull String[][][] args) { + } + void test2(String @NonNull [][][] args) { + } + void test3(String [] @NonNull [][] args) { + } + void test4(String [][] @NonNull [] args) { + } + void test5(@NonNull String simple) { + } + void test6(java.lang.@NonNull String weird) { + } + void test7(java.lang.String @NonNull [][] weird) { + } +} diff --git a/test/transform/resource/before/SetterAndWitherJavadoc.java b/test/transform/resource/before/SetterAndWitherJavadoc.java new file mode 100644 index 00000000..6953eb39 --- /dev/null +++ b/test/transform/resource/before/SetterAndWitherJavadoc.java @@ -0,0 +1,26 @@ +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/SetterWitherJavadocParamCopy.java b/test/transform/resource/before/SetterWitherJavadocParamCopy.java deleted file mode 100644 index 4de091e2..00000000 --- a/test/transform/resource/before/SetterWitherJavadocParamCopy.java +++ /dev/null @@ -1,16 +0,0 @@ -class SetterWitherJavadocParamCopy { - /** - * Some text - * - * @param fieldName Hello, World1 - * --- GETTER --- - * Getter section - * - * @return Sky is blue1 - */ - @lombok.Setter @lombok.experimental.Wither private int fieldName; - - public SetterWitherJavadocParamCopy(int f) { - this.fieldName = f; - } -} diff --git a/test/transform/resource/messages-delombok/EqualsAndHashCodeOfAndExcludeWarn.java.messages b/test/transform/resource/messages-delombok/EqualsAndHashCodeOfAndExcludeWarn.java.messages new file mode 100644 index 00000000..2c4fbd68 --- /dev/null +++ b/test/transform/resource/messages-delombok/EqualsAndHashCodeOfAndExcludeWarn.java.messages @@ -0,0 +1,2 @@ +1 This field does not exist. +6 This field does not exist, or would have been excluded anyway.
\ No newline at end of file diff --git a/test/transform/resource/messages-ecj/EqualsAndHashCodeOfAndExcludeWarn.java.messages b/test/transform/resource/messages-ecj/EqualsAndHashCodeOfAndExcludeWarn.java.messages new file mode 100644 index 00000000..2c4fbd68 --- /dev/null +++ b/test/transform/resource/messages-ecj/EqualsAndHashCodeOfAndExcludeWarn.java.messages @@ -0,0 +1,2 @@ +1 This field does not exist. +6 This field does not exist, or would have been excluded anyway.
\ No newline at end of file |