List of usage examples for org.eclipse.jdt.internal.compiler CompilationResult toString
@Override
public String toString()
From source file:ch.uzh.ifi.seal.changedistiller.ast.java.JavaCompilationUtils.java
License:Apache License
/** * Returns the compiled source as a {@link JavaCompilation}. * //from ww w. j a v a 2 s .c o m * @param Java source * to compile * @return the compilation of the Java source * @throws InvalidSyntaxException if the file has syntax errors. */ public static JavaCompilation compile(String source, String fileName) { CompilerOptions options = getDefaultCompilerOptions(); Parser parser = createCommentRecorderParser(options); ICompilationUnit cu = createCompilationUnit(source, fileName); CompilationResult compilationResult = createDefaultCompilationResult(cu, options); JavaCompilation javaCompilation = new JavaCompilation(parser.parse(cu, compilationResult), parser.scanner); if (compilationResult.hasSyntaxError) { throw new InvalidSyntaxException(new String(compilationResult.getFileName()), compilationResult.toString()); } return javaCompilation; }