// If there are indices, create an integer array of those indices,
// and add it as an argument.
if (indices == 0) {
recordInvocation.arguments().add(ast.newNullLiteral());
} else {
ArrayCreation arrayCreation = ast.newArrayCreation();
ArrayType arrayType = ast.newArrayType(ast
.newPrimitiveType(PrimitiveType.INT));
ArrayInitializer initializer = ast.newArrayInitializer();
for (int i = 0; i < indices; i++) {
initializer.expressions().add(ast.newSimpleName("index" + i));
}
arrayCreation.setType(arrayType);
arrayCreation.setInitializer(initializer);
recordInvocation.arguments().add(arrayCreation);
}
// If there are indices, add them ("index0", "index1", ...) after the
// field.