diff options
Diffstat (limited to 'test/transform')
39 files changed, 119 insertions, 228 deletions
diff --git a/test/transform/resource/after-delombok/BuilderChainAndFluent.java b/test/transform/resource/after-delombok/BuilderChainAndFluent.java deleted file mode 100644 index f9833be6..00000000 --- a/test/transform/resource/after-delombok/BuilderChainAndFluent.java +++ /dev/null @@ -1,32 +0,0 @@ -class BuilderChainAndFluent { - private final int yes; - @java.lang.SuppressWarnings("all") - BuilderChainAndFluent(final int yes) { - this.yes = yes; - } - @java.lang.SuppressWarnings("all") - public static class BuilderChainAndFluentBuilder { - @java.lang.SuppressWarnings("all") - private int yes; - @java.lang.SuppressWarnings("all") - BuilderChainAndFluentBuilder() { - } - @java.lang.SuppressWarnings("all") - public void setYes(final int yes) { - this.yes = yes; - } - @java.lang.SuppressWarnings("all") - public BuilderChainAndFluent build() { - return new BuilderChainAndFluent(yes); - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public java.lang.String toString() { - return "BuilderChainAndFluent.BuilderChainAndFluentBuilder(yes=" + this.yes + ")"; - } - } - @java.lang.SuppressWarnings("all") - public static BuilderChainAndFluentBuilder builder() { - return new BuilderChainAndFluentBuilder(); - } -} diff --git a/test/transform/resource/after-delombok/EqualsAndHashCodeWithGenericsOnInners.java b/test/transform/resource/after-delombok/EqualsAndHashCodeWithGenericsOnInners.java new file mode 100644 index 00000000..501d45a1 --- /dev/null +++ b/test/transform/resource/after-delombok/EqualsAndHashCodeWithGenericsOnInners.java @@ -0,0 +1,28 @@ +public class EqualsAndHashCodeWithGenericsOnInners<A> { + class Inner<B> { + int x; + @java.lang.Override + @java.lang.SuppressWarnings("all") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (!(o instanceof EqualsAndHashCodeWithGenericsOnInners.Inner)) return false; + final EqualsAndHashCodeWithGenericsOnInners<?>.Inner<?> other = (EqualsAndHashCodeWithGenericsOnInners<?>.Inner<?>) o; + if (!other.canEqual((java.lang.Object) this)) return false; + if (this.x != other.x) return false; + return true; + } + @java.lang.SuppressWarnings("all") + protected boolean canEqual(final java.lang.Object other) { + return other instanceof EqualsAndHashCodeWithGenericsOnInners.Inner; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + final int PRIME = 59; + int result = 1; + result = result * PRIME + this.x; + return result; + } + } +} + diff --git a/test/transform/resource/after-delombok/JavadocGenerally.java b/test/transform/resource/after-delombok/JavadocGenerally.java index 729cdce3..ec9483bc 100644 --- a/test/transform/resource/after-delombok/JavadocGenerally.java +++ b/test/transform/resource/after-delombok/JavadocGenerally.java @@ -9,6 +9,9 @@ package testPackage; class JavadocGenerally { /** * Doc on field + * <pre> + * // code + * </pre> */ private int someField; /** diff --git a/test/transform/resource/after-delombok/ValueExperimental.java b/test/transform/resource/after-delombok/ValueExperimental.java deleted file mode 100644 index 5846a2d8..00000000 --- a/test/transform/resource/after-delombok/ValueExperimental.java +++ /dev/null @@ -1,46 +0,0 @@ -final class ValueExperimental1 { - @java.lang.SuppressWarnings("all") - public ValueExperimental1() { - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public boolean equals(final java.lang.Object o) { - if (o == this) return true; - if (!(o instanceof ValueExperimental1)) return false; - return true; - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public int hashCode() { - int result = 1; - return result; - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public java.lang.String toString() { - return "ValueExperimental1()"; - } -} -final class ValueExperimental2 { - @java.lang.SuppressWarnings("all") - public ValueExperimental2() { - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public boolean equals(final java.lang.Object o) { - if (o == this) return true; - if (!(o instanceof ValueExperimental2)) return false; - return true; - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public int hashCode() { - int result = 1; - return result; - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public java.lang.String toString() { - return "ValueExperimental2()"; - } -} diff --git a/test/transform/resource/after-delombok/ValueExperimentalStarImport.java b/test/transform/resource/after-delombok/ValueExperimentalStarImport.java deleted file mode 100644 index cb755b47..00000000 --- a/test/transform/resource/after-delombok/ValueExperimentalStarImport.java +++ /dev/null @@ -1,25 +0,0 @@ -import lombok.experimental.*; -final class ValueExperimentalStarImport { - @java.lang.SuppressWarnings("all") - public ValueExperimentalStarImport() { - - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public boolean equals(final java.lang.Object o) { - if (o == this) return true; - if (!(o instanceof ValueExperimentalStarImport)) return false; - return true; - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public int hashCode() { - int result = 1; - return result; - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public java.lang.String toString() { - return "ValueExperimentalStarImport()"; - } -} diff --git a/test/transform/resource/after-delombok/VarWarning.java b/test/transform/resource/after-delombok/VarWarning.java new file mode 100644 index 00000000..a333c87c --- /dev/null +++ b/test/transform/resource/after-delombok/VarWarning.java @@ -0,0 +1,6 @@ +public class VarWarning { + public void isOkay() { + java.lang.String x = "Warning"; + x.toLowerCase(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/BuilderChainAndFluent.java b/test/transform/resource/after-ecj/BuilderChainAndFluent.java deleted file mode 100644 index f789f535..00000000 --- a/test/transform/resource/after-ecj/BuilderChainAndFluent.java +++ /dev/null @@ -1,25 +0,0 @@ -@lombok.experimental.Builder(fluent = false,chain = false) class BuilderChainAndFluent { - public static @java.lang.SuppressWarnings("all") class BuilderChainAndFluentBuilder { - private @java.lang.SuppressWarnings("all") int yes; - @java.lang.SuppressWarnings("all") BuilderChainAndFluentBuilder() { - super(); - } - public @java.lang.SuppressWarnings("all") void setYes(final int yes) { - this.yes = yes; - } - public @java.lang.SuppressWarnings("all") BuilderChainAndFluent build() { - return new BuilderChainAndFluent(yes); - } - public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return (("BuilderChainAndFluent.BuilderChainAndFluentBuilder(yes=" + this.yes) + ")"); - } - } - private final int yes; - @java.lang.SuppressWarnings("all") BuilderChainAndFluent(final int yes) { - super(); - this.yes = yes; - } - public static @java.lang.SuppressWarnings("all") BuilderChainAndFluentBuilder builder() { - return new BuilderChainAndFluentBuilder(); - } -} diff --git a/test/transform/resource/after-ecj/BuilderComplex.java b/test/transform/resource/after-ecj/BuilderComplex.java index 8f520ae5..93d70fe9 100644 --- a/test/transform/resource/after-ecj/BuilderComplex.java +++ b/test/transform/resource/after-ecj/BuilderComplex.java @@ -1,5 +1,5 @@ import java.util.List; -import lombok.experimental.Builder; +import lombok.Builder; class BuilderComplex { public static @java.lang.SuppressWarnings("all") class VoidBuilder<T extends Number> { private @java.lang.SuppressWarnings("all") T number; diff --git a/test/transform/resource/after-ecj/EqualsAndHashCodeWithGenericsOnInners.java b/test/transform/resource/after-ecj/EqualsAndHashCodeWithGenericsOnInners.java new file mode 100644 index 00000000..164d0f15 --- /dev/null +++ b/test/transform/resource/after-ecj/EqualsAndHashCodeWithGenericsOnInners.java @@ -0,0 +1,32 @@ +public class EqualsAndHashCodeWithGenericsOnInners<A> { + @lombok.EqualsAndHashCode class Inner<B> { + int x; + Inner() { + super(); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { + if ((o == this)) + return true; + if ((! (o instanceof EqualsAndHashCodeWithGenericsOnInners.Inner))) + return false; + final EqualsAndHashCodeWithGenericsOnInners<?>.Inner<?> other = (EqualsAndHashCodeWithGenericsOnInners<?>.Inner<?>) o; + if ((! other.canEqual((java.lang.Object) this))) + return false; + if ((this.x != other.x)) + return false; + return true; + } + protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) { + return (other instanceof EqualsAndHashCodeWithGenericsOnInners.Inner); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { + final int PRIME = 59; + int result = 1; + result = ((result * PRIME) + this.x); + return result; + } + } + public EqualsAndHashCodeWithGenericsOnInners() { + super(); + } +} diff --git a/test/transform/resource/after-ecj/ValueExperimental.java b/test/transform/resource/after-ecj/ValueExperimental.java deleted file mode 100644 index dd13574a..00000000 --- a/test/transform/resource/after-ecj/ValueExperimental.java +++ /dev/null @@ -1,39 +0,0 @@ -import lombok.experimental.Value; -final @Value class ValueExperimental1 { - public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { - if ((o == this)) - return true; - if ((! (o instanceof ValueExperimental1))) - return false; - return true; - } - public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - int result = 1; - return result; - } - public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return "ValueExperimental1()"; - } - public @java.lang.SuppressWarnings("all") ValueExperimental1() { - super(); - } -} -final @lombok.experimental.Value class ValueExperimental2 { - public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { - if ((o == this)) - return true; - if ((! (o instanceof ValueExperimental2))) - return false; - return true; - } - public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - int result = 1; - return result; - } - public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return "ValueExperimental2()"; - } - public @java.lang.SuppressWarnings("all") ValueExperimental2() { - super(); - } -}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/ValueExperimentalStarImport.java b/test/transform/resource/after-ecj/ValueExperimentalStarImport.java deleted file mode 100644 index b69e85d9..00000000 --- a/test/transform/resource/after-ecj/ValueExperimentalStarImport.java +++ /dev/null @@ -1,20 +0,0 @@ -import lombok.experimental.*; -final @Value class ValueExperimentalStarImport { - public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) { - if ((o == this)) - return true; - if ((! (o instanceof ValueExperimentalStarImport))) - return false; - return true; - } - public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - int result = 1; - return result; - } - public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { - return "ValueExperimentalStarImport()"; - } - public @java.lang.SuppressWarnings("all") ValueExperimentalStarImport() { - super(); - } -} diff --git a/test/transform/resource/after-ecj/VarComplex.java b/test/transform/resource/after-ecj/VarComplex.java index 10c456eb..97a0a177 100644 --- a/test/transform/resource/after-ecj/VarComplex.java +++ b/test/transform/resource/after-ecj/VarComplex.java @@ -1,4 +1,4 @@ -import lombok.experimental.var; +import lombok.var; public class VarComplex { private String field = ""; private static final int CONSTANT = 20; diff --git a/test/transform/resource/after-ecj/VarInFor.java b/test/transform/resource/after-ecj/VarInFor.java index 0192aaed..1799d9b7 100644 --- a/test/transform/resource/after-ecj/VarInFor.java +++ b/test/transform/resource/after-ecj/VarInFor.java @@ -1,4 +1,4 @@ -import lombok.experimental.var; +import lombok.var; public class VarInFor { public VarInFor() { super(); diff --git a/test/transform/resource/after-ecj/VarInForOld.java b/test/transform/resource/after-ecj/VarInForOld.java index 98fedf03..065ea94d 100644 --- a/test/transform/resource/after-ecj/VarInForOld.java +++ b/test/transform/resource/after-ecj/VarInForOld.java @@ -1,4 +1,4 @@ -import lombok.experimental.var; +import lombok.var; public class VarInForOld { public VarInForOld() { super(); diff --git a/test/transform/resource/after-ecj/VarNullInit.java b/test/transform/resource/after-ecj/VarNullInit.java index 3eb2d506..848744cc 100644 --- a/test/transform/resource/after-ecj/VarNullInit.java +++ b/test/transform/resource/after-ecj/VarNullInit.java @@ -1,4 +1,4 @@ -import lombok.experimental.var; +import lombok.var; public class VarNullInit { public VarNullInit() { super(); diff --git a/test/transform/resource/after-ecj/VarWarning.java b/test/transform/resource/after-ecj/VarWarning.java new file mode 100644 index 00000000..4caf90f8 --- /dev/null +++ b/test/transform/resource/after-ecj/VarWarning.java @@ -0,0 +1,10 @@ +import lombok.var; +public class VarWarning { + public VarWarning() { + super(); + } + public void isOkay() { + @var java.lang.String x = "Warning"; + x.toLowerCase(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/before/BuilderChainAndFluent.java b/test/transform/resource/before/BuilderChainAndFluent.java deleted file mode 100644 index 4d08741b..00000000 --- a/test/transform/resource/before/BuilderChainAndFluent.java +++ /dev/null @@ -1,4 +0,0 @@ -@lombok.experimental.Builder(fluent = false, chain = false) -class BuilderChainAndFluent { - private final int yes; -} diff --git a/test/transform/resource/before/BuilderComplex.java b/test/transform/resource/before/BuilderComplex.java index 590a2723..c13f5877 100644 --- a/test/transform/resource/before/BuilderComplex.java +++ b/test/transform/resource/before/BuilderComplex.java @@ -1,5 +1,5 @@ import java.util.List; -import lombok.experimental.Builder; +import lombok.Builder; class BuilderComplex { @Builder(buildMethodName = "execute") diff --git a/test/transform/resource/before/EqualsAndHashCodeWithGenericsOnInners.java b/test/transform/resource/before/EqualsAndHashCodeWithGenericsOnInners.java new file mode 100644 index 00000000..7af1d054 --- /dev/null +++ b/test/transform/resource/before/EqualsAndHashCodeWithGenericsOnInners.java @@ -0,0 +1,6 @@ +public class EqualsAndHashCodeWithGenericsOnInners<A> { + @lombok.EqualsAndHashCode class Inner<B> { + int x; + } +} + diff --git a/test/transform/resource/before/JavadocGenerally.java b/test/transform/resource/before/JavadocGenerally.java index e47de44d..1df93385 100644 --- a/test/transform/resource/before/JavadocGenerally.java +++ b/test/transform/resource/before/JavadocGenerally.java @@ -11,6 +11,9 @@ package testPackage; class JavadocGenerally { /** * Doc on field + * <pre> + * // code + * </pre> */ private int someField; diff --git a/test/transform/resource/before/ValueExperimental.java b/test/transform/resource/before/ValueExperimental.java deleted file mode 100644 index 6bae26a0..00000000 --- a/test/transform/resource/before/ValueExperimental.java +++ /dev/null @@ -1,9 +0,0 @@ -import lombok.experimental.Value; - -@Value -class ValueExperimental1 { -} - -@lombok.experimental.Value -class ValueExperimental2 { -}
\ No newline at end of file diff --git a/test/transform/resource/before/ValueExperimentalStarImport.java b/test/transform/resource/before/ValueExperimentalStarImport.java deleted file mode 100644 index 5f18cffe..00000000 --- a/test/transform/resource/before/ValueExperimentalStarImport.java +++ /dev/null @@ -1,5 +0,0 @@ -import lombok.experimental.*; - -@Value -class ValueExperimentalStarImport { -}
\ No newline at end of file diff --git a/test/transform/resource/before/VarComplex.java b/test/transform/resource/before/VarComplex.java index bfaa8804..c93e177a 100644 --- a/test/transform/resource/before/VarComplex.java +++ b/test/transform/resource/before/VarComplex.java @@ -1,5 +1,4 @@ -//CONF: lombok.var.flagUsage = ALLOW -import lombok.experimental.var; +import lombok.var; public class VarComplex { private String field = ""; diff --git a/test/transform/resource/before/VarInFor.java b/test/transform/resource/before/VarInFor.java index cc8c387e..7f7bb7a7 100644 --- a/test/transform/resource/before/VarInFor.java +++ b/test/transform/resource/before/VarInFor.java @@ -1,5 +1,4 @@ -//CONF: lombok.var.flagUsage = ALLOW -import lombok.experimental.var; +import lombok.var; public class VarInFor { public void enhancedFor() { diff --git a/test/transform/resource/before/VarInForOld.java b/test/transform/resource/before/VarInForOld.java index f90aba7f..99e83b57 100644 --- a/test/transform/resource/before/VarInForOld.java +++ b/test/transform/resource/before/VarInForOld.java @@ -1,5 +1,4 @@ -//CONF: lombok.var.flagUsage = ALLOW -import lombok.experimental.var; +import lombok.var; public class VarInForOld { public void oldFor() { diff --git a/test/transform/resource/before/VarInForOldMulti.java b/test/transform/resource/before/VarInForOldMulti.java new file mode 100644 index 00000000..e2ea9682 --- /dev/null +++ b/test/transform/resource/before/VarInForOldMulti.java @@ -0,0 +1,10 @@ +//skip compare contents +import lombok.var; + +public class VarInForOldMulti { + public void oldForMulti() { + for (var i = 0, j = "Hey"; i < 100; ++i) { + System.out.println(i); + } + } +}
\ No newline at end of file diff --git a/test/transform/resource/before/VarModifier.java b/test/transform/resource/before/VarModifier.java index 7250c1c5..5c68caa7 100644 --- a/test/transform/resource/before/VarModifier.java +++ b/test/transform/resource/before/VarModifier.java @@ -1,4 +1,3 @@ -//CONF: lombok.var.flagUsage = ALLOW import lombok.experimental.var; public class VarModifier { diff --git a/test/transform/resource/before/VarNullInit.java b/test/transform/resource/before/VarNullInit.java index efdc9d9e..f9bb53a3 100644 --- a/test/transform/resource/before/VarNullInit.java +++ b/test/transform/resource/before/VarNullInit.java @@ -1,5 +1,4 @@ -//CONF: lombok.var.flagUsage = ALLOW -import lombok.experimental.var; +import lombok.var; public class VarNullInit { void method() { diff --git a/test/transform/resource/before/VarWarning.java b/test/transform/resource/before/VarWarning.java index 85559587..90464d30 100644 --- a/test/transform/resource/before/VarWarning.java +++ b/test/transform/resource/before/VarWarning.java @@ -1,6 +1,5 @@ //CONF: lombok.var.flagUsage = WARNING -//skip compare contents -import lombok.experimental.var; +import lombok.var; public class VarWarning { public void isOkay() { diff --git a/test/transform/resource/messages-delombok/VarInForOldMulti.java.messages b/test/transform/resource/messages-delombok/VarInForOldMulti.java.messages new file mode 100644 index 00000000..f65fe823 --- /dev/null +++ b/test/transform/resource/messages-delombok/VarInForOldMulti.java.messages @@ -0,0 +1 @@ +6 'var' is not allowed in old-style for loops if there is more than 1 initializer diff --git a/test/transform/resource/messages-delombok/VarNullInit.java.messages b/test/transform/resource/messages-delombok/VarNullInit.java.messages index 190ab7c4..5a2a6ae1 100644 --- a/test/transform/resource/messages-delombok/VarNullInit.java.messages +++ b/test/transform/resource/messages-delombok/VarNullInit.java.messages @@ -1 +1 @@ -6 variable initializer is 'null'
\ No newline at end of file +5 variable initializer is 'null'
\ No newline at end of file diff --git a/test/transform/resource/messages-delombok/VarWarning.java.messages b/test/transform/resource/messages-delombok/VarWarning.java.messages index 48c89581..886e98f4 100644 --- a/test/transform/resource/messages-delombok/VarWarning.java.messages +++ b/test/transform/resource/messages-delombok/VarWarning.java.messages @@ -1 +1 @@ -7 Use of var is flagged according to lombok configuration
\ No newline at end of file +6 Use of var is flagged according to lombok configuration
\ No newline at end of file diff --git a/test/transform/resource/messages-ecj/BuilderComplex.java.messages b/test/transform/resource/messages-ecj/BuilderComplex.java.messages deleted file mode 100644 index 4856a80d..00000000 --- a/test/transform/resource/messages-ecj/BuilderComplex.java.messages +++ /dev/null @@ -1 +0,0 @@ -2 The type Builder is deprecated diff --git a/test/transform/resource/messages-ecj/ValInTryWithResources.java.messages b/test/transform/resource/messages-ecj/ValInTryWithResources.java.messages new file mode 100644 index 00000000..9d0d7a6e --- /dev/null +++ b/test/transform/resource/messages-ecj/ValInTryWithResources.java.messages @@ -0,0 +1 @@ +OPTIONAL 8 Resource leak: 'i' is never closed diff --git a/test/transform/resource/messages-ecj/ValueExperimental.java.messages b/test/transform/resource/messages-ecj/ValueExperimental.java.messages deleted file mode 100644 index e454a878..00000000 --- a/test/transform/resource/messages-ecj/ValueExperimental.java.messages +++ /dev/null @@ -1 +0,0 @@ -1 The type Value is deprecated
\ No newline at end of file diff --git a/test/transform/resource/messages-ecj/VarInForOldMulti.java.messages b/test/transform/resource/messages-ecj/VarInForOldMulti.java.messages new file mode 100644 index 00000000..0bfd6e65 --- /dev/null +++ b/test/transform/resource/messages-ecj/VarInForOldMulti.java.messages @@ -0,0 +1 @@ +6 'var' is not allowed in old-style for loops if there is more than 1 initializer
\ No newline at end of file diff --git a/test/transform/resource/messages-ecj/VarModifier.java.messages b/test/transform/resource/messages-ecj/VarModifier.java.messages new file mode 100644 index 00000000..051d1ad7 --- /dev/null +++ b/test/transform/resource/messages-ecj/VarModifier.java.messages @@ -0,0 +1,3 @@ +1 The type var is deprecated +7 The type var is deprecated +8 The type var is deprecated diff --git a/test/transform/resource/messages-ecj/VarNullInit.java.messages b/test/transform/resource/messages-ecj/VarNullInit.java.messages index 190ab7c4..5a2a6ae1 100644 --- a/test/transform/resource/messages-ecj/VarNullInit.java.messages +++ b/test/transform/resource/messages-ecj/VarNullInit.java.messages @@ -1 +1 @@ -6 variable initializer is 'null'
\ No newline at end of file +5 variable initializer is 'null'
\ No newline at end of file diff --git a/test/transform/resource/messages-ecj/VarWarning.java.messages b/test/transform/resource/messages-ecj/VarWarning.java.messages index 48c89581..25096b84 100644 --- a/test/transform/resource/messages-ecj/VarWarning.java.messages +++ b/test/transform/resource/messages-ecj/VarWarning.java.messages @@ -1 +1 @@ -7 Use of var is flagged according to lombok configuration
\ No newline at end of file +6 Use of var is flagged according to lombok configuration.
\ No newline at end of file |