Search in sources :

Example 1 with Location

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() + ")");
    }
}
Also used : CompileException(org.codehaus.commons.compiler.CompileException) Location(org.codehaus.commons.compiler.Location)

Aggregations

CompileException (org.codehaus.commons.compiler.CompileException)1 Location (org.codehaus.commons.compiler.Location)1