diff options
Diffstat (limited to 'test/transform')
3 files changed, 227 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/BuilderWithDeprecated.java b/test/transform/resource/after-delombok/BuilderWithDeprecated.java new file mode 100644 index 00000000..3eb83139 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderWithDeprecated.java @@ -0,0 +1,129 @@ +import com.google.common.collect.ImmutableList; +public class BuilderWithDeprecated { + /** + * @deprecated + */ + String dep1; + @Deprecated + int dep2; + @Deprecated + java.util.List<String> strings; + @Deprecated + ImmutableList<Integer> numbers; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + BuilderWithDeprecated(final String dep1, final int dep2, final java.util.List<String> strings, final ImmutableList<Integer> numbers) { + this.dep1 = dep1; + this.dep2 = dep2; + this.strings = strings; + this.numbers = numbers; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public static class BuilderWithDeprecatedBuilder { + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private String dep1; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private int dep2; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private java.util.ArrayList<String> strings; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private com.google.common.collect.ImmutableList.Builder<Integer> numbers; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + BuilderWithDeprecatedBuilder() { + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderWithDeprecatedBuilder dep1(final String dep1) { + this.dep1 = dep1; + return this; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderWithDeprecatedBuilder dep2(final int dep2) { + this.dep2 = dep2; + return this; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderWithDeprecatedBuilder string(final String string) { + if (this.strings == null) this.strings = new java.util.ArrayList<String>(); + this.strings.add(string); + return this; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderWithDeprecatedBuilder strings(final java.util.Collection<? extends String> strings) { + if (this.strings == null) this.strings = new java.util.ArrayList<String>(); + this.strings.addAll(strings); + return this; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderWithDeprecatedBuilder clearStrings() { + if (this.strings != null) this.strings.clear(); + return this; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderWithDeprecatedBuilder number(final Integer number) { + if (this.numbers == null) this.numbers = com.google.common.collect.ImmutableList.builder(); + this.numbers.add(number); + return this; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderWithDeprecatedBuilder numbers(final java.lang.Iterable<? extends Integer> numbers) { + if (this.numbers == null) this.numbers = com.google.common.collect.ImmutableList.builder(); + this.numbers.addAll(numbers); + return this; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderWithDeprecatedBuilder clearNumbers() { + this.numbers = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderWithDeprecated build() { + java.util.List<String> strings; + switch (this.strings == null ? 0 : this.strings.size()) { + case 0: + strings = java.util.Collections.emptyList(); + break; + case 1: + strings = java.util.Collections.singletonList(this.strings.get(0)); + break; + default: + strings = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.strings)); + } + com.google.common.collect.ImmutableList<Integer> numbers = this.numbers == null ? com.google.common.collect.ImmutableList.<Integer>of() : this.numbers.build(); + return new BuilderWithDeprecated(dep1, dep2, strings, numbers); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public java.lang.String toString() { + return "BuilderWithDeprecated.BuilderWithDeprecatedBuilder(dep1=" + this.dep1 + ", dep2=" + this.dep2 + ", strings=" + this.strings + ", numbers=" + this.numbers + ")"; + } + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public static BuilderWithDeprecatedBuilder builder() { + return new BuilderWithDeprecatedBuilder(); + } +} diff --git a/test/transform/resource/after-ecj/BuilderWithDeprecated.java b/test/transform/resource/after-ecj/BuilderWithDeprecated.java new file mode 100644 index 00000000..af7a3806 --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderWithDeprecated.java @@ -0,0 +1,87 @@ +import com.google.common.collect.ImmutableList; +import lombok.Builder; +import lombok.Singular; +public @Builder class BuilderWithDeprecated { + public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class BuilderWithDeprecatedBuilder { + private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String dep1; + private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int dep2; + private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.util.ArrayList<String> strings; + private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") com.google.common.collect.ImmutableList.Builder<Integer> numbers; + @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithDeprecatedBuilder() { + super(); + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithDeprecatedBuilder dep1(final String dep1) { + this.dep1 = dep1; + return this; + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithDeprecatedBuilder dep2(final int dep2) { + this.dep2 = dep2; + return this; + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithDeprecatedBuilder string(String string) { + if ((this.strings == null)) + this.strings = new java.util.ArrayList<String>(); + this.strings.add(string); + return this; + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithDeprecatedBuilder strings(java.util.Collection<? extends String> strings) { + if ((this.strings == null)) + this.strings = new java.util.ArrayList<String>(); + this.strings.addAll(strings); + return this; + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithDeprecatedBuilder clearStrings() { + if ((this.strings != null)) + this.strings.clear(); + return this; + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithDeprecatedBuilder number(Integer number) { + if ((this.numbers == null)) + this.numbers = com.google.common.collect.ImmutableList.builder(); + this.numbers.add(number); + return this; + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithDeprecatedBuilder numbers(java.lang.Iterable<? extends Integer> numbers) { + if ((this.numbers == null)) + this.numbers = com.google.common.collect.ImmutableList.builder(); + this.numbers.addAll(numbers); + return this; + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithDeprecatedBuilder clearNumbers() { + this.numbers = null; + return this; + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithDeprecated build() { + java.util.List<String> strings; + switch (((this.strings == null) ? 0 : this.strings.size())) { + case 0 : + strings = java.util.Collections.emptyList(); + break; + case 1 : + strings = java.util.Collections.singletonList(this.strings.get(0)); + break; + default : + strings = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.strings)); + } + com.google.common.collect.ImmutableList<Integer> numbers = ((this.numbers == null) ? com.google.common.collect.ImmutableList.<Integer>of() : this.numbers.build()); + return new BuilderWithDeprecated(dep1, dep2, strings, numbers); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + return (((((((("BuilderWithDeprecated.BuilderWithDeprecatedBuilder(dep1=" + this.dep1) + ", dep2=") + this.dep2) + ", strings=") + this.strings) + ", numbers=") + this.numbers) + ")"); + } + } + String dep1; + @Deprecated int dep2; + @Singular @Deprecated java.util.List<String> strings; + @Singular @Deprecated ImmutableList<Integer> numbers; + @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithDeprecated(final String dep1, final int dep2, final java.util.List<String> strings, final ImmutableList<Integer> numbers) { + super(); + this.dep1 = dep1; + this.dep2 = dep2; + this.strings = strings; + this.numbers = numbers; + } + public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithDeprecatedBuilder builder() { + return new BuilderWithDeprecatedBuilder(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/before/BuilderWithDeprecated.java b/test/transform/resource/before/BuilderWithDeprecated.java new file mode 100644 index 00000000..cd8ffad9 --- /dev/null +++ b/test/transform/resource/before/BuilderWithDeprecated.java @@ -0,0 +1,11 @@ +import com.google.common.collect.ImmutableList; +import lombok.Builder; +import lombok.Singular; + +@Builder +public class BuilderWithDeprecated { + /** @deprecated */ String dep1; + @Deprecated int dep2; + @Singular @Deprecated java.util.List<String> strings; + @Singular @Deprecated ImmutableList<Integer> numbers; +} |