diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2020-10-03 23:51:33 +0200 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2020-10-03 23:51:33 +0200 |
commit | 1b534d17d39f687d42ebab733327a59c3466a949 (patch) | |
tree | d24e04a9c95b0caa0df855fb5d20b63730fc7707 /test/transform/resource/after-delombok | |
parent | eadd3b8ccea16d46249e6b01c4ac4b295c691abd (diff) | |
download | lombok-1b534d17d39f687d42ebab733327a59c3466a949.tar.gz lombok-1b534d17d39f687d42ebab733327a59c3466a949.tar.bz2 lombok-1b534d17d39f687d42ebab733327a59c3466a949.zip |
Untangling patches to classes that only exist in eclipse, not ecj
Specifically, Rawi01's patches to make javadoc behaviour in eclipse better,
which cannot be applied to ecj as you get load errors (javadoc not a thing there).
As part of this commit, tests can be limited to ecj or eclipse, and I made cut-down
versions of a few tests (to run on ecj, as the main one cannot be, due to javadoc issues).
The tests now marked as eclipse only don't fail on ecj, but they don't generate the same
result. Alternatively, we could go with a separated out after-ecj and after-eclipse dir
instead, but that's perhaps going overboard.
Diffstat (limited to 'test/transform/resource/after-delombok')
-rw-r--r-- | test/transform/resource/after-delombok/BuilderWithDeprecatedAnnOnly.java | 104 | ||||
-rw-r--r-- | test/transform/resource/after-delombok/WithMethodMarkedDeprecatedAnnOnly.java | 11 |
2 files changed, 115 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/BuilderWithDeprecatedAnnOnly.java b/test/transform/resource/after-delombok/BuilderWithDeprecatedAnnOnly.java new file mode 100644 index 00000000..f039c047 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderWithDeprecatedAnnOnly.java @@ -0,0 +1,104 @@ +import com.google.common.collect.ImmutableList; +public class BuilderWithDeprecatedAnnOnly { + @Deprecated + int dep1; + @Deprecated + java.util.List<String> strings; + @Deprecated + ImmutableList<Integer> numbers; + @java.lang.SuppressWarnings("all") + BuilderWithDeprecatedAnnOnly(final int dep1, final java.util.List<String> strings, final ImmutableList<Integer> numbers) { + this.dep1 = dep1; + this.strings = strings; + this.numbers = numbers; + } + @java.lang.SuppressWarnings("all") + public static class BuilderWithDeprecatedAnnOnlyBuilder { + @java.lang.SuppressWarnings("all") + private int dep1; + @java.lang.SuppressWarnings("all") + private java.util.ArrayList<String> strings; + @java.lang.SuppressWarnings("all") + private com.google.common.collect.ImmutableList.Builder<Integer> numbers; + @java.lang.SuppressWarnings("all") + BuilderWithDeprecatedAnnOnlyBuilder() { + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public BuilderWithDeprecatedAnnOnly.BuilderWithDeprecatedAnnOnlyBuilder dep1(final int dep1) { + this.dep1 = dep1; + return this; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public BuilderWithDeprecatedAnnOnly.BuilderWithDeprecatedAnnOnlyBuilder 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") + public BuilderWithDeprecatedAnnOnly.BuilderWithDeprecatedAnnOnlyBuilder strings(final java.util.Collection<? extends String> strings) { + if (strings == null) { + throw new java.lang.NullPointerException("strings cannot be null"); + } + if (this.strings == null) this.strings = new java.util.ArrayList<String>(); + this.strings.addAll(strings); + return this; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public BuilderWithDeprecatedAnnOnly.BuilderWithDeprecatedAnnOnlyBuilder clearStrings() { + if (this.strings != null) this.strings.clear(); + return this; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public BuilderWithDeprecatedAnnOnly.BuilderWithDeprecatedAnnOnlyBuilder 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") + public BuilderWithDeprecatedAnnOnly.BuilderWithDeprecatedAnnOnlyBuilder numbers(final java.lang.Iterable<? extends Integer> numbers) { + if (numbers == null) { + throw new java.lang.NullPointerException("numbers cannot be null"); + } + 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") + public BuilderWithDeprecatedAnnOnly.BuilderWithDeprecatedAnnOnlyBuilder clearNumbers() { + this.numbers = null; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderWithDeprecatedAnnOnly 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 BuilderWithDeprecatedAnnOnly(this.dep1, strings, numbers); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderWithDeprecatedAnnOnly.BuilderWithDeprecatedAnnOnlyBuilder(dep1=" + this.dep1 + ", strings=" + this.strings + ", numbers=" + this.numbers + ")"; + } + } + @java.lang.SuppressWarnings("all") + public static BuilderWithDeprecatedAnnOnly.BuilderWithDeprecatedAnnOnlyBuilder builder() { + return new BuilderWithDeprecatedAnnOnly.BuilderWithDeprecatedAnnOnlyBuilder(); + } +} diff --git a/test/transform/resource/after-delombok/WithMethodMarkedDeprecatedAnnOnly.java b/test/transform/resource/after-delombok/WithMethodMarkedDeprecatedAnnOnly.java new file mode 100644 index 00000000..551b59bf --- /dev/null +++ b/test/transform/resource/after-delombok/WithMethodMarkedDeprecatedAnnOnly.java @@ -0,0 +1,11 @@ +class WithMethodMarkedDeprecatedAnnOnly { + @Deprecated + int annotation; + WithMethodMarkedDeprecatedAnnOnly(int annotation) { + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public WithMethodMarkedDeprecatedAnnOnly withAnnotation(final int annotation) { + return this.annotation == annotation ? this : new WithMethodMarkedDeprecatedAnnOnly(annotation); + } +} |