/** Retrieve the line upon which the error occurred. * * @return The line. */ public int getLine() { return getStartLine(); }
/** * Writes out a nicely formatted summary of the syntax error. */ public void write(PrintWriter output, Janitor janitor) { String name = source.getName(); int line = getCause().getStartLine(); int column = getCause().getStartColumn(); String sample = source.getSample(line, column, janitor); output.print(name + ": " + line + ": " + getCause().getMessage()); if (sample != null) { output.println(); output.print(sample); output.println(); } }
/** * Writes out a nicely formatted summary of the syntax error. */ public void write(PrintWriter output, Janitor janitor) { String name = source.getName(); int line = getCause().getStartLine(); int column = getCause().getStartColumn(); String sample = source.getSample(line, column, janitor); output.print(name + ": " + line + ": " + getCause().getMessage()); if (sample != null) { output.println(); output.print(sample); output.println(); } }
/** * Writes out a nicely formatted summary of the syntax error. */ public void write(PrintWriter output, Janitor janitor) { String name = source.getName(); int line = getCause().getStartLine(); int column = getCause().getStartColumn(); String sample = source.getSample(line, column, janitor); output.print(name + ": " + line + ": " + getCause().getMessage()); if (sample != null) { output.println(); output.print(sample); output.println(); } }
/** * Writes out a nicely formatted summary of the syntax error. */ public void write(PrintWriter output, Janitor janitor) { String name = source.getName(); int line = getCause().getStartLine(); int column = getCause().getStartColumn(); String sample = source.getSample(line, column, janitor); output.print(name + ": " + line + ": " + getCause().getMessage()); if (sample != null) { output.println(); output.print(sample); output.println(); } }
/** * Writes out a nicely formatted summary of the syntax error. */ public void write(PrintWriter output, Janitor janitor) { String name = source.getName(); int line = getCause().getStartLine(); int column = getCause().getStartColumn(); String sample = source.getSample(line, column, janitor); output.print(name + ": " + line + ": " + getCause().getMessage()); if (sample != null) { output.println(); output.print(sample); output.println(); } }
Ranges.createZeroBasedRange(cause.getStartLine(), cause.getStartColumn(), cause.getEndLine(), cause.getEndColumn()); uri = Paths.get(cause.getSourceLocator()).toUri();
public static ScriptError fromGroovyException(MultipleCompilationErrorsException e) { ErrorCollector errorCollector = e.getErrorCollector(); if (errorCollector.getErrorCount() > 0) { Message error = errorCollector.getError(0); if (error instanceof SyntaxErrorMessage) { SyntaxException cause = ((SyntaxErrorMessage) error).getCause(); return new ScriptError(cause.getMessage(), cause.getStartLine(), cause.getStartColumn(), cause.getEndLine(), cause.getEndColumn()); } else { throw new AssertionError("SyntaxErrorMessage is expected"); } } else { throw new AssertionError("At least one error is expected"); } }
int startLine = ex.getStartLine(); int startColumn = ex.getStartColumn(); int line = ex.getLine();