Replace for-int with for-each

This commit is contained in:
Emil Lundberg committed 2019-01-13 02:25:26 +01:00
1 parent 223a3fdb97
commit bbaa932c11
1 file changed
+2 -2
@@ -94,8 +94,8 @@ abstract class JavacGuavaSingularizer extends JavacSingularizer {
statements.append(createConstructBuilderVarIfNeeded(maker, data, builderType, source));
JCExpression thisDotFieldDotAdd = chainDots(builderType, "this", data.getPluralName().toString(), getAddMethodName());
ListBuffer<JCExpression> invokeAddExprBuilder = new ListBuffer<JCExpression>();
for (int i = 0; i < names.length; i++) {
invokeAddExprBuilder.append(maker.Ident(names[i]));
for (Name name : names) {
invokeAddExprBuilder.append(maker.Ident(name));
}
List<JCExpression> invokeAddExpr = invokeAddExprBuilder.toList();
JCExpression invokeAdd = maker.Apply(List.<JCExpression>nil(), thisDotFieldDotAdd, invokeAddExpr);