String fn = String.valueOf(result.compilationUnit.getFileName());
String msg = "Errors in '" + fn + "'";
TreeLogger branch = getLogger().branch(TreeLogger.ERROR, msg, null);
for (int i = 0; i < errors.length; i++) {
IProblem error = errors[i];
// Strip the initial code from each error.
//
msg = error.toString();
msg = msg.substring(msg.indexOf(' '));
if (error.getID() >= IProblem.InvalidUsageOfTypeParameters
&& error.getID() <= IProblem.InvalidUsageOfAnnotationDeclarations) {
// this error involves 5.0 compliance, use a custom message
msg = "GWT does not yet support the Java 5.0 language enhancements; only 1.4 compatible source may be used";
}
// Append 'Line #: msg' to the error message.
//
StringBuffer msgBuf = new StringBuffer();
int line = error.getSourceLineNumber();
if (line > 0) {
msgBuf.append("Line ");
msgBuf.append(line);
msgBuf.append(": ");
}