[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 SuperBuilderWithGenericsAndToBuilder {
@java.lang.SuppressWarnings("all")
private static <A> void $fillValuesFromInstanceIntoBuilder(final SuperBuilderWithGenericsAndToBuilder.Parent<A> instance, final SuperBuilderWithGenericsAndToBuilder.Parent.ParentBuilder<A, ?, ?> b) {
b.field1(instance.field1);
b.items(instance.items == null ? java.util.Collections.emptyMap() : instance.items);
b.items(instance.items == null ? java.util.Collections.<Integer, String>emptyMap() : instance.items);
}
@java.lang.SuppressWarnings("all")
protected abstract B self();