/** * 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(); } }
@SuppressWarnings({"ThrowableResultOfMethodCallIgnored"}) SyntaxException syntaxException = ((SyntaxErrorMessage) firstMessage).getCause(); Position errorPosition = new Position(syntaxException.getLine(), syntaxException.getStartColumn());
/** * @return the end column on which the error occurs */ public int getEndColumn() { return getStartColumn() + 1; }
/** * @return the end column on which the error occurs */ public int getEndColumn() { return getStartColumn() + 1; }
/** * @return the end column on which the error occurs */ public int getEndColumn() { return getStartColumn() + 1; }
/** * @return the end column on which the error occurs */ public int getEndColumn() { return getStartColumn() + 1; }
/** * 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"); } }
public static List<CheckStatus> toCheckStatus(CompilationFailedException x) { List<CheckStatus> errors = new ArrayList<CheckStatus>(); if (x instanceof MultipleCompilationErrorsException) { for (Object o : ((MultipleCompilationErrorsException) x).getErrorCollector().getErrors()) { if (o instanceof SyntaxErrorMessage) { SyntaxException cause = ((SyntaxErrorMessage) o).getCause(); CheckStatus st = new CheckStatus(cause.getOriginalMessage(), FAIL_KEY); st.setLine(cause.getLine()); st.setColumn(cause.getStartColumn()); errors.add(st); } } } if (errors.isEmpty()) { // Fallback to simple message CheckStatus st = new CheckStatus(x.getMessage(), FAIL_KEY); st.setLine(1); st.setColumn(0); errors.add(st); } return errors; }
@SuppressWarnings({"ThrowableResultOfMethodCallIgnored"}) SyntaxException syntaxException = ((SyntaxErrorMessage) firstMessage).getCause(); Position errorPosition = new Position(syntaxException.getLine(), syntaxException.getStartColumn());
line = 1; int col = se.getStartColumn();
int startColumn = ex.getStartColumn(); int line = ex.getLine(); int endColumn = ex.getEndColumn();