aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource
diff options
context:
space:
mode:
Diffstat (limited to 'test/transform/resource')
-rw-r--r--test/transform/resource/after-delombok/BuilderDefaultsWarnings.java1
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularAnnotatedTypes.java2
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularAnnotatedTypesWithSetterPrefix.java2
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java5
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java3
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularLists.java3
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularMaps.java4
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularMapsWithSetterPrefix.java64
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularNoAuto.java3
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularNoAutoWithSetterPrefix.java3
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularNullBehavior1.java160
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java3
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularSets.java4
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularSetsWithSetterPrefix.java4
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java1
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularToBuilderWithNullWithSetterPrefix.java1
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularWildcardListsWithToBuilder.java2
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularWithPrefixes.java1
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularWithPrefixesWithSetterPrefix.java1
-rw-r--r--test/transform/resource/after-delombok/BuilderWithDeprecated.java2
-rw-r--r--test/transform/resource/after-delombok/BuilderWithToBuilder.java1
-rw-r--r--test/transform/resource/after-delombok/CheckerFrameworkBuilder.java1
-rw-r--r--test/transform/resource/after-delombok/CheckerFrameworkSuperBuilder.java1
-rw-r--r--test/transform/resource/after-delombok/SuperBuilderBasic.java1
-rw-r--r--test/transform/resource/after-delombok/SuperBuilderBasicToBuilder.java1
-rw-r--r--test/transform/resource/after-delombok/SuperBuilderSingularAnnotatedTypes.java2
-rw-r--r--test/transform/resource/after-delombok/SuperBuilderWithCustomBuilderMethod.java1
-rw-r--r--test/transform/resource/after-delombok/SuperBuilderWithGenerics.java1
-rw-r--r--test/transform/resource/after-delombok/SuperBuilderWithGenerics2.java1
-rw-r--r--test/transform/resource/after-delombok/SuperBuilderWithGenericsAndToBuilder.java1
-rw-r--r--test/transform/resource/after-delombok/SuperBuilderWithPrefixes.java1
-rw-r--r--test/transform/resource/after-ecj/BuilderDefaultsWarnings.java2
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularAnnotatedTypes.java4
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularAnnotatedTypesWithSetterPrefix.java4
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java10
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java6
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularLists.java6
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularMaps.java8
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularMapsWithSetterPrefix.java78
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularNoAuto.java6
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularNoAutoWithSetterPrefix.java6
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularNullBehavior1.java154
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java6
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularSets.java8
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularSetsWithSetterPrefix.java8
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularToBuilderWithNull.java2
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java2
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularWildcardListsWithToBuilder.java4
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularWithPrefixes.java2
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularWithPrefixesWithSetterPrefix.java2
-rw-r--r--test/transform/resource/after-ecj/BuilderWithDeprecated.java4
-rw-r--r--test/transform/resource/after-ecj/BuilderWithToBuilder.java2
-rw-r--r--test/transform/resource/after-ecj/CheckerFrameworkBuilder.java2
-rw-r--r--test/transform/resource/after-ecj/CheckerFrameworkSuperBuilder.java2
-rw-r--r--test/transform/resource/after-ecj/I2335_BuilderMultipleObtainVia.java4
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderBasic.java2
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java2
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderSingularAnnotatedTypes.java4
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderWithCustomBuilderMethod.java2
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderWithGenerics.java2
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderWithGenerics2.java2
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderWithGenericsAndToBuilder.java2
-rw-r--r--test/transform/resource/after-ecj/SuperBuilderWithPrefixes.java2
-rw-r--r--test/transform/resource/before/BuilderSingularMapsWithSetterPrefix.java1
-rw-r--r--test/transform/resource/before/BuilderSingularNullBehavior1.java13
65 files changed, 582 insertions, 63 deletions
diff --git a/test/transform/resource/after-delombok/BuilderDefaultsWarnings.java b/test/transform/resource/after-delombok/BuilderDefaultsWarnings.java
index 4df98158..04cd3bbb 100644
--- a/test/transform/resource/after-delombok/BuilderDefaultsWarnings.java
+++ b/test/transform/resource/after-delombok/BuilderDefaultsWarnings.java
@@ -38,6 +38,7 @@ public class BuilderDefaultsWarnings {
}
@java.lang.SuppressWarnings("all")
public BuilderDefaultsWarnings.BuilderDefaultsWarningsBuilder items(final java.util.Collection<? extends String> items) {
+ if (items == null) throw new java.lang.NullPointerException("items cannot be null");
if (this.items == null) this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
return this;
diff --git a/test/transform/resource/after-delombok/BuilderSingularAnnotatedTypes.java b/test/transform/resource/after-delombok/BuilderSingularAnnotatedTypes.java
index 6bd3390c..4cc247ef 100644
--- a/test/transform/resource/after-delombok/BuilderSingularAnnotatedTypes.java
+++ b/test/transform/resource/after-delombok/BuilderSingularAnnotatedTypes.java
@@ -36,6 +36,7 @@ class BuilderSingularAnnotatedTypes {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularAnnotatedTypes.BuilderSingularAnnotatedTypesBuilder foos(final java.util.Collection<? extends @MyAnnotation @NonNull String> foos) {
+ if (foos == null) throw new java.lang.NullPointerException("foos cannot be null");
if (this.foos == null) this.foos = new java.util.ArrayList<@MyAnnotation @NonNull String>();
this.foos.addAll(foos);
return this;
@@ -63,6 +64,7 @@ class BuilderSingularAnnotatedTypes {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularAnnotatedTypes.BuilderSingularAnnotatedTypesBuilder bars(final java.util.Map<? extends @MyAnnotation @NonNull String, ? extends @MyAnnotation @NonNull Integer> bars) {
+ if (bars == null) throw new java.lang.NullPointerException("bars cannot be null");
if (this.bars$key == null) {
this.bars$key = new java.util.ArrayList<@MyAnnotation @NonNull String>();
this.bars$value = new java.util.ArrayList<@MyAnnotation @NonNull Integer>();
diff --git a/test/transform/resource/after-delombok/BuilderSingularAnnotatedTypesWithSetterPrefix.java b/test/transform/resource/after-delombok/BuilderSingularAnnotatedTypesWithSetterPrefix.java
index d1047567..90cc5570 100644
--- a/test/transform/resource/after-delombok/BuilderSingularAnnotatedTypesWithSetterPrefix.java
+++ b/test/transform/resource/after-delombok/BuilderSingularAnnotatedTypesWithSetterPrefix.java
@@ -36,6 +36,7 @@ class BuilderSingularAnnotatedTypesWithSetterPrefix {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularAnnotatedTypesWithSetterPrefix.BuilderSingularAnnotatedTypesWithSetterPrefixBuilder withFoos(final java.util.Collection<? extends @MyAnnotation @NonNull String> foos) {
+ if (foos == null) throw new java.lang.NullPointerException("foos cannot be null");
if (this.foos == null) this.foos = new java.util.ArrayList<@MyAnnotation @NonNull String>();
this.foos.addAll(foos);
return this;
@@ -63,6 +64,7 @@ class BuilderSingularAnnotatedTypesWithSetterPrefix {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularAnnotatedTypesWithSetterPrefix.BuilderSingularAnnotatedTypesWithSetterPrefixBuilder withBars(final java.util.Map<? extends @MyAnnotation @NonNull String, ? extends @MyAnnotation @NonNull Integer> bars) {
+ if (bars == null) throw new java.lang.NullPointerException("bars cannot be null");
if (this.bars$key == null) {
this.bars$key = new java.util.ArrayList<@MyAnnotation @NonNull String>();
this.bars$value = new java.util.ArrayList<@MyAnnotation @NonNull Integer>();
diff --git a/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java b/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java
index b6fb5732..650ab2fd 100644
--- a/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java
+++ b/test/transform/resource/after-delombok/BuilderSingularGuavaListsSets.java
@@ -41,6 +41,7 @@ class BuilderSingularGuavaListsSets<T> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> cards(final java.lang.Iterable<? extends T> cards) {
+ if (cards == null) throw new java.lang.NullPointerException("cards cannot be null");
if (this.cards == null) this.cards = com.google.common.collect.ImmutableList.builder();
this.cards.addAll(cards);
return this;
@@ -58,6 +59,7 @@ class BuilderSingularGuavaListsSets<T> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> frogs(final java.lang.Iterable<? extends Number> frogs) {
+ if (frogs == null) throw new java.lang.NullPointerException("frogs cannot be null");
if (this.frogs == null) this.frogs = com.google.common.collect.ImmutableList.builder();
this.frogs.addAll(frogs);
return this;
@@ -75,6 +77,7 @@ class BuilderSingularGuavaListsSets<T> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> rawSet(final java.lang.Iterable<?> rawSet) {
+ if (rawSet == null) throw new java.lang.NullPointerException("rawSet cannot be null");
if (this.rawSet == null) this.rawSet = com.google.common.collect.ImmutableSet.builder();
this.rawSet.addAll(rawSet);
return this;
@@ -92,6 +95,7 @@ class BuilderSingularGuavaListsSets<T> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> passes(final java.lang.Iterable<? extends String> passes) {
+ if (passes == null) throw new java.lang.NullPointerException("passes cannot be null");
if (this.passes == null) this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder();
this.passes.addAll(passes);
return this;
@@ -109,6 +113,7 @@ class BuilderSingularGuavaListsSets<T> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> users(final com.google.common.collect.Table<? extends Number, ? extends Number, ? extends String> users) {
+ if (users == null) throw new java.lang.NullPointerException("users cannot be null");
if (this.users == null) this.users = com.google.common.collect.ImmutableTable.builder();
this.users.putAll(users);
return this;
diff --git a/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java b/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java
index a6043475..6af1bf8d 100644
--- a/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java
+++ b/test/transform/resource/after-delombok/BuilderSingularGuavaMaps.java
@@ -31,6 +31,7 @@ class BuilderSingularGuavaMaps<K, V> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularGuavaMaps.BuilderSingularGuavaMapsBuilder<K, V> battleaxes(final java.util.Map<? extends K, ? extends V> battleaxes) {
+ if (battleaxes == null) throw new java.lang.NullPointerException("battleaxes cannot be null");
if (this.battleaxes == null) this.battleaxes = com.google.common.collect.ImmutableMap.builder();
this.battleaxes.putAll(battleaxes);
return this;
@@ -48,6 +49,7 @@ class BuilderSingularGuavaMaps<K, V> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularGuavaMaps.BuilderSingularGuavaMapsBuilder<K, V> vertices(final java.util.Map<? extends Integer, ? extends V> vertices) {
+ if (vertices == null) throw new java.lang.NullPointerException("vertices cannot be null");
if (this.vertices == null) this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder();
this.vertices.putAll(vertices);
return this;
@@ -65,6 +67,7 @@ class BuilderSingularGuavaMaps<K, V> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularGuavaMaps.BuilderSingularGuavaMapsBuilder<K, V> rawMap(final java.util.Map<?, ?> rawMap) {
+ if (rawMap == null) throw new java.lang.NullPointerException("rawMap cannot be null");
if (this.rawMap == null) this.rawMap = com.google.common.collect.ImmutableBiMap.builder();
this.rawMap.putAll(rawMap);
return this;
diff --git a/test/transform/resource/after-delombok/BuilderSingularLists.java b/test/transform/resource/after-delombok/BuilderSingularLists.java
index 971a2851..43eb7702 100644
--- a/test/transform/resource/after-delombok/BuilderSingularLists.java
+++ b/test/transform/resource/after-delombok/BuilderSingularLists.java
@@ -30,6 +30,7 @@ class BuilderSingularLists<T> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularLists.BuilderSingularListsBuilder<T> children(final java.util.Collection<? extends T> children) {
+ if (children == null) throw new java.lang.NullPointerException("children cannot be null");
if (this.children == null) this.children = new java.util.ArrayList<T>();
this.children.addAll(children);
return this;
@@ -47,6 +48,7 @@ class BuilderSingularLists<T> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularLists.BuilderSingularListsBuilder<T> scarves(final java.util.Collection<? extends Number> scarves) {
+ if (scarves == null) throw new java.lang.NullPointerException("scarves cannot be null");
if (this.scarves == null) this.scarves = new java.util.ArrayList<Number>();
this.scarves.addAll(scarves);
return this;
@@ -64,6 +66,7 @@ class BuilderSingularLists<T> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularLists.BuilderSingularListsBuilder<T> rawList(final java.util.Collection<?> rawList) {
+ if (rawList == null) throw new java.lang.NullPointerException("rawList cannot be null");
if (this.rawList == null) this.rawList = new java.util.ArrayList<java.lang.Object>();
this.rawList.addAll(rawList);
return this;
diff --git a/test/transform/resource/after-delombok/BuilderSingularMaps.java b/test/transform/resource/after-delombok/BuilderSingularMaps.java
index 240a6e3b..d10dd090 100644
--- a/test/transform/resource/after-delombok/BuilderSingularMaps.java
+++ b/test/transform/resource/after-delombok/BuilderSingularMaps.java
@@ -46,6 +46,7 @@ class BuilderSingularMaps<K, V> {
}
@SuppressWarnings("all")
public BuilderSingularMaps.BuilderSingularMapsBuilder<K, V> women(java.util.Map<? extends K, ? extends V> women) {
+ if (women == null) throw new NullPointerException("women cannot be null");
if (this.women$key == null) {
this.women$key = new java.util.ArrayList<K>();
this.women$value = new java.util.ArrayList<V>();
@@ -76,6 +77,7 @@ class BuilderSingularMaps<K, V> {
}
@SuppressWarnings("all")
public BuilderSingularMaps.BuilderSingularMapsBuilder<K, V> men(java.util.Map<? extends K, ? extends Number> men) {
+ if (men == null) throw new NullPointerException("men cannot be null");
if (this.men$key == null) {
this.men$key = new java.util.ArrayList<K>();
this.men$value = new java.util.ArrayList<Number>();
@@ -106,6 +108,7 @@ class BuilderSingularMaps<K, V> {
}
@SuppressWarnings("all")
public BuilderSingularMaps.BuilderSingularMapsBuilder<K, V> rawMap(java.util.Map<?, ?> rawMap) {
+ if (rawMap == null) throw new NullPointerException("rawMap cannot be null");
if (this.rawMap$key == null) {
this.rawMap$key = new java.util.ArrayList<Object>();
this.rawMap$value = new java.util.ArrayList<Object>();
@@ -136,6 +139,7 @@ class BuilderSingularMaps<K, V> {
}
@SuppressWarnings("all")
public BuilderSingularMaps.BuilderSingularMapsBuilder<K, V> stringMap(java.util.Map<? extends String, ? extends V> stringMap) {
+ if (stringMap == null) throw new NullPointerException("stringMap cannot be null");
if (this.stringMap$key == null) {
this.stringMap$key = new java.util.ArrayList<String>();
this.stringMap$value = new java.util.ArrayList<V>();
diff --git a/test/transform/resource/after-delombok/BuilderSingularMapsWithSetterPrefix.java b/test/transform/resource/after-delombok/BuilderSingularMapsWithSetterPrefix.java
index bfc2e750..baa8f311 100644
--- a/test/transform/resource/after-delombok/BuilderSingularMapsWithSetterPrefix.java
+++ b/test/transform/resource/after-delombok/BuilderSingularMapsWithSetterPrefix.java
@@ -46,13 +46,15 @@ class BuilderSingularMapsWithSetterPrefix<K, V> {
}
@SuppressWarnings("all")
public BuilderSingularMapsWithSetterPrefix.BuilderSingularMapsWithSetterPrefixBuilder<K, V> withWomen(java.util.Map<? extends K, ? extends V> women) {
- if (this.women$key == null) {
- this.women$key = new java.util.ArrayList<K>();
- this.women$value = new java.util.ArrayList<V>();
- }
- for (java.util.Map.Entry<? extends K, ? extends V> $lombokEntry : women.entrySet()) {
- this.women$key.add($lombokEntry.getKey());
- this.women$value.add($lombokEntry.getValue());
+ if (women != null) {
+ if (this.women$key == null) {
+ this.women$key = new java.util.ArrayList<K>();
+ this.women$value = new java.util.ArrayList<V>();
+ }
+ for (java.util.Map.Entry<? extends K, ? extends V> $lombokEntry : women.entrySet()) {
+ this.women$key.add($lombokEntry.getKey());
+ this.women$value.add($lombokEntry.getValue());
+ }
}
return this;
}
@@ -76,13 +78,15 @@ class BuilderSingularMapsWithSetterPrefix<K, V> {
}
@SuppressWarnings("all")
public BuilderSingularMapsWithSetterPrefix.BuilderSingularMapsWithSetterPrefixBuilder<K, V> withMen(java.util.Map<? extends K, ? extends Number> men) {
- if (this.men$key == null) {
- this.men$key = new java.util.ArrayList<K>();
- this.men$value = new java.util.ArrayList<Number>();
- }
- for (java.util.Map.Entry<? extends K, ? extends Number> $lombokEntry : men.entrySet()) {
- this.men$key.add($lombokEntry.getKey());
- this.men$value.add($lombokEntry.getValue());
+ if (men != null) {
+ if (this.men$key == null) {
+ this.men$key = new java.util.ArrayList<K>();
+ this.men$value = new java.util.ArrayList<Number>();
+ }
+ for (java.util.Map.Entry<? extends K, ? extends Number> $lombokEntry : men.entrySet()) {
+ this.men$key.add($lombokEntry.getKey());
+ this.men$value.add($lombokEntry.getValue());
+ }
}
return this;
}
@@ -106,13 +110,15 @@ class BuilderSingularMapsWithSetterPrefix<K, V> {
}
@SuppressWarnings("all")
public BuilderSingularMapsWithSetterPrefix.BuilderSingularMapsWithSetterPrefixBuilder<K, V> withRawMap(java.util.Map<?, ?> rawMap) {
- if (this.rawMap$key == null) {
- this.rawMap$key = new java.util.ArrayList<Object>();
- this.rawMap$value = new java.util.ArrayList<Object>();
- }
- for (java.util.Map.Entry<?, ?> $lombokEntry : rawMap.entrySet()) {
- this.rawMap$key.add($lombokEntry.getKey());
- this.rawMap$value.add($lombokEntry.getValue());
+ if (rawMap != null) {
+ if (this.rawMap$key == null) {
+ this.rawMap$key = new java.util.ArrayList<Object>();
+ this.rawMap$value = new java.util.ArrayList<Object>();
+ }
+ for (java.util.Map.Entry<?, ?> $lombokEntry : rawMap.entrySet()) {
+ this.rawMap$key.add($lombokEntry.getKey());
+ this.rawMap$value.add($lombokEntry.getValue());
+ }
}
return this;
}
@@ -136,13 +142,15 @@ class BuilderSingularMapsWithSetterPrefix<K, V> {
}
@SuppressWarnings("all")
public BuilderSingularMapsWithSetterPrefix.BuilderSingularMapsWithSetterPrefixBuilder<K, V> withStringMap(java.util.Map<? extends String, ? extends V> stringMap) {
- if (this.stringMap$key == null) {
- this.stringMap$key = new java.util.ArrayList<String>();
- this.stringMap$value = new java.util.ArrayList<V>();
- }
- for (java.util.Map.Entry<? extends String, ? extends V> $lombokEntry : stringMap.entrySet()) {
- this.stringMap$key.add($lombokEntry.getKey());
- this.stringMap$value.add($lombokEntry.getValue());
+ if (stringMap != null) {
+ if (this.stringMap$key == null) {
+ this.stringMap$key = new java.util.ArrayList<String>();
+ this.stringMap$value = new java.util.ArrayList<V>();
+ }
+ for (java.util.Map.Entry<? extends String, ? extends V> $lombokEntry : stringMap.entrySet()) {
+ this.stringMap$key.add($lombokEntry.getKey());
+ this.stringMap$value.add($lombokEntry.getValue());
+ }
}
return this;
}
diff --git a/test/transform/resource/after-delombok/BuilderSingularNoAuto.java b/test/transform/resource/after-delombok/BuilderSingularNoAuto.java
index a38effc0..6b2fd5b2 100644
--- a/test/transform/resource/after-delombok/BuilderSingularNoAuto.java
+++ b/test/transform/resource/after-delombok/BuilderSingularNoAuto.java
@@ -28,6 +28,7 @@ class BuilderSingularNoAuto {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularNoAuto.BuilderSingularNoAutoBuilder things(final java.util.Collection<? extends String> things) {
+ if (things == null) throw new java.lang.NullPointerException("things cannot be null");
if (this.things == null) this.things = new java.util.ArrayList<String>();
this.things.addAll(things);
return this;
@@ -45,6 +46,7 @@ class BuilderSingularNoAuto {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularNoAuto.BuilderSingularNoAutoBuilder widgets(final java.util.Collection<? extends String> widgets) {
+ if (widgets == null) throw new java.lang.NullPointerException("widgets cannot be null");
if (this.widgets == null) this.widgets = new java.util.ArrayList<String>();
this.widgets.addAll(widgets);
return this;
@@ -62,6 +64,7 @@ class BuilderSingularNoAuto {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularNoAuto.BuilderSingularNoAutoBuilder items(final java.util.Collection<? extends String> items) {
+ if (items == null) throw new java.lang.NullPointerException("items cannot be null");
if (this.items == null) this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
return this;
diff --git a/test/transform/resource/after-delombok/BuilderSingularNoAutoWithSetterPrefix.java b/test/transform/resource/after-delombok/BuilderSingularNoAutoWithSetterPrefix.java
index 57bef625..a023b82a 100644
--- a/test/transform/resource/after-delombok/BuilderSingularNoAutoWithSetterPrefix.java
+++ b/test/transform/resource/after-delombok/BuilderSingularNoAutoWithSetterPrefix.java
@@ -28,6 +28,7 @@ class BuilderSingularNoAutoWithSetterPrefix {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularNoAutoWithSetterPrefix.BuilderSingularNoAutoWithSetterPrefixBuilder withThings(final java.util.Collection<? extends String> things) {
+ if (things == null) throw new java.lang.NullPointerException("things cannot be null");
if (this.things == null) this.things = new java.util.ArrayList<String>();
this.things.addAll(things);
return this;
@@ -45,6 +46,7 @@ class BuilderSingularNoAutoWithSetterPrefix {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularNoAutoWithSetterPrefix.BuilderSingularNoAutoWithSetterPrefixBuilder withWidgets(final java.util.Collection<? extends String> widgets) {
+ if (widgets == null) throw new java.lang.NullPointerException("widgets cannot be null");
if (this.widgets == null) this.widgets = new java.util.ArrayList<String>();
this.widgets.addAll(widgets);
return this;
@@ -62,6 +64,7 @@ class BuilderSingularNoAutoWithSetterPrefix {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularNoAutoWithSetterPrefix.BuilderSingularNoAutoWithSetterPrefixBuilder withItems(final java.util.Collection<? extends String> items) {
+ if (items == null) throw new java.lang.NullPointerException("items cannot be null");
if (this.items == null) this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
return this;
diff --git a/test/transform/resource/after-delombok/BuilderSingularNullBehavior1.java b/test/transform/resource/after-delombok/BuilderSingularNullBehavior1.java
new file mode 100644
index 00000000..7b4e0a29
--- /dev/null
+++ b/test/transform/resource/after-delombok/BuilderSingularNullBehavior1.java
@@ -0,0 +1,160 @@
+import java.util.List;
+import java.util.Collection;
+import lombok.Singular.NullCollectionBehavior;
+class BuilderSingularNullBehavior1 {
+ private List<String> names;
+ private List<String> locations;
+ private List<String> whatevers;
+ private List<String> doohickeys;
+ @java.lang.SuppressWarnings("all")
+ BuilderSingularNullBehavior1(final List<String> names, final List<String> locations, final List<String> whatevers, final List<String> doohickeys) {
+ this.names = names;
+ this.locations = locations;
+ this.whatevers = whatevers;
+ this.doohickeys = doohickeys;
+ }
+ @java.lang.SuppressWarnings("all")
+ public static class BuilderSingularNullBehavior1Builder {
+ @java.lang.SuppressWarnings("all")
+ private java.util.ArrayList<String> names;
+ @java.lang.SuppressWarnings("all")
+ private java.util.ArrayList<String> locations;
+ @java.lang.SuppressWarnings("all")
+ private java.util.ArrayList<String> whatevers;
+ @java.lang.SuppressWarnings("all")
+ private java.util.ArrayList<String> doohickeys;
+ @java.lang.SuppressWarnings("all")
+ BuilderSingularNullBehavior1Builder() {
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder name(final String name) {
+ if (this.names == null) this.names = new java.util.ArrayList<String>();
+ this.names.add(name);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder names(final java.util.Collection<? extends String> names) {
+ if (names == null) throw new java.lang.NullPointerException("names cannot be null");
+ if (this.names == null) this.names = new java.util.ArrayList<String>();
+ this.names.addAll(names);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder clearNames() {
+ if (this.names != null) this.names.clear();
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder location(final String location) {
+ if (this.locations == null) this.locations = new java.util.ArrayList<String>();
+ this.locations.add(location);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder locations(final java.util.Collection<? extends String> locations) {
+ java.util.Objects.requireNonNull(locations, "locations cannot be null");
+ if (this.locations == null) this.locations = new java.util.ArrayList<String>();
+ this.locations.addAll(locations);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder clearLocations() {
+ if (this.locations != null) this.locations.clear();
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder whatever(final String whatever) {
+ if (this.whatevers == null) this.whatevers = new java.util.ArrayList<String>();
+ this.whatevers.add(whatever);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder whatevers(final java.util.Collection<? extends String> whatevers) {
+ com.google.common.base.Preconditions.checkNotNull(whatevers, "whatevers cannot be null");
+ if (this.whatevers == null) this.whatevers = new java.util.ArrayList<String>();
+ this.whatevers.addAll(whatevers);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder clearWhatevers() {
+ if (this.whatevers != null) this.whatevers.clear();
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder doohickey(final String doohickey) {
+ if (this.doohickeys == null) this.doohickeys = new java.util.ArrayList<String>();
+ this.doohickeys.add(doohickey);
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder doohickeys(final java.util.Collection<? extends String> doohickeys) {
+ if (doohickeys != null) {
+ if (this.doohickeys == null) this.doohickeys = new java.util.ArrayList<String>();
+ this.doohickeys.addAll(doohickeys);
+ }
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder clearDoohickeys() {
+ if (this.doohickeys != null) this.doohickeys.clear();
+ return this;
+ }
+ @java.lang.SuppressWarnings("all")
+ public BuilderSingularNullBehavior1 build() {
+ java.util.List<String> names;
+ switch (this.names == null ? 0 : this.names.size()) {
+ case 0:
+ names = java.util.Collections.emptyList();
+ break;
+ case 1:
+ names = java.util.Collections.singletonList(this.names.get(0));
+ break;
+ default:
+ names = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.names));
+ }
+ java.util.List<String> locations;
+ switch (this.locations == null ? 0 : this.locations.size()) {
+ case 0:
+ locations = java.util.Collections.emptyList();
+ break;
+ case 1:
+ locations = java.util.Collections.singletonList(this.locations.get(0));
+ break;
+ default:
+ locations = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.locations));
+ }
+ java.util.List<String> whatevers;
+ switch (this.whatevers == null ? 0 : this.whatevers.size()) {
+ case 0:
+ whatevers = java.util.Collections.emptyList();
+ break;
+ case 1:
+ whatevers = java.util.Collections.singletonList(this.whatevers.get(0));
+ break;
+ default:
+ whatevers = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.whatevers));
+ }
+ java.util.List<String> doohickeys;
+ switch (this.doohickeys == null ? 0 : this.doohickeys.size()) {
+ case 0:
+ doohickeys = java.util.Collections.emptyList();
+ break;
+ case 1:
+ doohickeys = java.util.Collections.singletonList(this.doohickeys.get(0));
+ break;
+ default:
+ doohickeys = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.doohickeys));
+ }
+ return new BuilderSingularNullBehavior1(names, locations, whatevers, doohickeys);
+ }
+ @java.lang.Override
+ @java.lang.SuppressWarnings("all")
+ public java.lang.String toString() {
+ return "BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder(names=" + this.names + ", locations=" + this.locations + ", whatevers=" + this.whatevers + ", doohickeys=" + this.doohickeys + ")";
+ }
+ }
+ @java.lang.SuppressWarnings("all")
+ public static BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder builder() {
+ return new BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder();
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java b/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java
index 4ce5cae5..9ee6823e 100644
--- a/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java
+++ b/test/transform/resource/after-delombok/BuilderSingularRedirectToGuava.java
@@ -30,6 +30,7 @@ class BuilderSingularRedirectToGuava {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularRedirectToGuava.BuilderSingularRedirectToGuavaBuilder dangerMice(final java.lang.Iterable<? extends String> dangerMice) {
+ if (dangerMice == null) throw new java.lang.NullPointerException("dangerMice cannot be null");
if (this.dangerMice == null) this.dangerMice = com.google.common.collect.ImmutableSet.builder();
this.dangerMice.addAll(dangerMice);
return this;
@@ -47,6 +48,7 @@ class BuilderSingularRedirectToGuava {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularRedirectToGuava.BuilderSingularRedirectToGuavaBuilder things(final java.util.Map<? extends Integer, ? extends Number> things) {
+ if (things == null) throw new java.lang.NullPointerException("things cannot be null");
if (this.things == null) this.things = com.google.common.collect.ImmutableSortedMap.naturalOrder();
this.things.putAll(things);
return this;
@@ -64,6 +66,7 @@ class BuilderSingularRedirectToGuava {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularRedirectToGuava.BuilderSingularRedirectToGuavaBuilder doohickeys(final java.lang.Iterable<? extends Class<?>> doohickeys) {
+ if (doohickeys == null) throw new java.lang.NullPointerException("doohickeys cannot be null");
if (this.doohickeys == null) this.doohickeys = com.google.common.collect.ImmutableList.builder();
this.doohickeys.addAll(doohickeys);
return this;
diff --git a/test/transform/resource/after-delombok/BuilderSingularSets.java b/test/transform/resource/after-delombok/BuilderSingularSets.java
index c85bbb99..7b905c8c 100644
--- a/test/transform/resource/after-delombok/BuilderSingularSets.java
+++ b/test/transform/resource/after-delombok/BuilderSingularSets.java
@@ -34,6 +34,7 @@ class BuilderSingularSets<T> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularSets.BuilderSingularSetsBuilder<T> dangerMice(final java.util.Collection<? extends T> dangerMice) {
+ if (dangerMice == null) throw new java.lang.NullPointerException("dangerMice cannot be null");
if (this.dangerMice == null) this.dangerMice = new java.util.ArrayList<T>();
this.dangerMice.addAll(dangerMice);
return this;
@@ -51,6 +52,7 @@ class BuilderSingularSets<T> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularSets.BuilderSingularSetsBuilder<T> octopodes(final java.util.Collection<? extends Number> octopodes) {
+ if (octopodes == null) throw new java.lang.NullPointerException("octopodes cannot be null");
if (this.octopodes == null) this.octopodes = new java.util.ArrayList<Number>();
this.octopodes.addAll(octopodes);
return this;
@@ -68,6 +70,7 @@ class BuilderSingularSets<T> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularSets.BuilderSingularSetsBuilder<T> rawSet(final java.util.Collection<?> rawSet) {
+ if (rawSet == null) throw new java.lang.NullPointerException("rawSet cannot be null");
if (this.rawSet == null) this.rawSet = new java.util.ArrayList<java.lang.Object>();
this.rawSet.addAll(rawSet);
return this;
@@ -85,6 +88,7 @@ class BuilderSingularSets<T> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularSets.BuilderSingularSetsBuilder<T> stringSet(final java.util.Collection<? extends String> stringSet) {
+ if (stringSet == null) throw new java.lang.NullPointerException("stringSet cannot be null");
if (this.stringSet == null) this.stringSet = new java.util.ArrayList<String>();
this.stringSet.addAll(stringSet);
return this;
diff --git a/test/transform/resource/after-delombok/BuilderSingularSetsWithSetterPrefix.java b/test/transform/resource/after-delombok/BuilderSingularSetsWithSetterPrefix.java
index 6c9abf2f..4a025624 100644
--- a/test/transform/resource/after-delombok/BuilderSingularSetsWithSetterPrefix.java
+++ b/test/transform/resource/after-delombok/BuilderSingularSetsWithSetterPrefix.java
@@ -34,6 +34,7 @@ class BuilderSingularSetsWithSetterPrefix<T> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularSetsWithSetterPrefix.BuilderSingularSetsWithSetterPrefixBuilder<T> withDangerMice(final java.util.Collection<? extends T> dangerMice) {
+ if (dangerMice == null) throw new java.lang.NullPointerException("dangerMice cannot be null");
if (this.dangerMice == null) this.dangerMice = new java.util.ArrayList<T>();
this.dangerMice.addAll(dangerMice);
return this;
@@ -51,6 +52,7 @@ class BuilderSingularSetsWithSetterPrefix<T> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularSetsWithSetterPrefix.BuilderSingularSetsWithSetterPrefixBuilder<T> withOctopodes(final java.util.Collection<? extends Number> octopodes) {
+ if (octopodes == null) throw new java.lang.NullPointerException("octopodes cannot be null");
if (this.octopodes == null) this.octopodes = new java.util.ArrayList<Number>();
this.octopodes.addAll(octopodes);
return this;
@@ -68,6 +70,7 @@ class BuilderSingularSetsWithSetterPrefix<T> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularSetsWithSetterPrefix.BuilderSingularSetsWithSetterPrefixBuilder<T> withRawSet(final java.util.Collection<?> rawSet) {
+ if (rawSet == null) throw new java.lang.NullPointerException("rawSet cannot be null");
if (this.rawSet == null) this.rawSet = new java.util.ArrayList<java.lang.Object>();
this.rawSet.addAll(rawSet);
return this;
@@ -85,6 +88,7 @@ class BuilderSingularSetsWithSetterPrefix<T> {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularSetsWithSetterPrefix.BuilderSingularSetsWithSetterPrefixBuilder<T> withStringSet(final java.util.Collection<? extends String> stringSet) {
+ if (stringSet == null) throw new java.lang.NullPointerException("stringSet cannot be null");
if (this.stringSet == null) this.stringSet = new java.util.ArrayList<String>();
this.stringSet.addAll(stringSet);
return this;
diff --git a/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java b/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java
index 2166491b..9a5ea7b3 100644
--- a/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java
+++ b/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNull.java
@@ -22,6 +22,7 @@ class BuilderSingularToBuilderWithNull {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularToBuilderWithNull.BuilderSingularToBuilderWithNullBuilder elems(final java.util.Collection<? extends String> elems) {
+ if (elems == null) throw new java.lang.NullPointerException("elems cannot be null");
if (this.elems == null) this.elems = new java.util.ArrayList<String>();
this.elems.addAll(elems);
return this;
diff --git a/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNullWithSetterPrefix.java b/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNullWithSetterPrefix.java
index 79f11978..1860ba60 100644
--- a/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNullWithSetterPrefix.java
+++ b/test/transform/resource/after-delombok/BuilderSingularToBuilderWithNullWithSetterPrefix.java
@@ -22,6 +22,7 @@ class BuilderSingularToBuilderWithNullWithSetterPrefix {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularToBuilderWithNullWithSetterPrefix.BuilderSingularToBuilderWithNullWithSetterPrefixBuilder withElems(final java.util.Collection<? extends String> elems) {
+ if (elems == null) throw new java.lang.NullPointerException("elems cannot be null");
if (this.elems == null) this.elems = new java.util.ArrayList<String>();
this.elems.addAll(elems);
return this;
diff --git a/test/transform/resource/after-delombok/BuilderSingularWildcardListsWithToBuilder.java b/test/transform/resource/after-delombok/BuilderSingularWildcardListsWithToBuilder.java
index ec05ea2d..29e53768 100644
--- a/test/transform/resource/after-delombok/BuilderSingularWildcardListsWithToBuilder.java
+++ b/test/transform/resource/after-delombok/BuilderSingularWildcardListsWithToBuilder.java
@@ -25,6 +25,7 @@ class BuilderSingularWildcardListsWithToBuilder {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularWildcardListsWithToBuilder.BuilderSingularWildcardListsWithToBuilderBuilder objects(final java.util.Collection<?> objects) {
+ if (objects == null) throw new java.lang.NullPointerException("objects cannot be null");
if (this.objects == null) this.objects = new java.util.ArrayList<java.lang.Object>();
this.objects.addAll(objects);
return this;
@@ -42,6 +43,7 @@ class BuilderSingularWildcardListsWithToBuilder {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularWildcardListsWithToBuilder.BuilderSingularWildcardListsWithToBuilderBuilder numbers(final java.util.Collection<? extends Number> numbers) {
+ if (numbers == null) throw new java.lang.NullPointerException("numbers cannot be null");
if (this.numbers == null) this.numbers = new java.util.ArrayList<Number>();
this.numbers.addAll(numbers);
return this;
diff --git a/test/transform/resource/after-delombok/BuilderSingularWithPrefixes.java b/test/transform/resource/after-delombok/BuilderSingularWithPrefixes.java
index 976866d3..3aa48f5d 100644
--- a/test/transform/resource/after-delombok/BuilderSingularWithPrefixes.java
+++ b/test/transform/resource/after-delombok/BuilderSingularWithPrefixes.java
@@ -19,6 +19,7 @@ class BuilderSingularWithPrefixes {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularWithPrefixes.BuilderSingularWithPrefixesBuilder elems(final java.util.Collection<? extends String> elems) {
+ if (elems == null) throw new java.lang.NullPointerException("elems cannot be null");
if (this.elems == null) this.elems = new java.util.ArrayList<String>();
this.elems.addAll(elems);
return this;
diff --git a/test/transform/resource/after-delombok/BuilderSingularWithPrefixesWithSetterPrefix.java b/test/transform/resource/after-delombok/BuilderSingularWithPrefixesWithSetterPrefix.java
index e2be79de..513c3fe4 100644
--- a/test/transform/resource/after-delombok/BuilderSingularWithPrefixesWithSetterPrefix.java
+++ b/test/transform/resource/after-delombok/BuilderSingularWithPrefixesWithSetterPrefix.java
@@ -19,6 +19,7 @@ class BuilderSingularWithPrefixesWithSetterPrefix {
}
@java.lang.SuppressWarnings("all")
public BuilderSingularWithPrefixesWithSetterPrefix.BuilderSingularWithPrefixesWithSetterPrefixBuilder withElems(final java.util.Collection<? extends String> elems) {
+ if (elems == null) throw new java.lang.NullPointerException("elems cannot be null");
if (this.elems == null) this.elems = new java.util.ArrayList<String>();
this.elems.addAll(elems);
return this;
diff --git a/test/transform/resource/after-delombok/BuilderWithDeprecated.java b/test/transform/resource/after-delombok/BuilderWithDeprecated.java
index 65f8e4e7..584c8042 100644
--- a/test/transform/resource/after-delombok/BuilderWithDeprecated.java
+++ b/test/transform/resource/after-delombok/BuilderWithDeprecated.java
@@ -56,6 +56,7 @@ public class BuilderWithDeprecated {
@java.lang.Deprecated
@java.lang.SuppressWarnings("all")
public BuilderWithDeprecated.BuilderWithDeprecatedBuilder strings(final java.util.Collection<? extends String> strings) {
+ if (strings == null) throw new java.lang.NullPointerException("strings cannot be null");
if (this.strings == null) this.strings = new java.util.ArrayList<String>();
this.strings.addAll(strings);
return this;
@@ -76,6 +77,7 @@ public class BuilderWithDeprecated {
@java.lang.Deprecated
@java.lang.SuppressWarnings("all")
public BuilderWithDeprecated.BuilderWithDeprecatedBuilder numbers(final java.lang.Iterable<? extends Integer> numbers) {
+ if (numbers == null) throw new java.lang.NullPointerException("numbers cannot be null");
if (this.numbers == null) this.numbers = com.google.common.collect.ImmutableList.builder();
this.numbers.addAll(numbers);
return this;
diff --git a/test/transform/resource/after-delombok/BuilderWithToBuilder.java b/test/transform/resource/after-delombok/BuilderWithToBuilder.java
index aa47c430..20043861 100644
--- a/test/transform/resource/after-delombok/BuilderWithToBuilder.java
+++ b/test/transform/resource/after-delombok/BuilderWithToBuilder.java
@@ -50,6 +50,7 @@ class BuilderWithToBuilder<T> {
}
@java.lang.SuppressWarnings("all")
public BuilderWithToBuilder.BuilderWithToBuilderBuilder<T> bars(final java.util.Collection<? extends T> bars) {
+ if (bars == null) throw new java.lang.NullPointerException("bars cannot be null");
if (this.bars == null) this.bars = new java.util.ArrayList<T>();
this.bars.addAll(bars);
return this;
diff --git a/test/transform/resource/after-delombok/CheckerFrameworkBuilder.java b/test/transform/resource/after-delombok/CheckerFrameworkBuilder.java
index 1b993d2a..fad0cf2b 100644
--- a/test/transform/resource/after-delombok/CheckerFrameworkBuilder.java
+++ b/test/transform/resource/after-delombok/CheckerFrameworkBuilder.java
@@ -62,6 +62,7 @@ class CheckerFrameworkBuilder {
@org.checkerframework.checker.builder.qual.ReturnsReceiver
@java.lang.SuppressWarnings("all")
public CheckerFrameworkBuilder.CheckerFrameworkBuilderBuilder names(final java.util.Collection<? extends String> names) {
+ if (names == null) throw new java.lang.NullPointerException("names cannot be null");
if (this.names == null) this.names = new java.util.ArrayList<String>();
this.names.addAll(names);
return this;
diff --git a/test/transform/resource/after-delombok/CheckerFrameworkSuperBuilder.java b/test/transform/resource/after-delombok/CheckerFrameworkSuperBuilder.java
index 31e8bdb5..f2cde1c6 100644
--- a/test/transform/resource/after-delombok/CheckerFrameworkSuperBuilder.java
+++ b/test/transform/resource/after-delombok/CheckerFrameworkSuperBuilder.java
@@ -58,6 +58,7 @@ class CheckerFrameworkSuperBuilder {
@org.checkerframework.checker.builder.qual.ReturnsReceiver
@java.lang.SuppressWarnings("all")
public B names(final java.util.Collection<? extends String> names) {
+ if (names == null) throw new java.lang.NullPointerException("names cannot be null");
if (this.names == null) this.names = new java.util.ArrayList<String>();
this.names.addAll(names);
return self();
diff --git a/test/transform/resource/after-delombok/SuperBuilderBasic.java b/test/transform/resource/after-delombok/SuperBuilderBasic.java
index ef8df1cc..1447e9af 100644
--- a/test/transform/resource/after-delombok/SuperBuilderBasic.java
+++ b/test/transform/resource/after-delombok/SuperBuilderBasic.java
@@ -26,6 +26,7 @@ public class SuperBuilderBasic {
}
@java.lang.SuppressWarnings("all")
public B items(final java.util.Collection<? extends String> items) {
+ if (items == null) throw new java.lang.NullPointerException("items cannot be null");
if (this.items == null) this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
return self();
diff --git a/test/transform/resource/after-delombok/SuperBuilderBasicToBuilder.java b/test/transform/resource/after-delombok/SuperBuilderBasicToBuilder.java
index e9e8774a..1c0d378d 100644
--- a/test/transform/resource/after-delombok/SuperBuilderBasicToBuilder.java
+++ b/test/transform/resource/after-delombok/SuperBuilderBasicToBuilder.java
@@ -69,6 +69,7 @@ public class SuperBuilderBasicToBuilder {
}
@java.lang.SuppressWarnings("all")
public B items(final java.util.Collection<? extends String> items) {
+ if (items == null) throw new java.lang.NullPointerException("items cannot be null");
if (this.items == null) this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
return self();
diff --git a/test/transform/resource/after-delombok/SuperBuilderSingularAnnotatedTypes.java b/test/transform/resource/after-delombok/SuperBuilderSingularAnnotatedTypes.java
index 12c61096..865af859 100644
--- a/test/transform/resource/after-delombok/SuperBuilderSingularAnnotatedTypes.java
+++ b/test/transform/resource/after-delombok/SuperBuilderSingularAnnotatedTypes.java
@@ -32,6 +32,7 @@ class SuperBuilderSingularAnnotatedTypes {
}
@java.lang.SuppressWarnings("all")
public B foos(final java.util.Collection<? extends @MyAnnotation @NonNull String> foos) {
+ if (foos == null) throw new java.lang.NullPointerException("foos cannot be null");
if (this.foos == null) this.foos = new java.util.ArrayList<@MyAnnotation @NonNull String>();
this.foos.addAll(foos);
return self();
@@ -59,6 +60,7 @@ class SuperBuilderSingularAnnotatedTypes {
}
@java.lang.SuppressWarnings("all")
public B bars(final java.util.Map<? extends @MyAnnotation @NonNull String, ? extends @MyAnnotation @NonNull Integer> bars) {
+ if (bars == null) throw new java.lang.NullPointerException("bars cannot be null");
if (this.bars$key == null) {
this.bars$key = new java.util.ArrayList<@MyAnnotation @NonNull String>();
this.bars$value = new java.util.ArrayList<@MyAnnotation @NonNull Integer>();
diff --git a/test/transform/resource/after-delombok/SuperBuilderWithCustomBuilderMethod.java b/test/transform/resource/after-delombok/SuperBuilderWithCustomBuilderMethod.java
index e042b238..4300a5ec 100644
--- a/test/transform/resource/after-delombok/SuperBuilderWithCustomBuilderMethod.java
+++ b/test/transform/resource/after-delombok/SuperBuilderWithCustomBuilderMethod.java
@@ -26,6 +26,7 @@ public class SuperBuilderWithCustomBuilderMethod {
}
@java.lang.SuppressWarnings("all")
public B items(final java.util.Collection<? extends String> items) {
+ if (items == null) throw new java.lang.NullPointerException("items cannot be null");
if (this.items == null) this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
return self();
diff --git a/test/transform/resource/after-delombok/SuperBuilderWithGenerics.java b/test/transform/resource/after-delombok/SuperBuilderWithGenerics.java
index 2bac58f2..6b3d2ff0 100644
--- a/test/transform/resource/after-delombok/SuperBuilderWithGenerics.java
+++ b/test/transform/resource/after-delombok/SuperBuilderWithGenerics.java
@@ -26,6 +26,7 @@ public class SuperBuilderWithGenerics {
}
@java.lang.SuppressWarnings("all")
public B items(final java.util.Collection<? extends String> items) {
+ if (items == null) throw new java.lang.NullPointerException("items cannot be null");
if (this.items == null) this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
return self();
diff --git a/test/transform/resource/after-delombok/SuperBuilderWithGenerics2.java b/test/transform/resource/after-delombok/SuperBuilderWithGenerics2.java
index 0f4a6c54..b03cff07 100644
--- a/test/transform/resource/after-delombok/SuperBuilderWithGenerics2.java
+++ b/test/transform/resource/after-delombok/SuperBuilderWithGenerics2.java
@@ -26,6 +26,7 @@ public class SuperBuilderWithGenerics2 {
}
@java.lang.SuppressWarnings("all")
public B items(final java.util.Collection<? extends String> items) {
+ if (items == null) throw new java.lang.NullPointerException("items cannot be null");
if (this.items == null) this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
return self();
diff --git a/test/transform/resource/after-delombok/SuperBuilderWithGenericsAndToBuilder.java b/test/transform/resource/after-delombok/SuperBuilderWithGenericsAndToBuilder.java
index a6c44c7f..7403ff10 100644
--- a/test/transform/resource/after-delombok/SuperBuilderWithGenericsAndToBuilder.java
+++ b/test/transform/resource/after-delombok/SuperBuilderWithGenericsAndToBuilder.java
@@ -42,6 +42,7 @@ public class SuperBuilderWithGenericsAndToBuilder {
}
@java.lang.SuppressWarnings("all")
public B items(final java.util.Map<? extends Integer, ? extends String> items) {
+ if (items == null) throw new java.lang.NullPointerException("items cannot be null");
if (this.items$key == null) {
this.items$key = new java.util.ArrayList<Integer>();
this.items$value = new java.util.ArrayList<String>();
diff --git a/test/transform/resource/after-delombok/SuperBuilderWithPrefixes.java b/test/transform/resource/after-delombok/SuperBuilderWithPrefixes.java
index 15c8d9b9..324a1443 100644
--- a/test/transform/resource/after-delombok/SuperBuilderWithPrefixes.java
+++ b/test/transform/resource/after-delombok/SuperBuilderWithPrefixes.java
@@ -32,6 +32,7 @@ class SuperBuilderWithPrefixes {
}
@java.lang.SuppressWarnings("all")
public B items(final java.util.Collection<? extends String> items) {
+ if (items == null) throw new java.lang.NullPointerException("items cannot be null");
if (this.items == null) this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
return self();
diff --git a/test/transform/resource/after-ecj/BuilderDefaultsWarnings.java b/test/transform/resource/after-ecj/BuilderDefaultsWarnings.java
index cc995aa2..e9ecad90 100644
--- a/test/transform/resource/after-ecj/BuilderDefaultsWarnings.java
+++ b/test/transform/resource/after-ecj/BuilderDefaultsWarnings.java
@@ -23,6 +23,8 @@ public @Builder class BuilderDefaultsWarnings {
return this;
}
public @java.lang.SuppressWarnings("all") BuilderDefaultsWarnings.BuilderDefaultsWarningsBuilder items(final java.util.Collection<? extends String> items) {
+ if ((items == null))
+ throw new java.lang.NullPointerException("items cannot be null");
if ((this.items == null))
this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
diff --git a/test/transform/resource/after-ecj/BuilderSingularAnnotatedTypes.java b/test/transform/resource/after-ecj/BuilderSingularAnnotatedTypes.java
index 18c01c2e..a371de1c 100644
--- a/test/transform/resource/after-ecj/BuilderSingularAnnotatedTypes.java
+++ b/test/transform/resource/after-ecj/BuilderSingularAnnotatedTypes.java
@@ -25,6 +25,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypes.BuilderSingularAnnotatedTypesBuilder foos(final java.util.Collection<? extends @MyAnnotation @NonNull String> foos) {
+ if ((foos == null))
+ throw new java.lang.NullPointerException("foos cannot be null");
if ((this.foos == null))
this.foos = new java.util.ArrayList<@MyAnnotation @NonNull String>();
this.foos.addAll(foos);
@@ -54,6 +56,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypes.BuilderSingularAnnotatedTypesBuilder bars(final java.util.Map<? extends @MyAnnotation @NonNull String, ? extends @MyAnnotation @NonNull Integer> bars) {
+ if ((bars == null))
+ throw new java.lang.NullPointerException("bars cannot be null");
if ((this.bars$key == null))
{
this.bars$key = new java.util.ArrayList<@MyAnnotation @NonNull String>();
diff --git a/test/transform/resource/after-ecj/BuilderSingularAnnotatedTypesWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularAnnotatedTypesWithSetterPrefix.java
index 20197f83..cbb73c2f 100644
--- a/test/transform/resource/after-ecj/BuilderSingularAnnotatedTypesWithSetterPrefix.java
+++ b/test/transform/resource/after-ecj/BuilderSingularAnnotatedTypesWithSetterPrefix.java
@@ -25,6 +25,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesWithSetterPrefix.BuilderSingularAnnotatedTypesWithSetterPrefixBuilder withFoos(final java.util.Collection<? extends @MyAnnotation @NonNull String> foos) {
+ if ((foos == null))
+ throw new java.lang.NullPointerException("foos cannot be null");
if ((this.foos == null))
this.foos = new java.util.ArrayList<@MyAnnotation @NonNull String>();
this.foos.addAll(foos);
@@ -54,6 +56,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularAnnotatedTypesWithSetterPrefix.BuilderSingularAnnotatedTypesWithSetterPrefixBuilder withBars(final java.util.Map<? extends @MyAnnotation @NonNull String, ? extends @MyAnnotation @NonNull Integer> bars) {
+ if ((bars == null))
+ throw new java.lang.NullPointerException("bars cannot be null");
if ((this.bars$key == null))
{
this.bars$key = new java.util.ArrayList<@MyAnnotation @NonNull String>();
diff --git a/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java b/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java
index 88a3096f..d0c68234 100644
--- a/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java
+++ b/test/transform/resource/after-ecj/BuilderSingularGuavaListsSets.java
@@ -21,6 +21,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> cards(final java.lang.Iterable<? extends T> cards) {
+ if ((cards == null))
+ throw new java.lang.NullPointerException("cards cannot be null");
if ((this.cards == null))
this.cards = com.google.common.collect.ImmutableList.builder();
this.cards.addAll(cards);
@@ -37,6 +39,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> frogs(final java.lang.Iterable<? extends Number> frogs) {
+ if ((frogs == null))
+ throw new java.lang.NullPointerException("frogs cannot be null");
if ((this.frogs == null))
this.frogs = com.google.common.collect.ImmutableList.builder();
this.frogs.addAll(frogs);
@@ -53,6 +57,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> rawSet(final java.lang.Iterable<?> rawSet) {
+ if ((rawSet == null))
+ throw new java.lang.NullPointerException("rawSet cannot be null");
if ((this.rawSet == null))
this.rawSet = com.google.common.collect.ImmutableSet.builder();
this.rawSet.addAll(rawSet);
@@ -69,6 +75,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> passes(final java.lang.Iterable<? extends String> passes) {
+ if ((passes == null))
+ throw new java.lang.NullPointerException("passes cannot be null");
if ((this.passes == null))
this.passes = com.google.common.collect.ImmutableSortedSet.naturalOrder();
this.passes.addAll(passes);
@@ -85,6 +93,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularGuavaListsSets.BuilderSingularGuavaListsSetsBuilder<T> users(final com.google.common.collect.Table<? extends Number, ? extends Number, ? extends String> users) {
+ if ((users == null))
+ throw new java.lang.NullPointerException("users cannot be null");
if ((this.users == null))
this.users = com.google.common.collect.ImmutableTable.builder();
this.users.putAll(users);
diff --git a/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java b/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java
index 618ee8db..08c72f98 100644
--- a/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java
+++ b/test/transform/resource/after-ecj/BuilderSingularGuavaMaps.java
@@ -17,6 +17,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMaps.BuilderSingularGuavaMapsBuilder<K, V> battleaxes(final java.util.Map<? extends K, ? extends V> battleaxes) {
+ if ((battleaxes == null))
+ throw new java.lang.NullPointerException("battleaxes cannot be null");
if ((this.battleaxes == null))
this.battleaxes = com.google.common.collect.ImmutableMap.builder();
this.battleaxes.putAll(battleaxes);
@@ -33,6 +35,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMaps.BuilderSingularGuavaMapsBuilder<K, V> vertices(final java.util.Map<? extends Integer, ? extends V> vertices) {
+ if ((vertices == null))
+ throw new java.lang.NullPointerException("vertices cannot be null");
if ((this.vertices == null))
this.vertices = com.google.common.collect.ImmutableSortedMap.naturalOrder();
this.vertices.putAll(vertices);
@@ -49,6 +53,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularGuavaMaps.BuilderSingularGuavaMapsBuilder<K, V> rawMap(final java.util.Map<?, ?> rawMap) {
+ if ((rawMap == null))
+ throw new java.lang.NullPointerException("rawMap cannot be null");
if ((this.rawMap == null))
this.rawMap = com.google.common.collect.ImmutableBiMap.builder();
this.rawMap.putAll(rawMap);
diff --git a/test/transform/resource/after-ecj/BuilderSingularLists.java b/test/transform/resource/after-ecj/BuilderSingularLists.java
index 66247c3f..c201a32b 100644
--- a/test/transform/resource/after-ecj/BuilderSingularLists.java
+++ b/test/transform/resource/after-ecj/BuilderSingularLists.java
@@ -17,6 +17,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularLists.BuilderSingularListsBuilder<T> children(final java.util.Collection<? extends T> children) {
+ if ((children == null))
+ throw new java.lang.NullPointerException("children cannot be null");
if ((this.children == null))
this.children = new java.util.ArrayList<T>();
this.children.addAll(children);
@@ -34,6 +36,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularLists.BuilderSingularListsBuilder<T> scarves(final java.util.Collection<? extends Number> scarves) {
+ if ((scarves == null))
+ throw new java.lang.NullPointerException("scarves cannot be null");
if ((this.scarves == null))
this.scarves = new java.util.ArrayList<Number>();
this.scarves.addAll(scarves);
@@ -51,6 +55,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularLists.BuilderSingularListsBuilder<T> rawList(final java.util.Collection<?> rawList) {
+ if ((rawList == null))
+ throw new java.lang.NullPointerException("rawList cannot be null");
if ((this.rawList == null))
this.rawList = new java.util.ArrayList<java.lang.Object>();
this.rawList.addAll(rawList);
diff --git a/test/transform/resource/after-ecj/BuilderSingularMaps.java b/test/transform/resource/after-ecj/BuilderSingularMaps.java
index 977ee527..d53e7022 100644
--- a/test/transform/resource/after-ecj/BuilderSingularMaps.java
+++ b/test/transform/resource/after-ecj/BuilderSingularMaps.java
@@ -25,6 +25,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularMaps.BuilderSingularMapsBuilder<K, V> women(final java.util.Map<? extends K, ? extends V> women) {
+ if ((women == null))
+ throw new java.lang.NullPointerException("women cannot be null");
if ((this.women$key == null))
{
this.women$key = new java.util.ArrayList<K>();
@@ -56,6 +58,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularMaps.BuilderSingularMapsBuilder<K, V> men(final java.util.Map<? extends K, ? extends Number> men) {
+ if ((men == null))
+ throw new java.lang.NullPointerException("men cannot be null");
if ((this.men$key == null))
{
this.men$key = new java.util.ArrayList<K>();
@@ -87,6 +91,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularMaps.BuilderSingularMapsBuilder<K, V> rawMap(final java.util.Map<?, ?> rawMap) {
+ if ((rawMap == null))
+ throw new java.lang.NullPointerException("rawMap cannot be null");
if ((this.rawMap$key == null))
{
this.rawMap$key = new java.util.ArrayList<java.lang.Object>();
@@ -118,6 +124,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularMaps.BuilderSingularMapsBuilder<K, V> stringMap(final java.util.Map<? extends String, ? extends V> stringMap) {
+ if ((stringMap == null))
+ throw new java.lang.NullPointerException("stringMap cannot be null");
if ((this.stringMap$key == null))
{
this.stringMap$key = new java.util.ArrayList<String>();
diff --git a/test/transform/resource/after-ecj/BuilderSingularMapsWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularMapsWithSetterPrefix.java
index 0832fdc0..0bddd22c 100644
--- a/test/transform/resource/after-ecj/BuilderSingularMapsWithSetterPrefix.java
+++ b/test/transform/resource/after-ecj/BuilderSingularMapsWithSetterPrefix.java
@@ -25,16 +25,19 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefix.BuilderSingularMapsWithSetterPrefixBuilder<K, V> withWomen(final java.util.Map<? extends K, ? extends V> women) {
- if ((this.women$key == null))
+ if ((women != null))
{
- this.women$key = new java.util.ArrayList<K>();
- this.women$value = new java.util.ArrayList<V>();
+ if ((this.women$key == null))
+ {
+ this.women$key = new java.util.ArrayList<K>();
+ this.women$value = new java.util.ArrayList<V>();
+ }
+ for (java.util.Map.Entry<? extends K, ? extends V> $lombokEntry : women.entrySet())
+ {
+ this.women$key.add($lombokEntry.getKey());
+ this.women$value.add($lombokEntry.getValue());
+ }
}
- for (java.util.Map.Entry<? extends K, ? extends V> $lombokEntry : women.entrySet())
- {
- this.women$key.add($lombokEntry.getKey());
- this.women$value.add($lombokEntry.getValue());
- }
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefix.BuilderSingularMapsWithSetterPrefixBuilder<K, V> clearWomen() {
@@ -56,16 +59,19 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefix.BuilderSingularMapsWithSetterPrefixBuilder<K, V> withMen(final java.util.Map<? extends K, ? extends Number> men) {
- if ((this.men$key == null))
+ if ((men != null))
{
- this.men$key = new java.util.ArrayList<K>();
- this.men$value = new java.util.ArrayList<Number>();
+ if ((this.men$key == null))
+ {
+ this.men$key = new java.util.ArrayList<K>();
+ this.men$value = new java.util.ArrayList<Number>();
+ }
+ for (java.util.Map.Entry<? extends K, ? extends Number> $lombokEntry : men.entrySet())
+ {
+ this.men$key.add($lombokEntry.getKey());
+ this.men$value.add($lombokEntry.getValue());
+ }
}
- for (java.util.Map.Entry<? extends K, ? extends Number> $lombokEntry : men.entrySet())
- {
- this.men$key.add($lombokEntry.getKey());
- this.men$value.add($lombokEntry.getValue());
- }
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefix.BuilderSingularMapsWithSetterPrefixBuilder<K, V> clearMen() {
@@ -87,16 +93,19 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefix.BuilderSingularMapsWithSetterPrefixBuilder<K, V> withRawMap(final java.util.Map<?, ?> rawMap) {
- if ((this.rawMap$key == null))
+ if ((rawMap != null))
{
- this.rawMap$key = new java.util.ArrayList<java.lang.Object>();
- this.rawMap$value = new java.util.ArrayList<java.lang.Object>();
+ if ((this.rawMap$key == null))
+ {
+ this.rawMap$key = new java.util.ArrayList<java.lang.Object>();
+ this.rawMap$value = new java.util.ArrayList<java.lang.Object>();
+ }
+ for (java.util.Map.Entry<?, ?> $lombokEntry : rawMap.entrySet())
+ {
+ this.rawMap$key.add($lombokEntry.getKey());
+ this.rawMap$value.add($lombokEntry.getValue());
+ }
}
- for (java.util.Map.Entry<?, ?> $lombokEntry : rawMap.entrySet())
- {
- this.rawMap$key.add($lombokEntry.getKey());
- this.rawMap$value.add($lombokEntry.getValue());
- }
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefix.BuilderSingularMapsWithSetterPrefixBuilder<K, V> clearRawMap() {
@@ -118,16 +127,19 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefix.BuilderSingularMapsWithSetterPrefixBuilder<K, V> withStringMap(final java.util.Map<? extends String, ? extends V> stringMap) {
- if ((this.stringMap$key == null))
+ if ((stringMap != null))
{
- this.stringMap$key = new java.util.ArrayList<String>();
- this.stringMap$value = new java.util.ArrayList<V>();
+ if ((this.stringMap$key == null))
+ {
+ this.stringMap$key = new java.util.ArrayList<String>();
+ this.stringMap$value = new java.util.ArrayList<V>();
+ }
+ for (java.util.Map.Entry<? extends String, ? extends V> $lombokEntry : stringMap.entrySet())
+ {
+ this.stringMap$key.add($lombokEntry.getKey());
+ this.stringMap$value.add($lombokEntry.getValue());
+ }
}
- for (java.util.Map.Entry<? extends String, ? extends V> $lombokEntry : stringMap.entrySet())
- {
- this.stringMap$key.add($lombokEntry.getKey());
- this.stringMap$value.add($lombokEntry.getValue());
- }
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularMapsWithSetterPrefix.BuilderSingularMapsWithSetterPrefixBuilder<K, V> clearStringMap() {
@@ -206,4 +218,4 @@ import lombok.Singular;
public static @java.lang.SuppressWarnings("all") <K, V>BuilderSingularMapsWithSetterPrefix.BuilderSingularMapsWithSetterPrefixBuilder<K, V> builder() {
return new BuilderSingularMapsWithSetterPrefix.BuilderSingularMapsWithSetterPrefixBuilder<K, V>();
}
-}
+} \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/BuilderSingularNoAuto.java b/test/transform/resource/after-ecj/BuilderSingularNoAuto.java
index c1ac51eb..47b413b3 100644
--- a/test/transform/resource/after-ecj/BuilderSingularNoAuto.java
+++ b/test/transform/resource/after-ecj/BuilderSingularNoAuto.java
@@ -15,6 +15,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularNoAuto.BuilderSingularNoAutoBuilder things(final java.util.Collection<? extends String> things) {
+ if ((things == null))
+ throw new java.lang.NullPointerException("things cannot be null");
if ((this.things == null))
this.things = new java.util.ArrayList<String>();
this.things.addAll(things);
@@ -32,6 +34,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularNoAuto.BuilderSingularNoAutoBuilder widgets(final java.util.Collection<? extends String> widgets) {
+ if ((widgets == null))
+ throw new java.lang.NullPointerException("widgets cannot be null");
if ((this.widgets == null))
this.widgets = new java.util.ArrayList<String>();
this.widgets.addAll(widgets);
@@ -49,6 +53,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularNoAuto.BuilderSingularNoAutoBuilder items(final java.util.Collection<? extends String> items) {
+ if ((items == null))
+ throw new java.lang.NullPointerException("items cannot be null");
if ((this.items == null))
this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
diff --git a/test/transform/resource/after-ecj/BuilderSingularNoAutoWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularNoAutoWithSetterPrefix.java
index e869e871..85cfda71 100644
--- a/test/transform/resource/after-ecj/BuilderSingularNoAutoWithSetterPrefix.java
+++ b/test/transform/resource/after-ecj/BuilderSingularNoAutoWithSetterPrefix.java
@@ -15,6 +15,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoWithSetterPrefix.BuilderSingularNoAutoWithSetterPrefixBuilder withThings(final java.util.Collection<? extends String> things) {
+ if ((things == null))
+ throw new java.lang.NullPointerException("things cannot be null");
if ((this.things == null))
this.things = new java.util.ArrayList<String>();
this.things.addAll(things);
@@ -32,6 +34,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoWithSetterPrefix.BuilderSingularNoAutoWithSetterPrefixBuilder withWidgets(final java.util.Collection<? extends String> widgets) {
+ if ((widgets == null))
+ throw new java.lang.NullPointerException("widgets cannot be null");
if ((this.widgets == null))
this.widgets = new java.util.ArrayList<String>();
this.widgets.addAll(widgets);
@@ -49,6 +53,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularNoAutoWithSetterPrefix.BuilderSingularNoAutoWithSetterPrefixBuilder withItems(final java.util.Collection<? extends String> items) {
+ if ((items == null))
+ throw new java.lang.NullPointerException("items cannot be null");
if ((this.items == null))
this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
diff --git a/test/transform/resource/after-ecj/BuilderSingularNullBehavior1.java b/test/transform/resource/after-ecj/BuilderSingularNullBehavior1.java
new file mode 100644
index 00000000..7ef52eb8
--- /dev/null
+++ b/test/transform/resource/after-ecj/BuilderSingularNullBehavior1.java
@@ -0,0 +1,154 @@
+import java.util.List;
+import java.util.Collection;
+import lombok.Singular;
+import lombok.Singular.NullCollectionBehavior;
+@lombok.Builder class BuilderSingularNullBehavior1 {
+ public static @java.lang.SuppressWarnings("all") class BuilderSingularNullBehavior1Builder {
+ private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> names;
+ private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> locations;
+ private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> whatevers;
+ private @java.lang.SuppressWarnings("all") java.util.ArrayList<String> doohickeys;
+ @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior1Builder() {
+ super();
+ }
+ public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder name(final String name) {
+ if ((this.names == null))
+ this.names = new java.util.ArrayList<String>();
+ this.names.add(name);
+ return this;
+ }
+ public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder names(final java.util.Collection<? extends String> names) {
+ if ((names == null))
+ throw new java.lang.NullPointerException("names cannot be null");
+ if ((this.names == null))
+ this.names = new java.util.ArrayList<String>();
+ this.names.addAll(names);
+ return this;
+ }
+ public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder clearNames() {
+ if ((this.names != null))
+ this.names.clear();
+ return this;
+ }
+ public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder location(final String location) {
+ if ((this.locations == null))
+ this.locations = new java.util.ArrayList<String>();
+ this.locations.add(location);
+ return this;
+ }
+ public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder locations(final java.util.Collection<? extends String> locations) {
+ java.util.Objects.requireNonNull(locations, "locations cannot be null");
+ if ((this.locations == null))
+ this.locations = new java.util.ArrayList<String>();
+ this.locations.addAll(locations);
+ return this;
+ }
+ public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder clearLocations() {
+ if ((this.locations != null))
+ this.locations.clear();
+ return this;
+ }
+ public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder whatever(final String whatever) {
+ if ((this.whatevers == null))
+ this.whatevers = new java.util.ArrayList<String>();
+ this.whatevers.add(whatever);
+ return this;
+ }
+ public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder whatevers(final java.util.Collection<? extends String> whatevers) {
+ com.google.common.base.Preconditions.checkNotNull(whatevers, "whatevers cannot be null");
+ if ((this.whatevers == null))
+ this.whatevers = new java.util.ArrayList<String>();
+ this.whatevers.addAll(whatevers);
+ return this;
+ }
+ public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder clearWhatevers() {
+ if ((this.whatevers != null))
+ this.whatevers.clear();
+ return this;
+ }
+ public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder doohickey(final String doohickey) {
+ if ((this.doohickeys == null))
+ this.doohickeys = new java.util.ArrayList<String>();
+ this.doohickeys.add(doohickey);
+ return this;
+ }
+ public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder doohickeys(final java.util.Collection<? extends String> doohickeys) {
+ if ((doohickeys != null))
+ {
+ if ((this.doohickeys == null))
+ this.doohickeys = new java.util.ArrayList<String>();
+ this.doohickeys.addAll(doohickeys);
+ }
+ return this;
+ }
+ public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder clearDoohickeys() {
+ if ((this.doohickeys != null))
+ this.doohickeys.clear();
+ return this;
+ }
+ public @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior1 build() {
+ java.util.List<String> names;
+ switch (((this.names == null) ? 0 : this.names.size())) {
+ case 0 :
+ names = java.util.Collections.emptyList();
+ break;
+ case 1 :
+ names = java.util.Collections.singletonList(this.names.get(0));
+ break;
+ default :
+ names = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.names));
+ }
+ java.util.List<String> locations;
+ switch (((this.locations == null) ? 0 : this.locations.size())) {
+ case 0 :
+ locations = java.util.Collections.emptyList();
+ break;
+ case 1 :
+ locations = java.util.Collections.singletonList(this.locations.get(0));
+ break;
+ default :
+ locations = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.locations));
+ }
+ java.util.List<String> whatevers;
+ switch (((this.whatevers == null) ? 0 : this.whatevers.size())) {
+ case 0 :
+ whatevers = java.util.Collections.emptyList();
+ break;
+ case 1 :
+ whatevers = java.util.Collections.singletonList(this.whatevers.get(0));
+ break;
+ default :
+ whatevers = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.whatevers));
+ }
+ java.util.List<String> doohickeys;
+ switch (((this.doohickeys == null) ? 0 : this.doohickeys.size())) {
+ case 0 :
+ doohickeys = java.util.Collections.emptyList();
+ break;
+ case 1 :
+ doohickeys = java.util.Collections.singletonList(this.doohickeys.get(0));
+ break;
+ default :
+ doohickeys = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.doohickeys));
+ }
+ return new BuilderSingularNullBehavior1(names, locations, whatevers, doohickeys);
+ }
+ public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
+ return (((((((("BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder(names=" + this.names) + ", locations=") + this.locations) + ", whatevers=") + this.whatevers) + ", doohickeys=") + this.doohickeys) + ")");
+ }
+ }
+ private @Singular List<String> names;
+ private @Singular(nullBehavior = Singular.NullCollectionBehavior.JDK) List<String> locations;
+ private @Singular(nullBehavior = NullCollectionBehavior.GUAVA) List<String> whatevers;
+ private @Singular(nullBehavior = lombok.Singular.NullCollectionBehavior.IGNORE) List<String> doohickeys;
+ @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior1(final List<String> names, final List<String> locations, final List<String> whatevers, final List<String> doohickeys) {
+ super();
+ this.names = names;
+ this.locations = locations;
+ this.whatevers = whatevers;
+ this.doohickeys = doohickeys;
+ }
+ public static @java.lang.SuppressWarnings("all") BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder builder() {
+ return new BuilderSingularNullBehavior1.BuilderSingularNullBehavior1Builder();
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java b/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java
index 9e7028d6..867bf7fa 100644
--- a/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java
+++ b/test/transform/resource/after-ecj/BuilderSingularRedirectToGuava.java
@@ -17,6 +17,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuava.BuilderSingularRedirectToGuavaBuilder dangerMice(final java.lang.Iterable<? extends String> dangerMice) {
+ if ((dangerMice == null))
+ throw new java.lang.NullPointerException("dangerMice cannot be null");
if ((this.dangerMice == null))
this.dangerMice = com.google.common.collect.ImmutableSet.builder();
this.dangerMice.addAll(dangerMice);
@@ -33,6 +35,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuava.BuilderSingularRedirectToGuavaBuilder things(final java.util.Map<? extends Integer, ? extends Number> things) {
+ if ((things == null))
+ throw new java.lang.NullPointerException("things cannot be null");
if ((this.things == null))
this.things = com.google.common.collect.ImmutableSortedMap.naturalOrder();
this.things.putAll(things);
@@ -49,6 +53,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularRedirectToGuava.BuilderSingularRedirectToGuavaBuilder doohickeys(final java.lang.Iterable<? extends Class<?>> doohickeys) {
+ if ((doohickeys == null))
+ throw new java.lang.NullPointerException("doohickeys cannot be null");
if ((this.doohickeys == null))
this.doohickeys = com.google.common.collect.ImmutableList.builder();
this.doohickeys.addAll(doohickeys);
diff --git a/test/transform/resource/after-ecj/BuilderSingularSets.java b/test/transform/resource/after-ecj/BuilderSingularSets.java
index b6ef04cb..6cfa5203 100644
--- a/test/transform/resource/after-ecj/BuilderSingularSets.java
+++ b/test/transform/resource/after-ecj/BuilderSingularSets.java
@@ -17,6 +17,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularSets.BuilderSingularSetsBuilder<T> dangerMice(final java.util.Collection<? extends T> dangerMice) {
+ if ((dangerMice == null))
+ throw new java.lang.NullPointerException("dangerMice cannot be null");
if ((this.dangerMice == null))
this.dangerMice = new java.util.ArrayList<T>();
this.dangerMice.addAll(dangerMice);
@@ -34,6 +36,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularSets.BuilderSingularSetsBuilder<T> octopodes(final java.util.Collection<? extends Number> octopodes) {
+ if ((octopodes == null))
+ throw new java.lang.NullPointerException("octopodes cannot be null");
if ((this.octopodes == null))
this.octopodes = new java.util.ArrayList<Number>();
this.octopodes.addAll(octopodes);
@@ -51,6 +55,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularSets.BuilderSingularSetsBuilder<T> rawSet(final java.util.Collection<?> rawSet) {
+ if ((rawSet == null))
+ throw new java.lang.NullPointerException("rawSet cannot be null");
if ((this.rawSet == null))
this.rawSet = new java.util.ArrayList<java.lang.Object>();
this.rawSet.addAll(rawSet);
@@ -68,6 +74,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularSets.BuilderSingularSetsBuilder<T> stringSet(final java.util.Collection<? extends String> stringSet) {
+ if ((stringSet == null))
+ throw new java.lang.NullPointerException("stringSet cannot be null");
if ((this.stringSet == null))
this.stringSet = new java.util.ArrayList<String>();
this.stringSet.addAll(stringSet);
diff --git a/test/transform/resource/after-ecj/BuilderSingularSetsWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularSetsWithSetterPrefix.java
index b857b586..cdc0390c 100644
--- a/test/transform/resource/after-ecj/BuilderSingularSetsWithSetterPrefix.java
+++ b/test/transform/resource/after-ecj/BuilderSingularSetsWithSetterPrefix.java
@@ -17,6 +17,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefix.BuilderSingularSetsWithSetterPrefixBuilder<T> withDangerMice(final java.util.Collection<? extends T> dangerMice) {
+ if ((dangerMice == null))
+ throw new java.lang.NullPointerException("dangerMice cannot be null");
if ((this.dangerMice == null))
this.dangerMice = new java.util.ArrayList<T>();
this.dangerMice.addAll(dangerMice);
@@ -34,6 +36,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefix.BuilderSingularSetsWithSetterPrefixBuilder<T> withOctopodes(final java.util.Collection<? extends Number> octopodes) {
+ if ((octopodes == null))
+ throw new java.lang.NullPointerException("octopodes cannot be null");
if ((this.octopodes == null))
this.octopodes = new java.util.ArrayList<Number>();
this.octopodes.addAll(octopodes);
@@ -51,6 +55,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefix.BuilderSingularSetsWithSetterPrefixBuilder<T> withRawSet(final java.util.Collection<?> rawSet) {
+ if ((rawSet == null))
+ throw new java.lang.NullPointerException("rawSet cannot be null");
if ((this.rawSet == null))
this.rawSet = new java.util.ArrayList<java.lang.Object>();
this.rawSet.addAll(rawSet);
@@ -68,6 +74,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularSetsWithSetterPrefix.BuilderSingularSetsWithSetterPrefixBuilder<T> withStringSet(final java.util.Collection<? extends String> stringSet) {
+ if ((stringSet == null))
+ throw new java.lang.NullPointerException("stringSet cannot be null");
if ((this.stringSet == null))
this.stringSet = new java.util.ArrayList<String>();
this.stringSet.addAll(stringSet);
diff --git a/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNull.java b/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNull.java
index 99a277e3..c01b5b8f 100644
--- a/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNull.java
+++ b/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNull.java
@@ -12,6 +12,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNull.BuilderSingularToBuilderWithNullBuilder elems(final java.util.Collection<? extends String> elems) {
+ if ((elems == null))
+ throw new java.lang.NullPointerException("elems cannot be null");
if ((this.elems == null))
this.elems = new java.util.ArrayList<String>();
this.elems.addAll(elems);
diff --git a/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java
index a0223598..092f0b55 100644
--- a/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java
+++ b/test/transform/resource/after-ecj/BuilderSingularToBuilderWithNullWithSetterPrefix.java
@@ -12,6 +12,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularToBuilderWithNullWithSetterPrefix.BuilderSingularToBuilderWithNullWithSetterPrefixBuilder withElems(final java.util.Collection<? extends String> elems) {
+ if ((elems == null))
+ throw new java.lang.NullPointerException("elems cannot be null");
if ((this.elems == null))
this.elems = new java.util.ArrayList<String>();
this.elems.addAll(elems);
diff --git a/test/transform/resource/after-ecj/BuilderSingularWildcardListsWithToBuilder.java b/test/transform/resource/after-ecj/BuilderSingularWildcardListsWithToBuilder.java
index e9c61eb6..8a00644d 100644
--- a/test/transform/resource/after-ecj/BuilderSingularWildcardListsWithToBuilder.java
+++ b/test/transform/resource/after-ecj/BuilderSingularWildcardListsWithToBuilder.java
@@ -15,6 +15,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilder.BuilderSingularWildcardListsWithToBuilderBuilder objects(final java.util.Collection<?> objects) {
+ if ((objects == null))
+ throw new java.lang.NullPointerException("objects cannot be null");
if ((this.objects == null))
this.objects = new java.util.ArrayList<java.lang.Object>();
this.objects.addAll(objects);
@@ -32,6 +34,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularWildcardListsWithToBuilder.BuilderSingularWildcardListsWithToBuilderBuilder numbers(final java.util.Collection<? extends Number> numbers) {
+ if ((numbers == null))
+ throw new java.lang.NullPointerException("numbers cannot be null");
if ((this.numbers == null))
this.numbers = new java.util.ArrayList<Number>();
this.numbers.addAll(numbers);
diff --git a/test/transform/resource/after-ecj/BuilderSingularWithPrefixes.java b/test/transform/resource/after-ecj/BuilderSingularWithPrefixes.java
index 5f8a8ee0..b4fa5cbe 100644
--- a/test/transform/resource/after-ecj/BuilderSingularWithPrefixes.java
+++ b/test/transform/resource/after-ecj/BuilderSingularWithPrefixes.java
@@ -12,6 +12,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixes.BuilderSingularWithPrefixesBuilder elems(final java.util.Collection<? extends String> elems) {
+ if ((elems == null))
+ throw new java.lang.NullPointerException("elems cannot be null");
if ((this.elems == null))
this.elems = new java.util.ArrayList<String>();
this.elems.addAll(elems);
diff --git a/test/transform/resource/after-ecj/BuilderSingularWithPrefixesWithSetterPrefix.java b/test/transform/resource/after-ecj/BuilderSingularWithPrefixesWithSetterPrefix.java
index 377a9c27..f10482d5 100644
--- a/test/transform/resource/after-ecj/BuilderSingularWithPrefixesWithSetterPrefix.java
+++ b/test/transform/resource/after-ecj/BuilderSingularWithPrefixesWithSetterPrefix.java
@@ -12,6 +12,8 @@ import lombok.Singular;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderSingularWithPrefixesWithSetterPrefix.BuilderSingularWithPrefixesWithSetterPrefixBuilder withElems(final java.util.Collection<? extends String> elems) {
+ if ((elems == null))
+ throw new java.lang.NullPointerException("elems cannot be null");
if ((this.elems == null))
this.elems = new java.util.ArrayList<String>();
this.elems.addAll(elems);
diff --git a/test/transform/resource/after-ecj/BuilderWithDeprecated.java b/test/transform/resource/after-ecj/BuilderWithDeprecated.java
index 24d35df1..9dcddc49 100644
--- a/test/transform/resource/after-ecj/BuilderWithDeprecated.java
+++ b/test/transform/resource/after-ecj/BuilderWithDeprecated.java
@@ -25,6 +25,8 @@ public @Builder class BuilderWithDeprecated {
return this;
}
public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecated.BuilderWithDeprecatedBuilder strings(final java.util.Collection<? extends String> strings) {
+ if ((strings == null))
+ throw new java.lang.NullPointerException("strings cannot be null");
if ((this.strings == null))
this.strings = new java.util.ArrayList<String>();
this.strings.addAll(strings);
@@ -42,6 +44,8 @@ public @Builder class BuilderWithDeprecated {
return this;
}
public @java.lang.Deprecated @java.lang.SuppressWarnings("all") BuilderWithDeprecated.BuilderWithDeprecatedBuilder numbers(final java.lang.Iterable<? extends Integer> numbers) {
+ if ((numbers == null))
+ throw new java.lang.NullPointerException("numbers cannot be null");
if ((this.numbers == null))
this.numbers = com.google.common.collect.ImmutableList.builder();
this.numbers.addAll(numbers);
diff --git a/test/transform/resource/after-ecj/BuilderWithToBuilder.java b/test/transform/resource/after-ecj/BuilderWithToBuilder.java
index 6d935736..ec72bdb8 100644
--- a/test/transform/resource/after-ecj/BuilderWithToBuilder.java
+++ b/test/transform/resource/after-ecj/BuilderWithToBuilder.java
@@ -28,6 +28,8 @@ import lombok.Builder;
return this;
}
public @java.lang.SuppressWarnings("all") BuilderWithToBuilder.BuilderWithToBuilderBuilder<T> bars(final java.util.Collection<? extends T> bars) {
+ if ((bars == null))
+ throw new java.lang.NullPointerException("bars cannot be null");
if ((this.bars == null))
this.bars = new java.util.ArrayList<T>();
this.bars.addAll(bars);
diff --git a/test/transform/resource/after-ecj/CheckerFrameworkBuilder.java b/test/transform/resource/after-ecj/CheckerFrameworkBuilder.java
index d2163ef5..d9201e39 100644
--- a/test/transform/resource/after-ecj/CheckerFrameworkBuilder.java
+++ b/test/transform/resource/after-ecj/CheckerFrameworkBuilder.java
@@ -31,6 +31,8 @@ import lombok.Singular;
return this;
}
public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") CheckerFrameworkBuilder.CheckerFrameworkBuilderBuilder names(final java.util.Collection<? extends String> names) {
+ if ((names == null))
+ throw new java.lang.NullPointerException("names cannot be null");
if ((this.names == null))
this.names = new java.util.ArrayList<String>();
this.names.addAll(names);
diff --git a/test/transform/resource/after-ecj/CheckerFrameworkSuperBuilder.java b/test/transform/resource/after-ecj/CheckerFrameworkSuperBuilder.java
index 1849419e..94ec0a0c 100644
--- a/test/transform/resource/after-ecj/CheckerFrameworkSuperBuilder.java
+++ b/test/transform/resource/after-ecj/CheckerFrameworkSuperBuilder.java
@@ -32,6 +32,8 @@ class CheckerFrameworkSuperBuilder {
return self();
}
public @org.checkerframework.checker.builder.qual.ReturnsReceiver @java.lang.SuppressWarnings("all") B names(final java.util.Collection<? extends String> names) {
+ if ((names == null))
+ throw new java.lang.NullPointerException("names cannot be null");
if ((this.names == null))
this.names = new java.util.ArrayList<String>();
this.names.addAll(names);
diff --git a/test/transform/resource/after-ecj/I2335_BuilderMultipleObtainVia.java b/test/transform/resource/after-ecj/I2335_BuilderMultipleObtainVia.java
index 7d8b8953..9c5eb6ae 100644
--- a/test/transform/resource/after-ecj/I2335_BuilderMultipleObtainVia.java
+++ b/test/transform/resource/after-ecj/I2335_BuilderMultipleObtainVia.java
@@ -44,8 +44,8 @@ public @Builder class I2335_BuilderMultipleObtainVia {
return new I2335_BuilderMultipleObtainVia.I2335_BuilderMultipleObtainViaBuilder();
}
public @java.lang.SuppressWarnings("all") I2335_BuilderMultipleObtainVia.I2335_BuilderMultipleObtainViaBuilder toBuilder() {
- String theString = this.getTheString();
- Long theLong = this.getTheLong();
+ final String theString = this.getTheString();
+ final Long theLong = this.getTheLong();
return new I2335_BuilderMultipleObtainVia.I2335_BuilderMultipleObtainViaBuilder().theString(theString).theLong(theLong);
}
}
diff --git a/test/transform/resource/after-ecj/SuperBuilderBasic.java b/test/transform/resource/after-ecj/SuperBuilderBasic.java
index dad0ad8f..9e686f0f 100644
--- a/test/transform/resource/after-ecj/SuperBuilderBasic.java
+++ b/test/transform/resource/after-ecj/SuperBuilderBasic.java
@@ -20,6 +20,8 @@ public class SuperBuilderBasic {
return self();
}
public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
+ if ((items == null))
+ throw new java.lang.NullPointerException("items cannot be null");
if ((this.items == null))
this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
diff --git a/test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java b/test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java
index a9f111d0..e027c9d2 100644
--- a/test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java
+++ b/test/transform/resource/after-ecj/SuperBuilderBasicToBuilder.java
@@ -46,6 +46,8 @@ public class SuperBuilderBasicToBuilder {
return self();
}
public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
+ if ((items == null))
+ throw new java.lang.NullPointerException("items cannot be null");
if ((this.items == null))
this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
diff --git a/test/transform/resource/after-ecj/SuperBuilderSingularAnnotatedTypes.java b/test/transform/resource/after-ecj/SuperBuilderSingularAnnotatedTypes.java
index 809ca50c..834d2180 100644
--- a/test/transform/resource/after-ecj/SuperBuilderSingularAnnotatedTypes.java
+++ b/test/transform/resource/after-ecj/SuperBuilderSingularAnnotatedTypes.java
@@ -27,6 +27,8 @@ import lombok.Singular;
return self();
}
public @java.lang.SuppressWarnings("all") B foos(final java.util.Collection<? extends @MyAnnotation @NonNull String> foos) {
+ if ((foos == null))
+ throw new java.lang.NullPointerException("foos cannot be null");
if ((this.foos == null))
this.foos = new java.util.ArrayList<@MyAnnotation @NonNull String>();
this.foos.addAll(foos);
@@ -56,6 +58,8 @@ import lombok.Singular;
return self();
}
public @java.lang.SuppressWarnings("all") B bars(final java.util.Map<? extends @MyAnnotation @NonNull String, ? extends @MyAnnotation @NonNull Integer> bars) {
+ if ((bars == null))
+ throw new java.lang.NullPointerException("bars cannot be null");
if ((this.bars$key == null))
{
this.bars$key = new java.util.ArrayList<@MyAnnotation @NonNull String>();
diff --git a/test/transform/resource/after-ecj/SuperBuilderWithCustomBuilderMethod.java b/test/transform/resource/after-ecj/SuperBuilderWithCustomBuilderMethod.java
index 751e281b..6605ae1d 100644
--- a/test/transform/resource/after-ecj/SuperBuilderWithCustomBuilderMethod.java
+++ b/test/transform/resource/after-ecj/SuperBuilderWithCustomBuilderMethod.java
@@ -20,6 +20,8 @@ public class SuperBuilderWithCustomBuilderMethod {
return self();
}
public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
+ if ((items == null))
+ throw new java.lang.NullPointerException("items cannot be null");
if ((this.items == null))
this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
diff --git a/test/transform/resource/after-ecj/SuperBuilderWithGenerics.java b/test/transform/resource/after-ecj/SuperBuilderWithGenerics.java
index bbf07d75..89ab8821 100644
--- a/test/transform/resource/after-ecj/SuperBuilderWithGenerics.java
+++ b/test/transform/resource/after-ecj/SuperBuilderWithGenerics.java
@@ -20,6 +20,8 @@ public class SuperBuilderWithGenerics {
return self();
}
public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
+ if ((items == null))
+ throw new java.lang.NullPointerException("items cannot be null");
if ((this.items == null))
this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
diff --git a/test/transform/resource/after-ecj/SuperBuilderWithGenerics2.java b/test/transform/resource/after-ecj/SuperBuilderWithGenerics2.java
index b3ca18ec..2037f7b0 100644
--- a/test/transform/resource/after-ecj/SuperBuilderWithGenerics2.java
+++ b/test/transform/resource/after-ecj/SuperBuilderWithGenerics2.java
@@ -20,6 +20,8 @@ public class SuperBuilderWithGenerics2 {
return self();
}
public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
+ if ((items == null))
+ throw new java.lang.NullPointerException("items cannot be null");
if ((this.items == null))
this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
diff --git a/test/transform/resource/after-ecj/SuperBuilderWithGenericsAndToBuilder.java b/test/transform/resource/after-ecj/SuperBuilderWithGenericsAndToBuilder.java
index 457104ef..8b26e439 100644
--- a/test/transform/resource/after-ecj/SuperBuilderWithGenericsAndToBuilder.java
+++ b/test/transform/resource/after-ecj/SuperBuilderWithGenericsAndToBuilder.java
@@ -33,6 +33,8 @@ public class SuperBuilderWithGenericsAndToBuilder {
return self();
}
public @java.lang.SuppressWarnings("all") B items(final java.util.Map<? extends Integer, ? extends String> items) {
+ if ((items == null))
+ throw new java.lang.NullPointerException("items cannot be null");
if ((this.items$key == null))
{
this.items$key = new java.util.ArrayList<Integer>();
diff --git a/test/transform/resource/after-ecj/SuperBuilderWithPrefixes.java b/test/transform/resource/after-ecj/SuperBuilderWithPrefixes.java
index 51abbca4..e3b5baeb 100644
--- a/test/transform/resource/after-ecj/SuperBuilderWithPrefixes.java
+++ b/test/transform/resource/after-ecj/SuperBuilderWithPrefixes.java
@@ -23,6 +23,8 @@
return self();
}
public @java.lang.SuppressWarnings("all") B items(final java.util.Collection<? extends String> items) {
+ if ((items == null))
+ throw new java.lang.NullPointerException("items cannot be null");
if ((this.items == null))
this.items = new java.util.ArrayList<String>();
this.items.addAll(items);
diff --git a/test/transform/resource/before/BuilderSingularMapsWithSetterPrefix.java b/test/transform/resource/before/BuilderSingularMapsWithSetterPrefix.java
index 728ad59a..89beb401 100644
--- a/test/transform/resource/before/BuilderSingularMapsWithSetterPrefix.java
+++ b/test/transform/resource/before/BuilderSingularMapsWithSetterPrefix.java
@@ -1,6 +1,7 @@
//FORMAT: javaLangAsFQN = skip
//FORMAT: generated = skip
//FORMAT: finalParams = skip
+//CONF: lombok.singular.nullCollections = ignore
import java.util.Map;
import java.util.SortedMap;
diff --git a/test/transform/resource/before/BuilderSingularNullBehavior1.java b/test/transform/resource/before/BuilderSingularNullBehavior1.java
new file mode 100644
index 00000000..019b6473
--- /dev/null
+++ b/test/transform/resource/before/BuilderSingularNullBehavior1.java
@@ -0,0 +1,13 @@
+import java.util.List;
+import java.util.Collection;
+
+import lombok.Singular;
+import lombok.Singular.NullCollectionBehavior;
+
+@lombok.Builder
+class BuilderSingularNullBehavior1 {
+ @Singular private List<String> names;
+ @Singular(nullBehavior = Singular.NullCollectionBehavior.JDK) private List<String> locations;
+ @Singular(nullBehavior = NullCollectionBehavior.GUAVA) private List<String> whatevers;
+ @Singular(nullBehavior = lombok.Singular.NullCollectionBehavior.IGNORE) private List<String> doohickeys;
+}