[superbuilder] toBuilder + singular + javac6 was broken

superbuilder generated the node `x.pluralName(plural == null ? Collections.emptyList() : plural)`.
java6 is not smart enough to infer the appropriate generics for the emptyList() call.
Fixed by always specifying the needed type explicitly: Collections.<String>emptyList();
This commit is contained in:
Reinier Zwitserloot committed 2021-03-13 04:53:44 +01:00
1 parent c1bf4ec3b6
commit e8cd744d3b
13 files changed
+49 -27

No files matched your search

@@ -19,7 +19,7 @@ public class SuperBuilderWithSetterPrefix {
b.withObtainViaField(instance.field1);
b.withObtainViaMethod(instance.method());
b.withObtainViaStaticMethod(SuperBuilderWithSetterPrefix.Parent.staticMethod(instance));
b.withItems(((instance.items == null) ? java.util.Collections.emptyList() : instance.items));
b.withItems(((instance.items == null) ? java.util.Collections.<String>emptyList() : instance.items));
}
protected abstract @java.lang.SuppressWarnings("all") B self();
public abstract @java.lang.SuppressWarnings("all") C build();