use of org.codehaus.commons.compiler.Location in project drill by apache.
the class DrillDiagnosticListener method report.
@Override
public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
if (diagnostic.getKind() == javax.tools.Diagnostic.Kind.ERROR) {
String message = diagnostic.toString() + " (" + diagnostic.getCode() + ")";
logger.error(message);
Location loc = new //
Location(//
diagnostic.getSource().toString(), //
(short) diagnostic.getLineNumber(), //
(short) diagnostic.getColumnNumber());
// does not declare checked exceptions.
throw new RuntimeException(new CompileException(message, loc));
} else if (logger.isTraceEnabled()) {
logger.trace(diagnostic.toString() + " (" + diagnostic.getCode() + ")");
}
}
Aggregations