use of com.google.devtools.j2objc.ast.ArrayCreation in project j2objc by google.
the class VarargsRewriter method endVisit.
@Override
public void endVisit(ArrayInitializer node) {
if (!(node.getParent() instanceof ArrayCreation)) {
ArrayCreation newArray = new ArrayCreation(node.getTypeMirror(), typeUtil);
node.replaceWith(newArray);
newArray.setInitializer(node);
}
}
use of com.google.devtools.j2objc.ast.ArrayCreation in project j2objc by google.
the class TranslationUtil method createObjectArray.
public Expression createObjectArray(List<Expression> expressions, ArrayType arrayType) {
if (expressions.isEmpty()) {
return new ArrayCreation(arrayType, typeUtil, 0);
}
ArrayInitializer initializer = new ArrayInitializer(arrayType);
initializer.getExpressions().addAll(expressions);
return new ArrayCreation(initializer);
}
Aggregations