diff options
Diffstat (limited to 'test')
20 files changed, 474 insertions, 22 deletions
diff --git a/test/transform/resource/after-delombok/BuilderInstanceMethod.java b/test/transform/resource/after-delombok/BuilderInstanceMethod.java new file mode 100644 index 00000000..61e237d0 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderInstanceMethod.java @@ -0,0 +1,66 @@ +import java.util.List; +class BuilderInstanceMethod<T> { + public String create(int show, final int yes, List<T> also, int $andMe) { + return "" + show + yes + also + $andMe; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public class StringBuilder { + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private int show; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private int yes; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private List<T> also; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + private int $andMe; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + StringBuilder() { + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public StringBuilder show(final int show) { + this.show = show; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public StringBuilder yes(final int yes) { + this.yes = yes; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public StringBuilder also(final List<T> also) { + this.also = also; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public StringBuilder $andMe(final int $andMe) { + this.$andMe = $andMe; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public String build() { + return BuilderInstanceMethod.this.create(show, yes, also, $andMe); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public java.lang.String toString() { + return "BuilderInstanceMethod.StringBuilder(show=" + this.show + ", yes=" + this.yes + ", also=" + this.also + ", $andMe=" + this.$andMe + ")"; + } + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public StringBuilder builder() { + return new StringBuilder(); + } +} diff --git a/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java b/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java index f8e0579d..79ffbc8b 100644 --- a/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java +++ b/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java @@ -2,19 +2,22 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableCollection; import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSortedSet; +import com.google.common.collect.ImmutableTable; class BuilderSingularGuavaListsSets<T> { private ImmutableList<T> cards; private ImmutableCollection<? extends Number> frogs; @SuppressWarnings("all") private ImmutableSet rawSet; private ImmutableSortedSet<String> passes; + private ImmutableTable<? extends Number, ? extends Number, String> users; @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") - BuilderSingularGuavaListsSets(final ImmutableList<T> cards, final ImmutableCollection<? extends Number> frogs, final ImmutableSet rawSet, final ImmutableSortedSet<String> passes) { + BuilderSingularGuavaListsSets(final ImmutableList<T> cards, final ImmutableCollection<? extends Number> frogs, final ImmutableSet rawSet, final ImmutableSortedSet<String> passes, final ImmutableTable<? extends Number, ? extends Number, String> users) { this.cards = cards; this.frogs = frogs; this.rawSet = rawSet; this.passes = passes; + this.users = users; } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") @@ -33,6 +36,9 @@ class BuilderSingularGuavaListsSets<T> { private com.google.common.collect.ImmutableSortedSet.Builder<String> passes; @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + private com.google.common.collect.ImmutableTable.Builder<Number, Number, String> users; + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder() { } @java.lang.SuppressWarnings("all") @@ -51,6 +57,12 @@ class BuilderSingularGuavaListsSets<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularGuavaListsSetsBuilder<T> clearCards() { + this.cards = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> frog(final Number frog) { if (this.frogs == null) this.frogs = com.google.common.collect.ImmutableList.builder(); this.frogs.add(frog); @@ -65,6 +77,12 @@ class BuilderSingularGuavaListsSets<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularGuavaListsSetsBuilder<T> clearFrogs() { + this.frogs = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> rawSet(final java.lang.Object rawSet) { if (this.rawSet == null) this.rawSet = com.google.common.collect.ImmutableSet.builder(); this.rawSet.add(rawSet); @@ -79,6 +97,12 @@ class BuilderSingularGuavaListsSets<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularGuavaListsSetsBuilder<T> clearRawSet() { + this.rawSet = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSetsBuilder<T> pass(final String pass) { if (this.passes == null) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder(); this.passes.add(pass); @@ -93,18 +117,45 @@ class BuilderSingularGuavaListsSets<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularGuavaListsSetsBuilder<T> clearPasses() { + this.passes = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderSingularGuavaListsSetsBuilder<T> user(final Number rowKey, final Number columnKey, final String value) { + if (this.users == null) this.users = com.google.common.collect.ImmutableTable.builder(); + this.users.put(rowKey, columnKey, value); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderSingularGuavaListsSetsBuilder<T> users(final com.google.common.collect.Table<? extends Number, ? extends Number, ? extends String> users) { + if (this.users == null) this.users = com.google.common.collect.ImmutableTable.builder(); + this.users.putAll(users); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderSingularGuavaListsSetsBuilder<T> clearUsers() { + this.users = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularGuavaListsSets<T> build() { com.google.common.collect.ImmutableList<T> cards = this.cards == null ? com.google.common.collect.ImmutableList.<T>of() : this.cards.build(); com.google.common.collect.ImmutableCollection<Number> frogs = this.frogs == null ? com.google.common.collect.ImmutableList.<Number>of() : this.frogs.build(); com.google.common.collect.ImmutableSet<java.lang.Object> rawSet = this.rawSet == null ? com.google.common.collect.ImmutableSet.<java.lang.Object>of() : this.rawSet.build(); com.google.common.collect.ImmutableSortedSet<String> passes = this.passes == null ? com.google.common.collect.ImmutableSortedSet.<String>of() : this.passes.build(); - return new BuilderSingularGuavaListsSets<T>(cards, frogs, rawSet, passes); + com.google.common.collect.ImmutableTable<Number, Number, String> users = this.users == null ? com.google.common.collect.ImmutableTable.<Number, Number, String>of() : this.users.build(); + return new BuilderSingularGuavaListsSets<T>(cards, frogs, rawSet, passes, users); } @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") public java.lang.String toString() { - return "BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder(cards=" + this.cards + ", frogs=" + this.frogs + ", rawSet=" + this.rawSet + ", passes=" + this.passes + ")"; + return "BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder(cards=" + this.cards + ", frogs=" + this.frogs + ", rawSet=" + this.rawSet + ", passes=" + this.passes + ", users=" + this.users + ")"; } } @java.lang.SuppressWarnings("all") diff --git a/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java b/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java index 0cb0001b..1ad8fa83 100644 --- a/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java +++ b/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java @@ -31,9 +31,9 @@ class BuilderSingularGuavaMaps<K, V> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") - public BuilderSingularGuavaMapsBuilder<K, V> battleaxe(final K battleaxe$key, final V battleaxe$value) { + public BuilderSingularGuavaMapsBuilder<K, V> battleaxe(final K key, final V value) { if (this.battleaxes == null) this.battleaxes = com.google.common.collect.ImmutableMap.builder(); - this.battleaxes.put(battleaxe$key, battleaxe$value); + this.battleaxes.put(key, value); return this; } @java.lang.SuppressWarnings("all") @@ -45,9 +45,15 @@ class BuilderSingularGuavaMaps<K, V> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") - public BuilderSingularGuavaMapsBuilder<K, V> vertex(final Integer vertex$key, final V vertex$value) { + public BuilderSingularGuavaMapsBuilder<K, V> clearBattleaxes() { + this.battleaxes = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderSingularGuavaMapsBuilder<K, V> vertex(final Integer key, final V value) { if (this.vertices == null) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder(); - this.vertices.put(vertex$key, vertex$value); + this.vertices.put(key, value); return this; } @java.lang.SuppressWarnings("all") @@ -59,9 +65,15 @@ class BuilderSingularGuavaMaps<K, V> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") - public BuilderSingularGuavaMapsBuilder<K, V> rawMap(final java.lang.Object rawMap$key, final java.lang.Object rawMap$value) { + public BuilderSingularGuavaMapsBuilder<K, V> clearVertices() { + this.vertices = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderSingularGuavaMapsBuilder<K, V> rawMap(final java.lang.Object key, final java.lang.Object value) { if (this.rawMap == null) this.rawMap = com.google.common.collect.ImmutableBiMap.builder(); - this.rawMap.put(rawMap$key, rawMap$value); + this.rawMap.put(key, value); return this; } @java.lang.SuppressWarnings("all") @@ -73,6 +85,12 @@ class BuilderSingularGuavaMaps<K, V> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularGuavaMapsBuilder<K, V> clearRawMap() { + this.rawMap = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularGuavaMaps<K, V> build() { com.google.common.collect.ImmutableMap<K, V> battleaxes = this.battleaxes == null ? com.google.common.collect.ImmutableMap.<K, V>of() : this.battleaxes.build(); com.google.common.collect.ImmutableSortedMap<Integer, V> vertices = this.vertices == null ? com.google.common.collect.ImmutableSortedMap.<Integer, V>of() : this.vertices.build(); diff --git a/test/transform/resource/after-delombok/BuilderSingularLists.java b/test/transform/resource/after-delombok/BuilderSingularLists.java index f58934d4..9b409404 100644 --- a/test/transform/resource/after-delombok/BuilderSingularLists.java +++ b/test/transform/resource/after-delombok/BuilderSingularLists.java @@ -44,6 +44,12 @@ class BuilderSingularLists<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularListsBuilder<T> clearChildren() { + if (this.children != null) this.children.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularListsBuilder<T> scarf(final Number scarf) { if (this.scarves == null) this.scarves = new java.util.ArrayList<Number>(); this.scarves.add(scarf); @@ -58,6 +64,12 @@ class BuilderSingularLists<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularListsBuilder<T> clearScarves() { + if (this.scarves != null) this.scarves.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularListsBuilder<T> rawList(final java.lang.Object rawList) { if (this.rawList == null) this.rawList = new java.util.ArrayList<java.lang.Object>(); this.rawList.add(rawList); @@ -72,6 +84,12 @@ class BuilderSingularLists<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularListsBuilder<T> clearRawList() { + if (this.rawList != null) this.rawList.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularLists<T> build() { java.util.List<T> children; switch (this.children == null ? 0 : this.children.size()) { diff --git a/test/transform/resource/after-delombok/BuilderSingularMaps.java b/test/transform/resource/after-delombok/BuilderSingularMaps.java index 212ece26..257a2ec2 100644 --- a/test/transform/resource/after-delombok/BuilderSingularMaps.java +++ b/test/transform/resource/after-delombok/BuilderSingularMaps.java @@ -57,6 +57,14 @@ class BuilderSingularMaps<K, V> { return this; } @SuppressWarnings("all") + public BuilderSingularMapsBuilder<K, V> clearWomen() { + if (this.women$key != null) { + this.women$key.clear(); + this.women$value.clear(); + } + return this; + } + @SuppressWarnings("all") public BuilderSingularMapsBuilder<K, V> man(K manKey, Number manValue) { if (this.men$key == null) { this.men$key = new java.util.ArrayList<K>(); @@ -79,6 +87,14 @@ class BuilderSingularMaps<K, V> { return this; } @SuppressWarnings("all") + public BuilderSingularMapsBuilder<K, V> clearMen() { + if (this.men$key != null) { + this.men$key.clear(); + this.men$value.clear(); + } + return this; + } + @SuppressWarnings("all") public BuilderSingularMapsBuilder<K, V> rawMap(Object rawMapKey, Object rawMapValue) { if (this.rawMap$key == null) { this.rawMap$key = new java.util.ArrayList<Object>(); @@ -101,6 +117,14 @@ class BuilderSingularMaps<K, V> { return this; } @SuppressWarnings("all") + public BuilderSingularMapsBuilder<K, V> clearRawMap() { + if (this.rawMap$key != null) { + this.rawMap$key.clear(); + this.rawMap$value.clear(); + } + return this; + } + @SuppressWarnings("all") public BuilderSingularMapsBuilder<K, V> stringMap(String stringMapKey, V stringMapValue) { if (this.stringMap$key == null) { this.stringMap$key = new java.util.ArrayList<String>(); @@ -123,6 +147,14 @@ class BuilderSingularMaps<K, V> { return this; } @SuppressWarnings("all") + public BuilderSingularMapsBuilder<K, V> clearStringMap() { + if (this.stringMap$key != null) { + this.stringMap$key.clear(); + this.stringMap$value.clear(); + } + return this; + } + @SuppressWarnings("all") public BuilderSingularMaps<K, V> build() { java.util.Map<K, V> women; switch (this.women$key == null ? 0 : this.women$key.size()) { diff --git a/test/transform/resource/after-delombok/BuilderSingularNoAuto.java b/test/transform/resource/after-delombok/BuilderSingularNoAuto.java index 0be33a84..d5cd8f41 100644 --- a/test/transform/resource/after-delombok/BuilderSingularNoAuto.java +++ b/test/transform/resource/after-delombok/BuilderSingularNoAuto.java @@ -42,6 +42,12 @@ class BuilderSingularNoAuto { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularNoAutoBuilder clearThings() { + if (this.things != null) this.things.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularNoAutoBuilder widget(final String widget) { if (this.widgets == null) this.widgets = new java.util.ArrayList<String>(); this.widgets.add(widget); @@ -56,6 +62,12 @@ class BuilderSingularNoAuto { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularNoAutoBuilder clearWidgets() { + if (this.widgets != null) this.widgets.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularNoAutoBuilder items(final String items) { if (this.items == null) this.items = new java.util.ArrayList<String>(); this.items.add(items); @@ -70,6 +82,12 @@ class BuilderSingularNoAuto { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularNoAutoBuilder clearItems() { + if (this.items != null) this.items.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularNoAuto build() { java.util.List<String> things; switch (this.things == null ? 0 : this.things.size()) { diff --git a/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java b/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java index 0dd40c9f..7ffa647b 100644 --- a/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java +++ b/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java @@ -44,9 +44,15 @@ class BuilderSingularRedirectToGuava { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") - public BuilderSingularRedirectToGuavaBuilder thing(final Integer thing$key, final Number thing$value) { + public BuilderSingularRedirectToGuavaBuilder clearDangerMice() { + this.dangerMice = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") + public BuilderSingularRedirectToGuavaBuilder thing(final Integer key, final Number value) { if (this.things == null) this.things = com.google.common.collect.ImmutableSortedMap.naturalOrder(); - this.things.put(thing$key, thing$value); + this.things.put(key, value); return this; } @java.lang.SuppressWarnings("all") @@ -58,6 +64,12 @@ class BuilderSingularRedirectToGuava { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularRedirectToGuavaBuilder clearThings() { + this.things = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularRedirectToGuavaBuilder doohickey(final Class<?> doohickey) { if (this.doohickeys == null) this.doohickeys = com.google.common.collect.ImmutableList.builder(); this.doohickeys.add(doohickey); @@ -72,6 +84,12 @@ class BuilderSingularRedirectToGuava { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularRedirectToGuavaBuilder clearDoohickeys() { + this.doohickeys = null; + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularRedirectToGuava build() { java.util.Set<String> dangerMice = this.dangerMice == null ? com.google.common.collect.ImmutableSet.<String>of() : this.dangerMice.build(); java.util.NavigableMap<Integer, Number> things = this.things == null ? com.google.common.collect.ImmutableSortedMap.<Integer, Number>of() : this.things.build(); diff --git a/test/transform/resource/after-delombok/BuilderSingularSets.java b/test/transform/resource/after-delombok/BuilderSingularSets.java index 70372b99..c794726a 100644 --- a/test/transform/resource/after-delombok/BuilderSingularSets.java +++ b/test/transform/resource/after-delombok/BuilderSingularSets.java @@ -49,6 +49,12 @@ class BuilderSingularSets<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularSetsBuilder<T> clearDangerMice() { + if (this.dangerMice != null) this.dangerMice.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularSetsBuilder<T> octopus(final Number octopus) { if (this.octopodes == null) this.octopodes = new java.util.ArrayList<Number>(); this.octopodes.add(octopus); @@ -63,6 +69,12 @@ class BuilderSingularSets<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularSetsBuilder<T> clearOctopodes() { + if (this.octopodes != null) this.octopodes.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularSetsBuilder<T> rawSet(final java.lang.Object rawSet) { if (this.rawSet == null) this.rawSet = new java.util.ArrayList<java.lang.Object>(); this.rawSet.add(rawSet); @@ -77,6 +89,12 @@ class BuilderSingularSets<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularSetsBuilder<T> clearRawSet() { + if (this.rawSet != null) this.rawSet.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularSetsBuilder<T> stringSet(final String stringSet) { if (this.stringSet == null) this.stringSet = new java.util.ArrayList<String>(); this.stringSet.add(stringSet); @@ -91,6 +109,12 @@ class BuilderSingularSets<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderSingularSetsBuilder<T> clearStringSet() { + if (this.stringSet != null) this.stringSet.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderSingularSets<T> build() { java.util.Set<T> dangerMice; switch (this.dangerMice == null ? 0 : this.dangerMice.size()) { diff --git a/test/transform/resource/after-delombok/BuilderWithToBuilder.java b/test/transform/resource/after-delombok/BuilderWithToBuilder.java index eb61a6db..7dfb046a 100644 --- a/test/transform/resource/after-delombok/BuilderWithToBuilder.java +++ b/test/transform/resource/after-delombok/BuilderWithToBuilder.java @@ -68,6 +68,12 @@ class BuilderWithToBuilder<T> { } @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") + public BuilderWithToBuilderBuilder<T> clearBars() { + if (this.bars != null) this.bars.clear(); + return this; + } + @java.lang.SuppressWarnings("all") + @javax.annotation.Generated("lombok") public BuilderWithToBuilder<T> build() { java.util.List<T> bars; switch (this.bars == null ? 0 : this.bars.size()) { diff --git a/test/transform/resource/after-ecj/BuilderInstanceMethod.java b/test/transform/resource/after-ecj/BuilderInstanceMethod.java new file mode 100644 index 00000000..ff7d0aab --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderInstanceMethod.java @@ -0,0 +1,43 @@ +import java.util.List; +class BuilderInstanceMethod<T> { + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class StringBuilder { + private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int show; + private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int yes; + private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") List<T> also; + private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") int $andMe; + @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StringBuilder() { + super(); + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StringBuilder show(final int show) { + this.show = show; + return this; + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StringBuilder yes(final int yes) { + this.yes = yes; + return this; + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StringBuilder also(final List<T> also) { + this.also = also; + return this; + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StringBuilder $andMe(final int $andMe) { + this.$andMe = $andMe; + return this; + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String build() { + return BuilderInstanceMethod.this.create(show, yes, also, $andMe); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { + return (((((((("BuilderInstanceMethod.StringBuilder(show=" + this.show) + ", yes=") + this.yes) + ", also=") + this.also) + ", $andMe=") + this.$andMe) + ")"); + } + } + BuilderInstanceMethod() { + super(); + } + public @lombok.Builder String create(int show, final int yes, List<T> also, int $andMe) { + return (((("" + show) + yes) + also) + $andMe); + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") StringBuilder builder() { + return new StringBuilder(); + } +} diff --git a/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java b/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java index e7aa7835..5cf9f4ac 100644 --- a/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java +++ b/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java @@ -2,6 +2,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableCollection; import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSortedSet; +import com.google.common.collect.ImmutableTable; import lombok.Singular; @lombok.Builder class BuilderSingularGuavaListsSets<T> { public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") class BuilderSingularGuavaListsSetsBuilder<T> { @@ -9,6 +10,7 @@ import lombok.Singular; private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") com.google.common.collect.ImmutableList.Builder<Number> frogs; private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") com.google.common.collect.ImmutableSet.Builder<java.lang.Object> rawSet; private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") com.google.common.collect.ImmutableSortedSet.Builder<String> passes; + private @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") com.google.common.collect.ImmutableTable.Builder<Number, Number, String> users; @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder() { super(); } @@ -24,6 +26,10 @@ import lombok.Singular; this.cards.addAll(cards); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> clearCards() { + this.cards = null; + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> frog(Number frog) { if ((this.frogs == null)) this.frogs = com.google.common.collect.ImmutableList.builder(); @@ -36,6 +42,10 @@ import lombok.Singular; this.frogs.addAll(frogs); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> clearFrogs() { + this.frogs = null; + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> rawSet(java.lang.Object rawSet) { if ((this.rawSet == null)) this.rawSet = com.google.common.collect.ImmutableSet.builder(); @@ -48,6 +58,10 @@ import lombok.Singular; this.rawSet.addAll(rawSet); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> clearRawSet() { + this.rawSet = null; + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> pass(String pass) { if ((this.passes == null)) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder(); @@ -60,27 +74,50 @@ import lombok.Singular; this.passes.addAll(passes); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> clearPasses() { + this.passes = null; + return this; + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> user(Number rowKey, Number columnKey, String value) { + if ((this.users == null)) + this.users = com.google.common.collect.ImmutableTable.builder(); + this.users.put(rowKey, columnKey, value); + return this; + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> users(com.google.common.collect.Table<? extends Number, ? extends Number, ? extends String> users) { + if ((this.users == null)) + this.users = com.google.common.collect.ImmutableTable.builder(); + this.users.putAll(users); + return this; + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSetsBuilder<T> clearUsers() { + this.users = null; + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSets<T> build() { com.google.common.collect.ImmutableList<T> cards = ((this.cards == null) ? com.google.common.collect.ImmutableList.<T>of() : this.cards.build()); com.google.common.collect.ImmutableCollection<Number> frogs = ((this.frogs == null) ? com.google.common.collect.ImmutableList.<Number>of() : this.frogs.build()); com.google.common.collect.ImmutableSet<java.lang.Object> rawSet = ((this.rawSet == null) ? com.google.common.collect.ImmutableSet.<java.lang.Object>of() : this.rawSet.build()); com.google.common.collect.ImmutableSortedSet<String> passes = ((this.passes == null) ? com.google.common.collect.ImmutableSortedSet.<String>of() : this.passes.build()); - return new BuilderSingularGuavaListsSets<T>(cards, frogs, rawSet, passes); + com.google.common.collect.ImmutableTable<Number, Number, String> users = ((this.users == null) ? com.google.common.collect.ImmutableTable.<Number, Number, String>of() : this.users.build()); + return new BuilderSingularGuavaListsSets<T>(cards, frogs, rawSet, passes, users); } public @java.lang.Override @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") java.lang.String toString() { - return (((((((("BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder(cards=" + this.cards) + ", frogs=") + this.frogs) + ", rawSet=") + this.rawSet) + ", passes=") + this.passes) + ")"); + return (((((((((("BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder(cards=" + this.cards) + ", frogs=") + this.frogs) + ", rawSet=") + this.rawSet) + ", passes=") + this.passes) + ", users=") + this.users) + ")"); } } private @Singular ImmutableList<T> cards; private @Singular ImmutableCollection<? extends Number> frogs; private @SuppressWarnings("all") @Singular("rawSet") ImmutableSet rawSet; private @Singular ImmutableSortedSet<String> passes; - @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSets(final ImmutableList<T> cards, final ImmutableCollection<? extends Number> frogs, final ImmutableSet rawSet, final ImmutableSortedSet<String> passes) { + private @Singular ImmutableTable<? extends Number, ? extends Number, String> users; + @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaListsSets(final ImmutableList<T> cards, final ImmutableCollection<? extends Number> frogs, final ImmutableSet rawSet, final ImmutableSortedSet<String> passes, final ImmutableTable<? extends Number, ? extends Number, String> users) { super(); this.cards = cards; this.frogs = frogs; this.rawSet = rawSet; this.passes = passes; + this.users = users; } public static @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") <T>BuilderSingularGuavaListsSetsBuilder<T> builder() { return new BuilderSingularGuavaListsSetsBuilder<T>(); diff --git a/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java b/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java index d4dfc18a..378ec309 100644 --- a/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java +++ b/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java @@ -10,10 +10,10 @@ import lombok.Singular; @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder() { super(); } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> battleaxe(K battleaxe$key, V battleaxe$value) { + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> battleaxe(K key, V value) { if ((this.battleaxes == null)) this.battleaxes = com.google.common.collect.ImmutableMap.builder(); - this.battleaxes.put(battleaxe$key, battleaxe$value); + this.battleaxes.put(key, value); return this; } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> battleaxes(java.util.Map<? extends K, ? extends V> battleaxes) { @@ -22,10 +22,14 @@ import lombok.Singular; this.battleaxes.putAll(battleaxes); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> vertex(Integer vertex$key, V vertex$value) { + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> clearBattleaxes() { + this.battleaxes = null; + return this; + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> vertex(Integer key, V value) { if ((this.vertices == null)) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder(); - this.vertices.put(vertex$key, vertex$value); + this.vertices.put(key, value); return this; } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> vertices(java.util.Map<? extends Integer, ? extends V> vertices) { @@ -34,10 +38,14 @@ import lombok.Singular; this.vertices.putAll(vertices); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> rawMap(java.lang.Object rawMap$key, java.lang.Object rawMap$value) { + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> clearVertices() { + this.vertices = null; + return this; + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> rawMap(java.lang.Object key, java.lang.Object value) { if ((this.rawMap == null)) this.rawMap = com.google.common.collect.ImmutableBiMap.builder(); - this.rawMap.put(rawMap$key, rawMap$value); + this.rawMap.put(key, value); return this; } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> rawMap(java.util.Map<?, ?> rawMap) { @@ -46,6 +54,10 @@ import lombok.Singular; this.rawMap.putAll(rawMap); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMapsBuilder<K, V> clearRawMap() { + this.rawMap = null; + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularGuavaMaps<K, V> build() { com.google.common.collect.ImmutableMap<K, V> battleaxes = ((this.battleaxes == null) ? com.google.common.collect.ImmutableMap.<K, V>of() : this.battleaxes.build()); com.google.common.collect.ImmutableSortedMap<Integer, V> vertices = ((this.vertices == null) ? com.google.common.collect.ImmutableSortedMap.<Integer, V>of() : this.vertices.build()); diff --git a/test/transform/resource/after-ecj/BuilderSingularLists.java b/test/transform/resource/after-ecj/BuilderSingularLists.java index c66fcf1b..e1036262 100644 --- a/test/transform/resource/after-ecj/BuilderSingularLists.java +++ b/test/transform/resource/after-ecj/BuilderSingularLists.java @@ -22,6 +22,11 @@ import lombok.Singular; this.children.addAll(children); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> clearChildren() { + if ((this.children != null)) + this.children.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> scarf(Number scarf) { if ((this.scarves == null)) this.scarves = new java.util.ArrayList<Number>(); @@ -34,6 +39,11 @@ import lombok.Singular; this.scarves.addAll(scarves); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> clearScarves() { + if ((this.scarves != null)) + this.scarves.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> rawList(java.lang.Object rawList) { if ((this.rawList == null)) this.rawList = new java.util.ArrayList<java.lang.Object>(); @@ -46,6 +56,11 @@ import lombok.Singular; this.rawList.addAll(rawList); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularListsBuilder<T> clearRawList() { + if ((this.rawList != null)) + this.rawList.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularLists<T> build() { java.util.List<T> children; switch (((this.children == null) ? 0 : this.children.size())) { diff --git a/test/transform/resource/after-ecj/BuilderSingularMaps.java b/test/transform/resource/after-ecj/BuilderSingularMaps.java index 8a2e14eb..38ac0ed7 100644 --- a/test/transform/resource/after-ecj/BuilderSingularMaps.java +++ b/test/transform/resource/after-ecj/BuilderSingularMaps.java @@ -37,6 +37,14 @@ import lombok.Singular; } return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> clearWomen() { + if ((this.women$key != null)) + { + this.women$key.clear(); + this.women$value.clear(); + } + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> man(K manKey, Number manValue) { if ((this.men$key == null)) { @@ -60,6 +68,14 @@ import lombok.Singular; } return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> clearMen() { + if ((this.men$key != null)) + { + this.men$key.clear(); + this.men$value.clear(); + } + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> rawMap(java.lang.Object rawMapKey, java.lang.Object rawMapValue) { if ((this.rawMap$key == null)) { @@ -83,6 +99,14 @@ import lombok.Singular; } return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> clearRawMap() { + if ((this.rawMap$key != null)) + { + this.rawMap$key.clear(); + this.rawMap$value.clear(); + } + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> stringMap(String stringMapKey, V stringMapValue) { if ((this.stringMap$key == null)) { @@ -106,6 +130,14 @@ import lombok.Singular; } return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMapsBuilder<K, V> clearStringMap() { + if ((this.stringMap$key != null)) + { + this.stringMap$key.clear(); + this.stringMap$value.clear(); + } + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularMaps<K, V> build() { java.util.Map<K, V> women; switch (((this.women$key == null) ? 0 : this.women$key.size())) { diff --git a/test/transform/resource/after-ecj/BuilderSingularNoAuto.java b/test/transform/resource/after-ecj/BuilderSingularNoAuto.java index d5b06f1e..1b79538c 100644 --- a/test/transform/resource/after-ecj/BuilderSingularNoAuto.java +++ b/test/transform/resource/after-ecj/BuilderSingularNoAuto.java @@ -20,6 +20,11 @@ import lombok.Singular; this.things.addAll(things); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder clearThings() { + if ((this.things != null)) + this.things.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder widget(String widget) { if ((this.widgets == null)) this.widgets = new java.util.ArrayList<String>(); @@ -32,6 +37,11 @@ import lombok.Singular; this.widgets.addAll(widgets); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder clearWidgets() { + if ((this.widgets != null)) + this.widgets.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder items(String items) { if ((this.items == null)) this.items = new java.util.ArrayList<String>(); @@ -44,6 +54,11 @@ import lombok.Singular; this.items.addAll(items); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAutoBuilder clearItems() { + if ((this.items != null)) + this.items.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularNoAuto build() { java.util.List<String> things; switch (((this.things == null) ? 0 : this.things.size())) { diff --git a/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java b/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java index 6e18d8ee..84335f46 100644 --- a/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java +++ b/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java @@ -22,10 +22,14 @@ import lombok.Singular; this.dangerMice.addAll(dangerMice); return this; } - public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder thing(Integer thing$key, Number thing$value) { + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder clearDangerMice() { + this.dangerMice = null; + return this; + } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder thing(Integer key, Number value) { if ((this.things == null)) this.things = com.google.common.collect.ImmutableSortedMap.naturalOrder(); - this.things.put(thing$key, thing$value); + this.things.put(key, value); return this; } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder things(java.util.Map<? extends Integer, ? extends Number> things) { @@ -34,6 +38,10 @@ import lombok.Singular; this.things.putAll(things); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder clearThings() { + this.things = null; + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder doohickey(Class<?> doohickey) { if ((this.doohickeys == null)) this.doohickeys = com.google.common.collect.ImmutableList.builder(); @@ -46,6 +54,10 @@ import lombok.Singular; this.doohickeys.addAll(doohickeys); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuavaBuilder clearDoohickeys() { + this.doohickeys = null; + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularRedirectToGuava build() { java.util.Set<String> dangerMice = ((this.dangerMice == null) ? com.google.common.collect.ImmutableSet.<String>of() : this.dangerMice.build()); java.util.NavigableMap<Integer, Number> things = ((this.things == null) ? com.google.common.collect.ImmutableSortedMap.<Integer, Number>of() : this.things.build()); diff --git a/test/transform/resource/after-ecj/BuilderSingularSets.java b/test/transform/resource/after-ecj/BuilderSingularSets.java index 819de534..118eb16f 100644 --- a/test/transform/resource/after-ecj/BuilderSingularSets.java +++ b/test/transform/resource/after-ecj/BuilderSingularSets.java @@ -22,6 +22,11 @@ import lombok.Singular; this.dangerMice.addAll(dangerMice); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> clearDangerMice() { + if ((this.dangerMice != null)) + this.dangerMice.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> octopus(Number octopus) { if ((this.octopodes == null)) this.octopodes = new java.util.ArrayList<Number>(); @@ -34,6 +39,11 @@ import lombok.Singular; this.octopodes.addAll(octopodes); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> clearOctopodes() { + if ((this.octopodes != null)) + this.octopodes.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> rawSet(java.lang.Object rawSet) { if ((this.rawSet == null)) this.rawSet = new java.util.ArrayList<java.lang.Object>(); @@ -46,6 +56,11 @@ import lombok.Singular; this.rawSet.addAll(rawSet); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> clearRawSet() { + if ((this.rawSet != null)) + this.rawSet.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> stringSet(String stringSet) { if ((this.stringSet == null)) this.stringSet = new java.util.ArrayList<String>(); @@ -58,6 +73,11 @@ import lombok.Singular; this.stringSet.addAll(stringSet); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSetsBuilder<T> clearStringSet() { + if ((this.stringSet != null)) + this.stringSet.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderSingularSets<T> build() { java.util.Set<T> dangerMice; switch (((this.dangerMice == null) ? 0 : this.dangerMice.size())) { diff --git a/test/transform/resource/after-ecj/BuilderWithToBuilder.java b/test/transform/resource/after-ecj/BuilderWithToBuilder.java index 423865ff..0d296cb6 100644 --- a/test/transform/resource/after-ecj/BuilderWithToBuilder.java +++ b/test/transform/resource/after-ecj/BuilderWithToBuilder.java @@ -33,6 +33,11 @@ import lombok.Builder; this.bars.addAll(bars); return this; } + public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilderBuilder<T> clearBars() { + if ((this.bars != null)) + this.bars.clear(); + return this; + } public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") BuilderWithToBuilder<T> build() { java.util.List<T> bars; switch (((this.bars == null) ? 0 : this.bars.size())) { diff --git a/test/transform/resource/before/BuilderInstanceMethod.java b/test/transform/resource/before/BuilderInstanceMethod.java new file mode 100644 index 00000000..666664a2 --- /dev/null +++ b/test/transform/resource/before/BuilderInstanceMethod.java @@ -0,0 +1,8 @@ +import java.util.List; + +class BuilderInstanceMethod<T> { + @lombok.Builder + public String create(int show, final int yes, List<T> also, int $andMe) { + return "" + show + yes + also + $andMe; + } +} diff --git a/test/transform/resource/before/BuilderSingularGuavaListsSets.java b/test/transform/resource/before/BuilderSingularGuavaListsSets.java index 995c00e8..73e8018c 100644 --- a/test/transform/resource/before/BuilderSingularGuavaListsSets.java +++ b/test/transform/resource/before/BuilderSingularGuavaListsSets.java @@ -2,6 +2,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableCollection; import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSortedSet; +import com.google.common.collect.ImmutableTable; import lombok.Singular; @@ -11,4 +12,5 @@ class BuilderSingularGuavaListsSets<T> { @Singular private ImmutableCollection<? extends Number> frogs; @SuppressWarnings("all") @Singular("rawSet") private ImmutableSet rawSet; @Singular private ImmutableSortedSet<String> passes; + @Singular private ImmutableTable<? extends Number, ? extends Number, String> users; } |