boolean foundError = false;
for (int i = 0; i < diagnostics.size(); i++) {
Diagnostic diagnostic = (Diagnostic) diagnostics.get(i);
// Add the level.
DiagnosticLevel level = diagnostic.getLevel();
if (level == DiagnosticLevel.ERROR) {
foundError = true;
}
buffer.append(level);