aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-ecj
diff options
context:
space:
mode:
Diffstat (limited to 'test/transform/resource/after-ecj')
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularLists.java14
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularNoAutosingularize.java12
2 files changed, 7 insertions, 19 deletions
diff --git a/test/transform/resource/after-ecj/BuilderSingularLists.java b/test/transform/resource/after-ecj/BuilderSingularLists.java
index c0a3ef9a..9e4bb894 100644
--- a/test/transform/resource/after-ecj/BuilderSingularLists.java
+++ b/test/transform/resource/after-ecj/BuilderSingularLists.java
@@ -56,11 +56,9 @@ import lombok.Singular;
children = java.util.Collections.singletonList(this.children.get(0));
break;
default :
- children = new java.util.ArrayList<T>(this.children.size());
- children.addAll(this.children);
- children = java.util.Collections.unmodifiableList(children);
+ children = java.util.Collections.unmodifiableList(new java.util.ArrayList<T>(this.children));
}
- java.util.List<Number> scarves;
+ java.util.Collection<Number> scarves;
switch (((this.scarves == null) ? 0 : this.scarves.size())) {
case 0 :
scarves = java.util.Collections.emptyList();
@@ -69,9 +67,7 @@ import lombok.Singular;
scarves = java.util.Collections.singletonList(this.scarves.get(0));
break;
default :
- scarves = new java.util.ArrayList<Number>(this.scarves.size());
- scarves.addAll(this.scarves);
- scarves = java.util.Collections.unmodifiableList(scarves);
+ scarves = java.util.Collections.unmodifiableList(new java.util.ArrayList<Number>(this.scarves));
}
java.util.List<java.lang.Object> rawList;
switch (((this.rawList == null) ? 0 : this.rawList.size())) {
@@ -82,9 +78,7 @@ import lombok.Singular;
rawList = java.util.Collections.singletonList(this.rawList.get(0));
break;
default :
- rawList = new java.util.ArrayList<java.lang.Object>(this.rawList.size());
- rawList.addAll(this.rawList);
- rawList = java.util.Collections.unmodifiableList(rawList);
+ rawList = java.util.Collections.unmodifiableList(new java.util.ArrayList<java.lang.Object>(this.rawList));
}
return new BuilderSingularLists<T>(children, scarves, rawList);
}
diff --git a/test/transform/resource/after-ecj/BuilderSingularNoAutosingularize.java b/test/transform/resource/after-ecj/BuilderSingularNoAutosingularize.java
index 53bed757..16febc2e 100644
--- a/test/transform/resource/after-ecj/BuilderSingularNoAutosingularize.java
+++ b/test/transform/resource/after-ecj/BuilderSingularNoAutosingularize.java
@@ -54,9 +54,7 @@ import lombok.Singular;
things = java.util.Collections.singletonList(this.things.get(0));
break;
default :
- things = new java.util.ArrayList<String>(this.things.size());
- things.addAll(this.things);
- things = java.util.Collections.unmodifiableList(things);
+ things = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.things));
}
java.util.List<String> widgets;
switch (((this.widgets == null) ? 0 : this.widgets.size())) {
@@ -67,9 +65,7 @@ import lombok.Singular;
widgets = java.util.Collections.singletonList(this.widgets.get(0));
break;
default :
- widgets = new java.util.ArrayList<String>(this.widgets.size());
- widgets.addAll(this.widgets);
- widgets = java.util.Collections.unmodifiableList(widgets);
+ widgets = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.widgets));
}
java.util.List<String> items;
switch (((this.items == null) ? 0 : this.items.size())) {
@@ -80,9 +76,7 @@ import lombok.Singular;
items = java.util.Collections.singletonList(this.items.get(0));
break;
default :
- items = new java.util.ArrayList<String>(this.items.size());
- items.addAll(this.items);
- items = java.util.Collections.unmodifiableList(items);
+ items = java.util.Collections.unmodifiableList(new java.util.ArrayList<String>(this.items));
}
return new BuilderSingularNoAutosingularize(things, widgets, items);
}