From 19de8fbe4743afc58df39555602c67e46fc2e016 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 20 Jan 2015 22:24:40 +0100 Subject: brainfarted ‘singleton’ where I meant ‘singular’ in all the test files. Whoops! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BuilderSingletonGuavaListsSets.java | 93 ----------- .../after-delombok/BuilderSingletonGuavaMaps.java | 76 --------- .../after-delombok/BuilderSingletonLists.java | 111 ------------- .../after-delombok/BuilderSingletonMaps.java | 173 -------------------- .../BuilderSingletonRedirectToGuava.java | 75 --------- .../after-delombok/BuilderSingletonSets.java | 129 --------------- .../BuilderSingularGuavaListsSets.java | 93 +++++++++++ .../after-delombok/BuilderSingularGuavaMaps.java | 76 +++++++++ .../after-delombok/BuilderSingularLists.java | 111 +++++++++++++ .../after-delombok/BuilderSingularMaps.java | 173 ++++++++++++++++++++ .../BuilderSingularRedirectToGuava.java | 75 +++++++++ .../after-delombok/BuilderSingularSets.java | 129 +++++++++++++++ .../after-ecj/BuilderSingletonGuavaListsSets.java | 88 ---------- .../after-ecj/BuilderSingletonGuavaMaps.java | 71 --------- .../resource/after-ecj/BuilderSingletonLists.java | 107 ------------- .../resource/after-ecj/BuilderSingletonMaps.java | 177 --------------------- .../after-ecj/BuilderSingletonRedirectToGuava.java | 71 --------- .../resource/after-ecj/BuilderSingletonSets.java | 125 --------------- .../after-ecj/BuilderSingularGuavaListsSets.java | 88 ++++++++++ .../after-ecj/BuilderSingularGuavaMaps.java | 71 +++++++++ .../resource/after-ecj/BuilderSingularLists.java | 107 +++++++++++++ .../resource/after-ecj/BuilderSingularMaps.java | 177 +++++++++++++++++++++ .../after-ecj/BuilderSingularRedirectToGuava.java | 71 +++++++++ .../resource/after-ecj/BuilderSingularSets.java | 125 +++++++++++++++ .../before/BuilderSingletonGuavaListsSets.java | 14 -- .../resource/before/BuilderSingletonGuavaMaps.java | 12 -- .../resource/before/BuilderSingletonLists.java | 11 -- .../resource/before/BuilderSingletonMaps.java | 12 -- .../before/BuilderSingletonRedirectToGuava.java | 13 -- .../resource/before/BuilderSingletonSets.java | 12 -- .../before/BuilderSingularGuavaListsSets.java | 14 ++ .../resource/before/BuilderSingularGuavaMaps.java | 12 ++ .../resource/before/BuilderSingularLists.java | 11 ++ .../resource/before/BuilderSingularMaps.java | 12 ++ .../before/BuilderSingularRedirectToGuava.java | 13 ++ .../resource/before/BuilderSingularSets.java | 12 ++ 36 files changed, 1370 insertions(+), 1370 deletions(-) delete mode 100644 test/transform/resource/after-delombok/BuilderSingletonGuavaListsSets.java delete mode 100644 test/transform/resource/after-delombok/BuilderSingletonGuavaMaps.java delete mode 100644 test/transform/resource/after-delombok/BuilderSingletonLists.java delete mode 100644 test/transform/resource/after-delombok/BuilderSingletonMaps.java delete mode 100644 test/transform/resource/after-delombok/BuilderSingletonRedirectToGuava.java delete mode 100644 test/transform/resource/after-delombok/BuilderSingletonSets.java create mode 100644 test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java create mode 100644 test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java create mode 100644 test/transform/resource/after-delombok/BuilderSingularLists.java create mode 100644 test/transform/resource/after-delombok/BuilderSingularMaps.java create mode 100644 test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java create mode 100644 test/transform/resource/after-delombok/BuilderSingularSets.java delete mode 100644 test/transform/resource/after-ecj/BuilderSingletonGuavaListsSets.java delete mode 100644 test/transform/resource/after-ecj/BuilderSingletonGuavaMaps.java delete mode 100644 test/transform/resource/after-ecj/BuilderSingletonLists.java delete mode 100644 test/transform/resource/after-ecj/BuilderSingletonMaps.java delete mode 100644 test/transform/resource/after-ecj/BuilderSingletonRedirectToGuava.java delete mode 100644 test/transform/resource/after-ecj/BuilderSingletonSets.java create mode 100644 test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java create mode 100644 test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java create mode 100644 test/transform/resource/after-ecj/BuilderSingularLists.java create mode 100644 test/transform/resource/after-ecj/BuilderSingularMaps.java create mode 100644 test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java create mode 100644 test/transform/resource/after-ecj/BuilderSingularSets.java delete mode 100644 test/transform/resource/before/BuilderSingletonGuavaListsSets.java delete mode 100644 test/transform/resource/before/BuilderSingletonGuavaMaps.java delete mode 100644 test/transform/resource/before/BuilderSingletonLists.java delete mode 100644 test/transform/resource/before/BuilderSingletonMaps.java delete mode 100644 test/transform/resource/before/BuilderSingletonRedirectToGuava.java delete mode 100644 test/transform/resource/before/BuilderSingletonSets.java create mode 100644 test/transform/resource/before/BuilderSingularGuavaListsSets.java create mode 100644 test/transform/resource/before/BuilderSingularGuavaMaps.java create mode 100644 test/transform/resource/before/BuilderSingularLists.java create mode 100644 test/transform/resource/before/BuilderSingularMaps.java create mode 100644 test/transform/resource/before/BuilderSingularRedirectToGuava.java create mode 100644 test/transform/resource/before/BuilderSingularSets.java (limited to 'test/transform') diff --git a/test/transform/resource/after-delombok/BuilderSingletonGuavaListsSets.java b/test/transform/resource/after-delombok/BuilderSingletonGuavaListsSets.java deleted file mode 100644 index 4503f2bb..00000000 --- a/test/transform/resource/after-delombok/BuilderSingletonGuavaListsSets.java +++ /dev/null @@ -1,93 +0,0 @@ -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableCollection; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.ImmutableSortedSet; -class BuilderSingletonGuavaListsSets { - private ImmutableList cards; - private ImmutableCollection frogs; - @SuppressWarnings("all") - private ImmutableSet rawSet; - private ImmutableSortedSet passes; - @java.lang.SuppressWarnings("all") - BuilderSingletonGuavaListsSets(final ImmutableList cards, final ImmutableCollection frogs, final ImmutableSet rawSet, final ImmutableSortedSet passes) { - this.cards = cards; - this.frogs = frogs; - this.rawSet = rawSet; - this.passes = passes; - } - @java.lang.SuppressWarnings("all") - public static class BuilderSingletonGuavaListsSetsBuilder { - private com.google.common.collect.ImmutableList.Builder cards; - private com.google.common.collect.ImmutableList.Builder frogs; - private com.google.common.collect.ImmutableSet.Builder rawSet; - private com.google.common.collect.ImmutableSortedSet.Builder passes; - @java.lang.SuppressWarnings("all") - BuilderSingletonGuavaListsSetsBuilder() { - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonGuavaListsSetsBuilder card(final T card) { - if (this.cards == null) this.cards = com.google.common.collect.ImmutableList.builder(); - this.cards.add(card); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonGuavaListsSetsBuilder cards(final java.lang.Iterable cards) { - if (this.cards == null) this.cards = com.google.common.collect.ImmutableList.builder(); - this.cards.addAll(cards); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonGuavaListsSetsBuilder frog(final Number frog) { - if (this.frogs == null) this.frogs = com.google.common.collect.ImmutableList.builder(); - this.frogs.add(frog); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonGuavaListsSetsBuilder frogs(final java.lang.Iterable frogs) { - if (this.frogs == null) this.frogs = com.google.common.collect.ImmutableList.builder(); - this.frogs.addAll(frogs); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonGuavaListsSetsBuilder rawSet(final java.lang.Object rawSet) { - if (this.rawSet == null) this.rawSet = com.google.common.collect.ImmutableSet.builder(); - this.rawSet.add(rawSet); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonGuavaListsSetsBuilder rawSet(final java.lang.Iterable rawSet) { - if (this.rawSet == null) this.rawSet = com.google.common.collect.ImmutableSet.builder(); - this.rawSet.addAll(rawSet); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonGuavaListsSetsBuilder pass(final String pass) { - if (this.passes == null) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder(); - this.passes.add(pass); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonGuavaListsSetsBuilder passes(final java.lang.Iterable passes) { - if (this.passes == null) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder(); - this.passes.addAll(passes); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonGuavaListsSets build() { - com.google.common.collect.ImmutableList cards = this.cards == null ? com.google.common.collect.ImmutableList.of() : this.cards.build(); - com.google.common.collect.ImmutableCollection frogs = this.frogs == null ? com.google.common.collect.ImmutableList.of() : this.frogs.build(); - com.google.common.collect.ImmutableSet rawSet = this.rawSet == null ? com.google.common.collect.ImmutableSet.of() : this.rawSet.build(); - com.google.common.collect.ImmutableSortedSet passes = this.passes == null ? com.google.common.collect.ImmutableSortedSet.of() : this.passes.build(); - return new BuilderSingletonGuavaListsSets(cards, frogs, rawSet, passes); - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public java.lang.String toString() { - return "BuilderSingletonGuavaListsSets.BuilderSingletonGuavaListsSetsBuilder(cards=" + this.cards + ", frogs=" + this.frogs + ", rawSet=" + this.rawSet + ", passes=" + this.passes + ")"; - } - } - @java.lang.SuppressWarnings("all") - public static BuilderSingletonGuavaListsSetsBuilder builder() { - return new BuilderSingletonGuavaListsSetsBuilder(); - } -} \ No newline at end of file diff --git a/test/transform/resource/after-delombok/BuilderSingletonGuavaMaps.java b/test/transform/resource/after-delombok/BuilderSingletonGuavaMaps.java deleted file mode 100644 index ff39da32..00000000 --- a/test/transform/resource/after-delombok/BuilderSingletonGuavaMaps.java +++ /dev/null @@ -1,76 +0,0 @@ -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableBiMap; -import com.google.common.collect.ImmutableSortedMap; -class BuilderSingletonGuavaMaps { - private ImmutableMap battleaxes; - private ImmutableSortedMap vertices; - @SuppressWarnings("all") - private ImmutableBiMap rawMap; - @java.lang.SuppressWarnings("all") - BuilderSingletonGuavaMaps(final ImmutableMap battleaxes, final ImmutableSortedMap vertices, final ImmutableBiMap rawMap) { - this.battleaxes = battleaxes; - this.vertices = vertices; - this.rawMap = rawMap; - } - @java.lang.SuppressWarnings("all") - public static class BuilderSingletonGuavaMapsBuilder { - private com.google.common.collect.ImmutableMap.Builder battleaxes; - private com.google.common.collect.ImmutableSortedMap.Builder vertices; - private com.google.common.collect.ImmutableBiMap.Builder rawMap; - @java.lang.SuppressWarnings("all") - BuilderSingletonGuavaMapsBuilder() { - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonGuavaMapsBuilder battleaxe(final K battleaxe$key, final V battleaxe$value) { - if (this.battleaxes == null) this.battleaxes = com.google.common.collect.ImmutableMap.builder(); - this.battleaxes.put(battleaxe$key, battleaxe$value); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonGuavaMapsBuilder battleaxes(final java.util.Map battleaxes) { - if (this.battleaxes == null) this.battleaxes = com.google.common.collect.ImmutableMap.builder(); - this.battleaxes.putAll(battleaxes); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonGuavaMapsBuilder vertex(final Integer vertex$key, final V vertex$value) { - if (this.vertices == null) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder(); - this.vertices.put(vertex$key, vertex$value); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonGuavaMapsBuilder vertices(final java.util.Map vertices) { - if (this.vertices == null) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder(); - this.vertices.putAll(vertices); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonGuavaMapsBuilder rawMap(final java.lang.Object rawMap$key, final java.lang.Object rawMap$value) { - if (this.rawMap == null) this.rawMap = com.google.common.collect.ImmutableBiMap.builder(); - this.rawMap.put(rawMap$key, rawMap$value); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonGuavaMapsBuilder rawMap(final java.util.Map rawMap) { - if (this.rawMap == null) this.rawMap = com.google.common.collect.ImmutableBiMap.builder(); - this.rawMap.putAll(rawMap); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonGuavaMaps build() { - com.google.common.collect.ImmutableMap battleaxes = this.battleaxes == null ? com.google.common.collect.ImmutableMap.of() : this.battleaxes.build(); - com.google.common.collect.ImmutableSortedMap vertices = this.vertices == null ? com.google.common.collect.ImmutableSortedMap.of() : this.vertices.build(); - com.google.common.collect.ImmutableBiMap rawMap = this.rawMap == null ? com.google.common.collect.ImmutableBiMap.of() : this.rawMap.build(); - return new BuilderSingletonGuavaMaps(battleaxes, vertices, rawMap); - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public java.lang.String toString() { - return "BuilderSingletonGuavaMaps.BuilderSingletonGuavaMapsBuilder(battleaxes=" + this.battleaxes + ", vertices=" + this.vertices + ", rawMap=" + this.rawMap + ")"; - } - } - @java.lang.SuppressWarnings("all") - public static BuilderSingletonGuavaMapsBuilder builder() { - return new BuilderSingletonGuavaMapsBuilder(); - } -} \ No newline at end of file diff --git a/test/transform/resource/after-delombok/BuilderSingletonLists.java b/test/transform/resource/after-delombok/BuilderSingletonLists.java deleted file mode 100644 index 1c93f40a..00000000 --- a/test/transform/resource/after-delombok/BuilderSingletonLists.java +++ /dev/null @@ -1,111 +0,0 @@ -import java.util.List; -import java.util.Collection; -class BuilderSingletonLists { - private List children; - private Collection scarves; - @SuppressWarnings("all") - private List rawList; - @java.lang.SuppressWarnings("all") - BuilderSingletonLists(final List children, final Collection scarves, final List rawList) { - this.children = children; - this.scarves = scarves; - this.rawList = rawList; - } - @java.lang.SuppressWarnings("all") - public static class BuilderSingletonListsBuilder { - private java.util.ArrayList children; - private java.util.ArrayList scarves; - private java.util.ArrayList rawList; - @java.lang.SuppressWarnings("all") - BuilderSingletonListsBuilder() { - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonListsBuilder child(final T child) { - if (this.children == null) this.children = new java.util.ArrayList(); - this.children.add(child); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonListsBuilder children(final java.util.Collection children) { - if (this.children == null) this.children = new java.util.ArrayList(); - this.children.addAll(children); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonListsBuilder scarf(final Number scarf) { - if (this.scarves == null) this.scarves = new java.util.ArrayList(); - this.scarves.add(scarf); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonListsBuilder scarves(final java.util.Collection scarves) { - if (this.scarves == null) this.scarves = new java.util.ArrayList(); - this.scarves.addAll(scarves); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonListsBuilder rawList(final java.lang.Object rawList) { - if (this.rawList == null) this.rawList = new java.util.ArrayList(); - this.rawList.add(rawList); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonListsBuilder rawList(final java.util.Collection rawList) { - if (this.rawList == null) this.rawList = new java.util.ArrayList(); - this.rawList.addAll(rawList); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonLists build() { - java.util.List children; - switch (this.children == null ? 0 : this.children.size()) { - case 0: - children = java.util.Collections.emptyList(); - break; - case 1: - children = java.util.Collections.singletonList(this.children.get(0)); - break; - default: - children = new java.util.ArrayList(this.children.size()); - children.addAll(this.children); - children = java.util.Collections.unmodifiableList(children); - } - java.util.List scarves; - switch (this.scarves == null ? 0 : this.scarves.size()) { - case 0: - scarves = java.util.Collections.emptyList(); - break; - case 1: - scarves = java.util.Collections.singletonList(this.scarves.get(0)); - break; - default: - scarves = new java.util.ArrayList(this.scarves.size()); - scarves.addAll(this.scarves); - scarves = java.util.Collections.unmodifiableList(scarves); - } - java.util.List rawList; - switch (this.rawList == null ? 0 : this.rawList.size()) { - case 0: - rawList = java.util.Collections.emptyList(); - break; - case 1: - rawList = java.util.Collections.singletonList(this.rawList.get(0)); - break; - default: - rawList = new java.util.ArrayList(this.rawList.size()); - rawList.addAll(this.rawList); - rawList = java.util.Collections.unmodifiableList(rawList); - } - return new BuilderSingletonLists(children, scarves, rawList); - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public java.lang.String toString() { - return "BuilderSingletonLists.BuilderSingletonListsBuilder(children=" + this.children + ", scarves=" + this.scarves + ", rawList=" + this.rawList + ")"; - } - } - @java.lang.SuppressWarnings("all") - public static BuilderSingletonListsBuilder builder() { - return new BuilderSingletonListsBuilder(); - } -} diff --git a/test/transform/resource/after-delombok/BuilderSingletonMaps.java b/test/transform/resource/after-delombok/BuilderSingletonMaps.java deleted file mode 100644 index a6474975..00000000 --- a/test/transform/resource/after-delombok/BuilderSingletonMaps.java +++ /dev/null @@ -1,173 +0,0 @@ -import java.util.Map; -import java.util.SortedMap; -class BuilderSingletonMaps { - private Map women; - private SortedMap men; - @SuppressWarnings("all") - private Map rawMap; - private Map stringMap; - @java.lang.SuppressWarnings("all") - BuilderSingletonMaps(final Map women, final SortedMap men, final Map rawMap, final Map stringMap) { - this.women = women; - this.men = men; - this.rawMap = rawMap; - this.stringMap = stringMap; - } - @java.lang.SuppressWarnings("all") - public static class BuilderSingletonMapsBuilder { - private java.util.ArrayList women$key; - private java.util.ArrayList women$value; - private java.util.ArrayList men$key; - private java.util.ArrayList men$value; - private java.util.ArrayList rawMap$key; - private java.util.ArrayList rawMap$value; - private java.util.ArrayList stringMap$key; - private java.util.ArrayList stringMap$value; - @java.lang.SuppressWarnings("all") - BuilderSingletonMapsBuilder() { - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonMapsBuilder woman(final K womanKey, final V womanValue) { - if (this.women$key == null) { - this.women$key = new java.util.ArrayList(); - this.women$value = new java.util.ArrayList(); - } - this.women$key.add(womanKey); - this.women$value.add(womanValue); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonMapsBuilder women(final java.util.Map women) { - if (this.women$key == null) { - this.women$key = new java.util.ArrayList(); - this.women$value = new java.util.ArrayList(); - } - for (final java.util.Map.Entry $lombokEntry : women.entrySet()) { - this.women$key.add($lombokEntry.getKey()); - this.women$value.add($lombokEntry.getValue()); - } - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonMapsBuilder man(final K manKey, final Number manValue) { - if (this.men$key == null) { - this.men$key = new java.util.ArrayList(); - this.men$value = new java.util.ArrayList(); - } - this.men$key.add(manKey); - this.men$value.add(manValue); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonMapsBuilder men(final java.util.Map men) { - if (this.men$key == null) { - this.men$key = new java.util.ArrayList(); - this.men$value = new java.util.ArrayList(); - } - for (final java.util.Map.Entry $lombokEntry : men.entrySet()) { - this.men$key.add($lombokEntry.getKey()); - this.men$value.add($lombokEntry.getValue()); - } - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonMapsBuilder rawMap(final java.lang.Object rawMapKey, final java.lang.Object rawMapValue) { - if (this.rawMap$key == null) { - this.rawMap$key = new java.util.ArrayList(); - this.rawMap$value = new java.util.ArrayList(); - } - this.rawMap$key.add(rawMapKey); - this.rawMap$value.add(rawMapValue); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonMapsBuilder rawMap(final java.util.Map rawMap) { - if (this.rawMap$key == null) { - this.rawMap$key = new java.util.ArrayList(); - this.rawMap$value = new java.util.ArrayList(); - } - for (final java.util.Map.Entry $lombokEntry : rawMap.entrySet()) { - this.rawMap$key.add($lombokEntry.getKey()); - this.rawMap$value.add($lombokEntry.getValue()); - } - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonMapsBuilder stringMap(final String stringMapKey, final V stringMapValue) { - if (this.stringMap$key == null) { - this.stringMap$key = new java.util.ArrayList(); - this.stringMap$value = new java.util.ArrayList(); - } - this.stringMap$key.add(stringMapKey); - this.stringMap$value.add(stringMapValue); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonMapsBuilder stringMap(final java.util.Map stringMap) { - if (this.stringMap$key == null) { - this.stringMap$key = new java.util.ArrayList(); - this.stringMap$value = new java.util.ArrayList(); - } - for (final java.util.Map.Entry $lombokEntry : stringMap.entrySet()) { - this.stringMap$key.add($lombokEntry.getKey()); - this.stringMap$value.add($lombokEntry.getValue()); - } - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonMaps build() { - java.util.Map women; - switch (this.women$key == null ? 0 : this.women$key.size()) { - case 0: - women = java.util.Collections.emptyMap(); - break; - case 1: - women = java.util.Collections.singletonMap(this.women$key.get(0), this.women$value.get(0)); - break; - default: - women = new java.util.LinkedHashMap(this.women$key.size() < 1073741824 ? 1 + this.women$key.size() + (this.women$key.size() - 3) / 3 : java.lang.Integer.MAX_VALUE); - for (int $i = 0; $i < this.women$key.size(); $i++) women.put(this.women$key.get($i), this.women$value.get($i)); - women = java.util.Collections.unmodifiableMap(women); - } - java.util.SortedMap men = new java.util.TreeMap(); - if (this.men$key != null) for (int $i = 0; $i < (this.men$key == null ? 0 : this.men$key.size()); $i++) men.put(this.men$key.get($i), this.men$value.get($i)); - men = java.util.Collections.unmodifiableSortedMap(men); - java.util.Map rawMap; - switch (this.rawMap$key == null ? 0 : this.rawMap$key.size()) { - case 0: - rawMap = java.util.Collections.emptyMap(); - break; - case 1: - rawMap = java.util.Collections.singletonMap(this.rawMap$key.get(0), this.rawMap$value.get(0)); - break; - default: - rawMap = new java.util.LinkedHashMap(this.rawMap$key.size() < 1073741824 ? 1 + this.rawMap$key.size() + (this.rawMap$key.size() - 3) / 3 : java.lang.Integer.MAX_VALUE); - for (int $i = 0; $i < this.rawMap$key.size(); $i++) rawMap.put(this.rawMap$key.get($i), this.rawMap$value.get($i)); - rawMap = java.util.Collections.unmodifiableMap(rawMap); - } - java.util.Map stringMap; - switch (this.stringMap$key == null ? 0 : this.stringMap$key.size()) { - case 0: - stringMap = java.util.Collections.emptyMap(); - break; - case 1: - stringMap = java.util.Collections.singletonMap(this.stringMap$key.get(0), this.stringMap$value.get(0)); - break; - default: - stringMap = new java.util.LinkedHashMap(this.stringMap$key.size() < 1073741824 ? 1 + this.stringMap$key.size() + (this.stringMap$key.size() - 3) / 3 : java.lang.Integer.MAX_VALUE); - for (int $i = 0; $i < this.stringMap$key.size(); $i++) stringMap.put(this.stringMap$key.get($i), this.stringMap$value.get($i)); - stringMap = java.util.Collections.unmodifiableMap(stringMap); - } - return new BuilderSingletonMaps(women, men, rawMap, stringMap); - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public java.lang.String toString() { - return "BuilderSingletonMaps.BuilderSingletonMapsBuilder(women$key=" + this.women$key + ", women$value=" + this.women$value + ", men$key=" + this.men$key + ", men$value=" + this.men$value + ", rawMap$key=" + this.rawMap$key + ", rawMap$value=" + this.rawMap$value + ", stringMap$key=" + this.stringMap$key + ", stringMap$value=" + this.stringMap$value + ")"; - } - } - @java.lang.SuppressWarnings("all") - public static BuilderSingletonMapsBuilder builder() { - return new BuilderSingletonMapsBuilder(); - } -} diff --git a/test/transform/resource/after-delombok/BuilderSingletonRedirectToGuava.java b/test/transform/resource/after-delombok/BuilderSingletonRedirectToGuava.java deleted file mode 100644 index a2d230a1..00000000 --- a/test/transform/resource/after-delombok/BuilderSingletonRedirectToGuava.java +++ /dev/null @@ -1,75 +0,0 @@ -import java.util.Set; -import java.util.NavigableMap; -import java.util.Collection; -class BuilderSingletonRedirectToGuava { - private Set dangerMice; - private NavigableMap things; - private Collection> doohickeys; - @java.lang.SuppressWarnings("all") - BuilderSingletonRedirectToGuava(final Set dangerMice, final NavigableMap things, final Collection> doohickeys) { - this.dangerMice = dangerMice; - this.things = things; - this.doohickeys = doohickeys; - } - @java.lang.SuppressWarnings("all") - public static class BuilderSingletonRedirectToGuavaBuilder { - private com.google.common.collect.ImmutableSet.Builder dangerMice; - private com.google.common.collect.ImmutableSortedMap.Builder things; - private com.google.common.collect.ImmutableList.Builder> doohickeys; - @java.lang.SuppressWarnings("all") - BuilderSingletonRedirectToGuavaBuilder() { - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonRedirectToGuavaBuilder dangerMouse(final String dangerMouse) { - if (this.dangerMice == null) this.dangerMice = com.google.common.collect.ImmutableSet.builder(); - this.dangerMice.add(dangerMouse); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonRedirectToGuavaBuilder dangerMice(final java.lang.Iterable dangerMice) { - if (this.dangerMice == null) this.dangerMice = com.google.common.collect.ImmutableSet.builder(); - this.dangerMice.addAll(dangerMice); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonRedirectToGuavaBuilder thing(final Integer thing$key, final Number thing$value) { - if (this.things == null) this.things = com.google.common.collect.ImmutableSortedMap.naturalOrder(); - this.things.put(thing$key, thing$value); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonRedirectToGuavaBuilder things(final java.util.Map things) { - if (this.things == null) this.things = com.google.common.collect.ImmutableSortedMap.naturalOrder(); - this.things.putAll(things); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonRedirectToGuavaBuilder doohickey(final Class doohickey) { - if (this.doohickeys == null) this.doohickeys = com.google.common.collect.ImmutableList.builder(); - this.doohickeys.add(doohickey); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonRedirectToGuavaBuilder doohickeys(final java.lang.Iterable> doohickeys) { - if (this.doohickeys == null) this.doohickeys = com.google.common.collect.ImmutableList.builder(); - this.doohickeys.addAll(doohickeys); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonRedirectToGuava build() { - java.util.Set dangerMice = this.dangerMice == null ? com.google.common.collect.ImmutableSet.of() : this.dangerMice.build(); - java.util.NavigableMap things = this.things == null ? com.google.common.collect.ImmutableSortedMap.of() : this.things.build(); - java.util.Collection> doohickeys = this.doohickeys == null ? com.google.common.collect.ImmutableList.of() : this.doohickeys.build(); - return new BuilderSingletonRedirectToGuava(dangerMice, things, doohickeys); - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public java.lang.String toString() { - return "BuilderSingletonRedirectToGuava.BuilderSingletonRedirectToGuavaBuilder(dangerMice=" + this.dangerMice + ", things=" + this.things + ", doohickeys=" + this.doohickeys + ")"; - } - } - @java.lang.SuppressWarnings("all") - public static BuilderSingletonRedirectToGuavaBuilder builder() { - return new BuilderSingletonRedirectToGuavaBuilder(); - } -} \ No newline at end of file diff --git a/test/transform/resource/after-delombok/BuilderSingletonSets.java b/test/transform/resource/after-delombok/BuilderSingletonSets.java deleted file mode 100644 index c57331a5..00000000 --- a/test/transform/resource/after-delombok/BuilderSingletonSets.java +++ /dev/null @@ -1,129 +0,0 @@ -import java.util.Set; -import java.util.SortedSet; -class BuilderSingletonSets { - private Set dangerMice; - private SortedSet octopodes; - @SuppressWarnings("all") - private Set rawSet; - private Set stringSet; - @java.lang.SuppressWarnings("all") - BuilderSingletonSets(final Set dangerMice, final SortedSet octopodes, final Set rawSet, final Set stringSet) { - this.dangerMice = dangerMice; - this.octopodes = octopodes; - this.rawSet = rawSet; - this.stringSet = stringSet; - } - @java.lang.SuppressWarnings("all") - public static class BuilderSingletonSetsBuilder { - private java.util.ArrayList dangerMice; - private java.util.ArrayList octopodes; - private java.util.ArrayList rawSet; - private java.util.ArrayList stringSet; - @java.lang.SuppressWarnings("all") - BuilderSingletonSetsBuilder() { - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonSetsBuilder dangerMouse(final T dangerMouse) { - if (this.dangerMice == null) this.dangerMice = new java.util.ArrayList(); - this.dangerMice.add(dangerMouse); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonSetsBuilder dangerMice(final java.util.Collection dangerMice) { - if (this.dangerMice == null) this.dangerMice = new java.util.ArrayList(); - this.dangerMice.addAll(dangerMice); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonSetsBuilder octopus(final Number octopus) { - if (this.octopodes == null) this.octopodes = new java.util.ArrayList(); - this.octopodes.add(octopus); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonSetsBuilder octopodes(final java.util.Collection octopodes) { - if (this.octopodes == null) this.octopodes = new java.util.ArrayList(); - this.octopodes.addAll(octopodes); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonSetsBuilder rawSet(final java.lang.Object rawSet) { - if (this.rawSet == null) this.rawSet = new java.util.ArrayList(); - this.rawSet.add(rawSet); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonSetsBuilder rawSet(final java.util.Collection rawSet) { - if (this.rawSet == null) this.rawSet = new java.util.ArrayList(); - this.rawSet.addAll(rawSet); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonSetsBuilder stringSet(final String stringSet) { - if (this.stringSet == null) this.stringSet = new java.util.ArrayList(); - this.stringSet.add(stringSet); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonSetsBuilder stringSet(final java.util.Collection stringSet) { - if (this.stringSet == null) this.stringSet = new java.util.ArrayList(); - this.stringSet.addAll(stringSet); - return this; - } - @java.lang.SuppressWarnings("all") - public BuilderSingletonSets build() { - java.util.Set dangerMice; - switch (this.dangerMice == null ? 0 : this.dangerMice.size()) { - case 0: - dangerMice = java.util.Collections.emptySet(); - break; - case 1: - dangerMice = java.util.Collections.singleton(this.dangerMice.get(0)); - break; - default: - dangerMice = new java.util.LinkedHashSet(this.dangerMice.size() < 1073741824 ? 1 + this.dangerMice.size() + (this.dangerMice.size() - 3) / 3 : java.lang.Integer.MAX_VALUE); - dangerMice.addAll(this.dangerMice); - dangerMice = java.util.Collections.unmodifiableSet(dangerMice); - } - java.util.SortedSet octopodes = new java.util.TreeSet(); - if (this.octopodes != null) octopodes.addAll(this.octopodes); - octopodes = java.util.Collections.unmodifiableSortedSet(octopodes); - java.util.Set rawSet; - switch (this.rawSet == null ? 0 : this.rawSet.size()) { - case 0: - rawSet = java.util.Collections.emptySet(); - break; - case 1: - rawSet = java.util.Collections.singleton(this.rawSet.get(0)); - break; - default: - rawSet = new java.util.LinkedHashSet(this.rawSet.size() < 1073741824 ? 1 + this.rawSet.size() + (this.rawSet.size() - 3) / 3 : java.lang.Integer.MAX_VALUE); - rawSet.addAll(this.rawSet); - rawSet = java.util.Collections.unmodifiableSet(rawSet); - } - java.util.Set stringSet; - switch (this.stringSet == null ? 0 : this.stringSet.size()) { - case 0: - stringSet = java.util.Collections.emptySet(); - break; - case 1: - stringSet = java.util.Collections.singleton(this.stringSet.get(0)); - break; - default: - stringSet = new java.util.LinkedHashSet(this.stringSet.size() < 1073741824 ? 1 + this.stringSet.size() + (this.stringSet.size() - 3) / 3 : java.lang.Integer.MAX_VALUE); - stringSet.addAll(this.stringSet); - stringSet = java.util.Collections.unmodifiableSet(stringSet); - } - return new BuilderSingletonSets(dangerMice, octopodes, rawSet, stringSet); - } - @java.lang.Override - @java.lang.SuppressWarnings("all") - public java.lang.String toString() { - return "BuilderSingletonSets.BuilderSingletonSetsBuilder(dangerMice=" + this.dangerMice + ", octopodes=" + this.octopodes + ", rawSet=" + this.rawSet + ", stringSet=" + this.stringSet + ")"; - } - } - @java.lang.SuppressWarnings("all") - public static BuilderSingletonSetsBuilder builder() { - return new BuilderSingletonSetsBuilder(); - } -} \ No newline at end of file diff --git a/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java b/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java new file mode 100644 index 00000000..3fc969ef --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java @@ -0,0 +1,93 @@ +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableCollection; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.ImmutableSortedSet; +class BuilderSingularGuavaListsSets { + private ImmutableList cards; + private ImmutableCollection frogs; + @SuppressWarnings("all") + private ImmutableSet rawSet; + private ImmutableSortedSet passes; + @java.lang.SuppressWarnings("all") + BuilderSingularGuavaListsSets(final ImmutableList cards, final ImmutableCollection frogs, final ImmutableSet rawSet, final ImmutableSortedSet passes) { + this.cards = cards; + this.frogs = frogs; + this.rawSet = rawSet; + this.passes = passes; + } + @java.lang.SuppressWarnings("all") + public static class BuilderSingularGuavaListsSetsBuilder { + private com.google.common.collect.ImmutableList.Builder cards; + private com.google.common.collect.ImmutableList.Builder frogs; + private com.google.common.collect.ImmutableSet.Builder rawSet; + private com.google.common.collect.ImmutableSortedSet.Builder passes; + @java.lang.SuppressWarnings("all") + BuilderSingularGuavaListsSetsBuilder() { + } + @java.lang.SuppressWarnings("all") + public BuilderSingularGuavaListsSetsBuilder card(final T card) { + if (this.cards == null) this.cards = com.google.common.collect.ImmutableList.builder(); + this.cards.add(card); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularGuavaListsSetsBuilder cards(final java.lang.Iterable cards) { + if (this.cards == null) this.cards = com.google.common.collect.ImmutableList.builder(); + this.cards.addAll(cards); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularGuavaListsSetsBuilder frog(final Number frog) { + if (this.frogs == null) this.frogs = com.google.common.collect.ImmutableList.builder(); + this.frogs.add(frog); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularGuavaListsSetsBuilder frogs(final java.lang.Iterable frogs) { + if (this.frogs == null) this.frogs = com.google.common.collect.ImmutableList.builder(); + this.frogs.addAll(frogs); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularGuavaListsSetsBuilder rawSet(final java.lang.Object rawSet) { + if (this.rawSet == null) this.rawSet = com.google.common.collect.ImmutableSet.builder(); + this.rawSet.add(rawSet); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularGuavaListsSetsBuilder rawSet(final java.lang.Iterable rawSet) { + if (this.rawSet == null) this.rawSet = com.google.common.collect.ImmutableSet.builder(); + this.rawSet.addAll(rawSet); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularGuavaListsSetsBuilder pass(final String pass) { + if (this.passes == null) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder(); + this.passes.add(pass); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularGuavaListsSetsBuilder passes(final java.lang.Iterable passes) { + if (this.passes == null) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder(); + this.passes.addAll(passes); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularGuavaListsSets build() { + com.google.common.collect.ImmutableList cards = this.cards == null ? com.google.common.collect.ImmutableList.of() : this.cards.build(); + com.google.common.collect.ImmutableCollection frogs = this.frogs == null ? com.google.common.collect.ImmutableList.of() : this.frogs.build(); + com.google.common.collect.ImmutableSet rawSet = this.rawSet == null ? com.google.common.collect.ImmutableSet.of() : this.rawSet.build(); + com.google.common.collect.ImmutableSortedSet passes = this.passes == null ? com.google.common.collect.ImmutableSortedSet.of() : this.passes.build(); + return new BuilderSingularGuavaListsSets(cards, frogs, rawSet, passes); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder(cards=" + this.cards + ", frogs=" + this.frogs + ", rawSet=" + this.rawSet + ", passes=" + this.passes + ")"; + } + } + @java.lang.SuppressWarnings("all") + public static BuilderSingularGuavaListsSetsBuilder builder() { + return new BuilderSingularGuavaListsSetsBuilder(); + } +} \ No newline at end of file diff --git a/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java b/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java new file mode 100644 index 00000000..c55dff28 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java @@ -0,0 +1,76 @@ +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableBiMap; +import com.google.common.collect.ImmutableSortedMap; +class BuilderSingularGuavaMaps { + private ImmutableMap battleaxes; + private ImmutableSortedMap vertices; + @SuppressWarnings("all") + private ImmutableBiMap rawMap; + @java.lang.SuppressWarnings("all") + BuilderSingularGuavaMaps(final ImmutableMap battleaxes, final ImmutableSortedMap vertices, final ImmutableBiMap rawMap) { + this.battleaxes = battleaxes; + this.vertices = vertices; + this.rawMap = rawMap; + } + @java.lang.SuppressWarnings("all") + public static class BuilderSingularGuavaMapsBuilder { + private com.google.common.collect.ImmutableMap.Builder battleaxes; + private com.google.common.collect.ImmutableSortedMap.Builder vertices; + private com.google.common.collect.ImmutableBiMap.Builder rawMap; + @java.lang.SuppressWarnings("all") + BuilderSingularGuavaMapsBuilder() { + } + @java.lang.SuppressWarnings("all") + public BuilderSingularGuavaMapsBuilder battleaxe(final K battleaxe$key, final V battleaxe$value) { + if (this.battleaxes == null) this.battleaxes = com.google.common.collect.ImmutableMap.builder(); + this.battleaxes.put(battleaxe$key, battleaxe$value); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularGuavaMapsBuilder battleaxes(final java.util.Map battleaxes) { + if (this.battleaxes == null) this.battleaxes = com.google.common.collect.ImmutableMap.builder(); + this.battleaxes.putAll(battleaxes); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularGuavaMapsBuilder vertex(final Integer vertex$key, final V vertex$value) { + if (this.vertices == null) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder(); + this.vertices.put(vertex$key, vertex$value); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularGuavaMapsBuilder vertices(final java.util.Map vertices) { + if (this.vertices == null) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder(); + this.vertices.putAll(vertices); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularGuavaMapsBuilder rawMap(final java.lang.Object rawMap$key, final java.lang.Object rawMap$value) { + if (this.rawMap == null) this.rawMap = com.google.common.collect.ImmutableBiMap.builder(); + this.rawMap.put(rawMap$key, rawMap$value); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularGuavaMapsBuilder rawMap(final java.util.Map rawMap) { + if (this.rawMap == null) this.rawMap = com.google.common.collect.ImmutableBiMap.builder(); + this.rawMap.putAll(rawMap); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularGuavaMaps build() { + com.google.common.collect.ImmutableMap battleaxes = this.battleaxes == null ? com.google.common.collect.ImmutableMap.of() : this.battleaxes.build(); + com.google.common.collect.ImmutableSortedMap vertices = this.vertices == null ? com.google.common.collect.ImmutableSortedMap.of() : this.vertices.build(); + com.google.common.collect.ImmutableBiMap rawMap = this.rawMap == null ? com.google.common.collect.ImmutableBiMap.of() : this.rawMap.build(); + return new BuilderSingularGuavaMaps(battleaxes, vertices, rawMap); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderSingularGuavaMaps.BuilderSingularGuavaMapsBuilder(battleaxes=" + this.battleaxes + ", vertices=" + this.vertices + ", rawMap=" + this.rawMap + ")"; + } + } + @java.lang.SuppressWarnings("all") + public static BuilderSingularGuavaMapsBuilder builder() { + return new BuilderSingularGuavaMapsBuilder(); + } +} \ No newline at end of file diff --git a/test/transform/resource/after-delombok/BuilderSingularLists.java b/test/transform/resource/after-delombok/BuilderSingularLists.java new file mode 100644 index 00000000..aa5382c1 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderSingularLists.java @@ -0,0 +1,111 @@ +import java.util.List; +import java.util.Collection; +class BuilderSingularLists { + private List children; + private Collection scarves; + @SuppressWarnings("all") + private List rawList; + @java.lang.SuppressWarnings("all") + BuilderSingularLists(final List children, final Collection scarves, final List rawList) { + this.children = children; + this.scarves = scarves; + this.rawList = rawList; + } + @java.lang.SuppressWarnings("all") + public static class BuilderSingularListsBuilder { + private java.util.ArrayList children; + private java.util.ArrayList scarves; + private java.util.ArrayList rawList; + @java.lang.SuppressWarnings("all") + BuilderSingularListsBuilder() { + } + @java.lang.SuppressWarnings("all") + public BuilderSingularListsBuilder child(final T child) { + if (this.children == null) this.children = new java.util.ArrayList(); + this.children.add(child); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularListsBuilder children(final java.util.Collection children) { + if (this.children == null) this.children = new java.util.ArrayList(); + this.children.addAll(children); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularListsBuilder scarf(final Number scarf) { + if (this.scarves == null) this.scarves = new java.util.ArrayList(); + this.scarves.add(scarf); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularListsBuilder scarves(final java.util.Collection scarves) { + if (this.scarves == null) this.scarves = new java.util.ArrayList(); + this.scarves.addAll(scarves); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularListsBuilder rawList(final java.lang.Object rawList) { + if (this.rawList == null) this.rawList = new java.util.ArrayList(); + this.rawList.add(rawList); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularListsBuilder rawList(final java.util.Collection rawList) { + if (this.rawList == null) this.rawList = new java.util.ArrayList(); + this.rawList.addAll(rawList); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularLists build() { + java.util.List children; + switch (this.children == null ? 0 : this.children.size()) { + case 0: + children = java.util.Collections.emptyList(); + break; + case 1: + children = java.util.Collections.singletonList(this.children.get(0)); + break; + default: + children = new java.util.ArrayList(this.children.size()); + children.addAll(this.children); + children = java.util.Collections.unmodifiableList(children); + } + java.util.List scarves; + switch (this.scarves == null ? 0 : this.scarves.size()) { + case 0: + scarves = java.util.Collections.emptyList(); + break; + case 1: + scarves = java.util.Collections.singletonList(this.scarves.get(0)); + break; + default: + scarves = new java.util.ArrayList(this.scarves.size()); + scarves.addAll(this.scarves); + scarves = java.util.Collections.unmodifiableList(scarves); + } + java.util.List rawList; + switch (this.rawList == null ? 0 : this.rawList.size()) { + case 0: + rawList = java.util.Collections.emptyList(); + break; + case 1: + rawList = java.util.Collections.singletonList(this.rawList.get(0)); + break; + default: + rawList = new java.util.ArrayList(this.rawList.size()); + rawList.addAll(this.rawList); + rawList = java.util.Collections.unmodifiableList(rawList); + } + return new BuilderSingularLists(children, scarves, rawList); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderSingularLists.BuilderSingularListsBuilder(children=" + this.children + ", scarves=" + this.scarves + ", rawList=" + this.rawList + ")"; + } + } + @java.lang.SuppressWarnings("all") + public static BuilderSingularListsBuilder builder() { + return new BuilderSingularListsBuilder(); + } +} diff --git a/test/transform/resource/after-delombok/BuilderSingularMaps.java b/test/transform/resource/after-delombok/BuilderSingularMaps.java new file mode 100644 index 00000000..640ddb94 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderSingularMaps.java @@ -0,0 +1,173 @@ +import java.util.Map; +import java.util.SortedMap; +class BuilderSingularMaps { + private Map women; + private SortedMap men; + @SuppressWarnings("all") + private Map rawMap; + private Map stringMap; + @java.lang.SuppressWarnings("all") + BuilderSingularMaps(final Map women, final SortedMap men, final Map rawMap, final Map stringMap) { + this.women = women; + this.men = men; + this.rawMap = rawMap; + this.stringMap = stringMap; + } + @java.lang.SuppressWarnings("all") + public static class BuilderSingularMapsBuilder { + private java.util.ArrayList women$key; + private java.util.ArrayList women$value; + private java.util.ArrayList men$key; + private java.util.ArrayList men$value; + private java.util.ArrayList rawMap$key; + private java.util.ArrayList rawMap$value; + private java.util.ArrayList stringMap$key; + private java.util.ArrayList stringMap$value; + @java.lang.SuppressWarnings("all") + BuilderSingularMapsBuilder() { + } + @java.lang.SuppressWarnings("all") + public BuilderSingularMapsBuilder woman(final K womanKey, final V womanValue) { + if (this.women$key == null) { + this.women$key = new java.util.ArrayList(); + this.women$value = new java.util.ArrayList(); + } + this.women$key.add(womanKey); + this.women$value.add(womanValue); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularMapsBuilder women(final java.util.Map women) { + if (this.women$key == null) { + this.women$key = new java.util.ArrayList(); + this.women$value = new java.util.ArrayList(); + } + for (final java.util.Map.Entry $lombokEntry : women.entrySet()) { + this.women$key.add($lombokEntry.getKey()); + this.women$value.add($lombokEntry.getValue()); + } + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularMapsBuilder man(final K manKey, final Number manValue) { + if (this.men$key == null) { + this.men$key = new java.util.ArrayList(); + this.men$value = new java.util.ArrayList(); + } + this.men$key.add(manKey); + this.men$value.add(manValue); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularMapsBuilder men(final java.util.Map men) { + if (this.men$key == null) { + this.men$key = new java.util.ArrayList(); + this.men$value = new java.util.ArrayList(); + } + for (final java.util.Map.Entry $lombokEntry : men.entrySet()) { + this.men$key.add($lombokEntry.getKey()); + this.men$value.add($lombokEntry.getValue()); + } + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularMapsBuilder rawMap(final java.lang.Object rawMapKey, final java.lang.Object rawMapValue) { + if (this.rawMap$key == null) { + this.rawMap$key = new java.util.ArrayList(); + this.rawMap$value = new java.util.ArrayList(); + } + this.rawMap$key.add(rawMapKey); + this.rawMap$value.add(rawMapValue); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularMapsBuilder rawMap(final java.util.Map rawMap) { + if (this.rawMap$key == null) { + this.rawMap$key = new java.util.ArrayList(); + this.rawMap$value = new java.util.ArrayList(); + } + for (final java.util.Map.Entry $lombokEntry : rawMap.entrySet()) { + this.rawMap$key.add($lombokEntry.getKey()); + this.rawMap$value.add($lombokEntry.getValue()); + } + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularMapsBuilder stringMap(final String stringMapKey, final V stringMapValue) { + if (this.stringMap$key == null) { + this.stringMap$key = new java.util.ArrayList(); + this.stringMap$value = new java.util.ArrayList(); + } + this.stringMap$key.add(stringMapKey); + this.stringMap$value.add(stringMapValue); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularMapsBuilder stringMap(final java.util.Map stringMap) { + if (this.stringMap$key == null) { + this.stringMap$key = new java.util.ArrayList(); + this.stringMap$value = new java.util.ArrayList(); + } + for (final java.util.Map.Entry $lombokEntry : stringMap.entrySet()) { + this.stringMap$key.add($lombokEntry.getKey()); + this.stringMap$value.add($lombokEntry.getValue()); + } + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularMaps build() { + java.util.Map women; + switch (this.women$key == null ? 0 : this.women$key.size()) { + case 0: + women = java.util.Collections.emptyMap(); + break; + case 1: + women = java.util.Collections.singletonMap(this.women$key.get(0), this.women$value.get(0)); + break; + default: + women = new java.util.LinkedHashMap(this.women$key.size() < 1073741824 ? 1 + this.women$key.size() + (this.women$key.size() - 3) / 3 : java.lang.Integer.MAX_VALUE); + for (int $i = 0; $i < this.women$key.size(); $i++) women.put(this.women$key.get($i), this.women$value.get($i)); + women = java.util.Collections.unmodifiableMap(women); + } + java.util.SortedMap men = new java.util.TreeMap(); + if (this.men$key != null) for (int $i = 0; $i < (this.men$key == null ? 0 : this.men$key.size()); $i++) men.put(this.men$key.get($i), this.men$value.get($i)); + men = java.util.Collections.unmodifiableSortedMap(men); + java.util.Map rawMap; + switch (this.rawMap$key == null ? 0 : this.rawMap$key.size()) { + case 0: + rawMap = java.util.Collections.emptyMap(); + break; + case 1: + rawMap = java.util.Collections.singletonMap(this.rawMap$key.get(0), this.rawMap$value.get(0)); + break; + default: + rawMap = new java.util.LinkedHashMap(this.rawMap$key.size() < 1073741824 ? 1 + this.rawMap$key.size() + (this.rawMap$key.size() - 3) / 3 : java.lang.Integer.MAX_VALUE); + for (int $i = 0; $i < this.rawMap$key.size(); $i++) rawMap.put(this.rawMap$key.get($i), this.rawMap$value.get($i)); + rawMap = java.util.Collections.unmodifiableMap(rawMap); + } + java.util.Map stringMap; + switch (this.stringMap$key == null ? 0 : this.stringMap$key.size()) { + case 0: + stringMap = java.util.Collections.emptyMap(); + break; + case 1: + stringMap = java.util.Collections.singletonMap(this.stringMap$key.get(0), this.stringMap$value.get(0)); + break; + default: + stringMap = new java.util.LinkedHashMap(this.stringMap$key.size() < 1073741824 ? 1 + this.stringMap$key.size() + (this.stringMap$key.size() - 3) / 3 : java.lang.Integer.MAX_VALUE); + for (int $i = 0; $i < this.stringMap$key.size(); $i++) stringMap.put(this.stringMap$key.get($i), this.stringMap$value.get($i)); + stringMap = java.util.Collections.unmodifiableMap(stringMap); + } + return new BuilderSingularMaps(women, men, rawMap, stringMap); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderSingularMaps.BuilderSingularMapsBuilder(women$key=" + this.women$key + ", women$value=" + this.women$value + ", men$key=" + this.men$key + ", men$value=" + this.men$value + ", rawMap$key=" + this.rawMap$key + ", rawMap$value=" + this.rawMap$value + ", stringMap$key=" + this.stringMap$key + ", stringMap$value=" + this.stringMap$value + ")"; + } + } + @java.lang.SuppressWarnings("all") + public static BuilderSingularMapsBuilder builder() { + return new BuilderSingularMapsBuilder(); + } +} diff --git a/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java b/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java new file mode 100644 index 00000000..84dc9a26 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java @@ -0,0 +1,75 @@ +import java.util.Set; +import java.util.NavigableMap; +import java.util.Collection; +class BuilderSingularRedirectToGuava { + private Set dangerMice; + private NavigableMap things; + private Collection> doohickeys; + @java.lang.SuppressWarnings("all") + BuilderSingularRedirectToGuava(final Set dangerMice, final NavigableMap things, final Collection> doohickeys) { + this.dangerMice = dangerMice; + this.things = things; + this.doohickeys = doohickeys; + } + @java.lang.SuppressWarnings("all") + public static class BuilderSingularRedirectToGuavaBuilder { + private com.google.common.collect.ImmutableSet.Builder dangerMice; + private com.google.common.collect.ImmutableSortedMap.Builder things; + private com.google.common.collect.ImmutableList.Builder> doohickeys; + @java.lang.SuppressWarnings("all") + BuilderSingularRedirectToGuavaBuilder() { + } + @java.lang.SuppressWarnings("all") + public BuilderSingularRedirectToGuavaBuilder dangerMouse(final String dangerMouse) { + if (this.dangerMice == null) this.dangerMice = com.google.common.collect.ImmutableSet.builder(); + this.dangerMice.add(dangerMouse); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularRedirectToGuavaBuilder dangerMice(final java.lang.Iterable dangerMice) { + if (this.dangerMice == null) this.dangerMice = com.google.common.collect.ImmutableSet.builder(); + this.dangerMice.addAll(dangerMice); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularRedirectToGuavaBuilder thing(final Integer thing$key, final Number thing$value) { + if (this.things == null) this.things = com.google.common.collect.ImmutableSortedMap.naturalOrder(); + this.things.put(thing$key, thing$value); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularRedirectToGuavaBuilder things(final java.util.Map things) { + if (this.things == null) this.things = com.google.common.collect.ImmutableSortedMap.naturalOrder(); + this.things.putAll(things); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularRedirectToGuavaBuilder doohickey(final Class doohickey) { + if (this.doohickeys == null) this.doohickeys = com.google.common.collect.ImmutableList.builder(); + this.doohickeys.add(doohickey); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularRedirectToGuavaBuilder doohickeys(final java.lang.Iterable> doohickeys) { + if (this.doohickeys == null) this.doohickeys = com.google.common.collect.ImmutableList.builder(); + this.doohickeys.addAll(doohickeys); + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderSingularRedirectToGuava build() { + java.util.Set dangerMice = this.dangerMice == null ? com.google.common.collect.ImmutableSet.of() : this.dangerMice.build(); + java.util.NavigableMap things = this.things == null ? com.google.common.collect.ImmutableSortedMap.of() : this.things.build(); + java.util.Collection> doohickeys = this.doohickeys == null ? com.google.common.collect.ImmutableList.of() : this.doohickeys.build(); + return new BuilderSingularRedirectToGuava(dangerMice, things, doohickeys); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderSingularRedirectToGuava.BuilderSingularRedirectToGuavaBuilder(dangerMice=" + this.dangerMice + ", things=" + this.things + ", doohickeys=" + this.doohickeys + ")"; + } + } + @java.lang.SuppressWarnings("all") + public static BuilderSingularRedi