List<JExpression> initializers = new ArrayList<JExpression>();
for (JEnumField field : type.enumList) {
JFieldRef fieldRef = new JFieldRef(program, null, null, field, type);
initializers.add(fieldRef);
}
JNewArray newExpr = JNewArray.createInitializers(program, null,
program.getTypeArray(type, 1), initializers);
currentMethodBody.getStatements().add(
new JReturnStatement(program, null, newExpr));
}