AlertCounter counter = new AlertCounter(alertSink, alertPolicy);
StringBuilder sb = new StringBuilder();
try {
codeGenerator.generateCode(sb, counter);
if (counter.getErrorCount() == 0) {
Writer writer = outputFileRef.openWriter(Charsets.US_ASCII);
try {
writer.write(sb.toString());