diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2021-03-21 05:24:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-21 05:24:46 +0100 |
commit | 8e23c10a999e08c37b83cdd51dac5f224a1394cd (patch) | |
tree | 7e900ab2aca0705017ab0f35b32cdba742979caa /test/transform | |
parent | fb455f4634a673d1c28a82caed18c4a171466335 (diff) | |
parent | 70951d4dd7eb82500bb8de98749ae136d9a38d78 (diff) | |
download | lombok-8e23c10a999e08c37b83cdd51dac5f224a1394cd.tar.gz lombok-8e23c10a999e08c37b83cdd51dac5f224a1394cd.tar.bz2 lombok-8e23c10a999e08c37b83cdd51dac5f224a1394cd.zip |
Merge pull request #2725 from md-5/master
[fixes #2724] Increase priority of Builder annotation removal
Diffstat (limited to 'test/transform')
7 files changed, 94 insertions, 6 deletions
diff --git a/test/transform/resource/after-delombok/BuilderAccessWithGetter.java b/test/transform/resource/after-delombok/BuilderAccessWithGetter.java new file mode 100644 index 00000000..f36403bf --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderAccessWithGetter.java @@ -0,0 +1,49 @@ +public final class BuilderAccessWithGetter { + private final String string; + + @java.lang.SuppressWarnings("all") + BuilderAccessWithGetter(final String string) { + this.string = string; + } + + + @java.lang.SuppressWarnings("all") + private static class BuilderAccessWithGetterBuilder { + @java.lang.SuppressWarnings("all") + private String string; + + @java.lang.SuppressWarnings("all") + BuilderAccessWithGetterBuilder() { + } + + /** + * @return {@code this}. + */ + @java.lang.SuppressWarnings("all") + private BuilderAccessWithGetter.BuilderAccessWithGetterBuilder string(final String string) { + this.string = string; + return this; + } + + @java.lang.SuppressWarnings("all") + private BuilderAccessWithGetter build() { + return new BuilderAccessWithGetter(this.string); + } + + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderAccessWithGetter.BuilderAccessWithGetterBuilder(string=" + this.string + ")"; + } + } + + @java.lang.SuppressWarnings("all") + private static BuilderAccessWithGetter.BuilderAccessWithGetterBuilder builder() { + return new BuilderAccessWithGetter.BuilderAccessWithGetterBuilder(); + } + + @java.lang.SuppressWarnings("all") + public String getString() { + return this.string; + } +} diff --git a/test/transform/resource/after-delombok/BuilderDefaultsWarnings.java b/test/transform/resource/after-delombok/BuilderDefaultsWarnings.java index 2b0a6d3b..c7e37abe 100644 --- a/test/transform/resource/after-delombok/BuilderDefaultsWarnings.java +++ b/test/transform/resource/after-delombok/BuilderDefaultsWarnings.java @@ -1,6 +1,4 @@ //skip-idempotent -import lombok.Builder; -@Builder public class BuilderDefaultsWarnings { long x = System.currentTimeMillis(); final int y = 5; @@ -87,7 +85,6 @@ public class BuilderDefaultsWarnings { } class NoBuilderButHasDefaults { private final long z = 5; - @Builder public NoBuilderButHasDefaults() { } @java.lang.SuppressWarnings("all") diff --git a/test/transform/resource/after-delombok/BuilderSingularNoAuto.java b/test/transform/resource/after-delombok/BuilderSingularNoAuto.java index 8c30f926..de86383f 100644 --- a/test/transform/resource/after-delombok/BuilderSingularNoAuto.java +++ b/test/transform/resource/after-delombok/BuilderSingularNoAuto.java @@ -1,6 +1,5 @@ //skip-idempotent import java.util.List; -@lombok.Builder class BuilderSingularNoAuto { private List<String> things; private List<String> widgets; diff --git a/test/transform/resource/after-delombok/BuilderSingularNoAutoWithSetterPrefix.java b/test/transform/resource/after-delombok/BuilderSingularNoAutoWithSetterPrefix.java index 4207cf74..8858f145 100644 --- a/test/transform/resource/after-delombok/BuilderSingularNoAutoWithSetterPrefix.java +++ b/test/transform/resource/after-delombok/BuilderSingularNoAutoWithSetterPrefix.java @@ -1,6 +1,5 @@ //skip-idempotent import java.util.List; -@lombok.Builder(setterPrefix = "with") class BuilderSingularNoAutoWithSetterPrefix { private List<String> things; private List<String> widgets; diff --git a/test/transform/resource/after-delombok/JacksonizedSuperBuilderWithJsonDeserialize.java b/test/transform/resource/after-delombok/JacksonizedSuperBuilderWithJsonDeserialize.java index d26b4ee4..1ed38f05 100644 --- a/test/transform/resource/after-delombok/JacksonizedSuperBuilderWithJsonDeserialize.java +++ b/test/transform/resource/after-delombok/JacksonizedSuperBuilderWithJsonDeserialize.java @@ -1,5 +1,4 @@ //skip-idempotent -@lombok.experimental.SuperBuilder @com.fasterxml.jackson.databind.annotation.JsonDeserialize public class JacksonizedSuperBuilderWithJsonDeserialize { int field1; diff --git a/test/transform/resource/after-ecj/BuilderAccessWithGetter.java b/test/transform/resource/after-ecj/BuilderAccessWithGetter.java new file mode 100644 index 00000000..7ad5fa6a --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderAccessWithGetter.java @@ -0,0 +1,35 @@ +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; +public final @Builder(access = AccessLevel.PRIVATE) class BuilderAccessWithGetter { + private static @java.lang.SuppressWarnings("all") class BuilderAccessWithGetterBuilder { + private @java.lang.SuppressWarnings("all") String string; + @java.lang.SuppressWarnings("all") BuilderAccessWithGetterBuilder() { + super(); + } + /** + * @return {@code this}. + */ + private @java.lang.SuppressWarnings("all") BuilderAccessWithGetter.BuilderAccessWithGetterBuilder string(final String string) { + this.string = string; + return this; + } + private @java.lang.SuppressWarnings("all") BuilderAccessWithGetter build() { + return new BuilderAccessWithGetter(this.string); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (("BuilderAccessWithGetter.BuilderAccessWithGetterBuilder(string=" + this.string) + ")"); + } + } + private final @Getter String string; + @java.lang.SuppressWarnings("all") BuilderAccessWithGetter(final String string) { + super(); + this.string = string; + } + private static @java.lang.SuppressWarnings("all") BuilderAccessWithGetter.BuilderAccessWithGetterBuilder builder() { + return new BuilderAccessWithGetter.BuilderAccessWithGetterBuilder(); + } + public @java.lang.SuppressWarnings("all") String getString() { + return this.string; + } +} diff --git a/test/transform/resource/before/BuilderAccessWithGetter.java b/test/transform/resource/before/BuilderAccessWithGetter.java new file mode 100644 index 00000000..38212ecf --- /dev/null +++ b/test/transform/resource/before/BuilderAccessWithGetter.java @@ -0,0 +1,10 @@ +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; + +@Builder(access = AccessLevel.PRIVATE) +public final class BuilderAccessWithGetter { + + @Getter + private final String string; +} |