ASTParser parser = ASTParser.newParser(AST.JLS3);
parser.setSource(unit);
parser.setResolveBindings(resolveBindings());
return (CompilationUnit) parser.createAST(monitor);
}
<BUG>protected void rewriteCompilationUnit(ASTRewrite rewrite, IDocument doc, ICompilationUnit originalUnit) throws JavaModelException, BadLocationException {
</BUG>
TextEdit edits = rewrite.rewriteAST(doc, originalUnit.getJavaProject().getOptions(true));
edits.apply(doc);
originalUnit.getBuffer().setContents(doc.get());

ASTParser parser = ASTParser.newParser(AST.JLS3);
parser.setSource(unit);
parser.setResolveBindings(resolveBindings());
return (CompilationUnit) parser.createAST(monitor);
}
private void rewriteCompilationUnit(ASTRewrite rewrite, IDocument doc, ICompilationUnit originalUnit) throws JavaModelException, BadLocationException {
TextEdit edits = rewrite.rewriteAST(doc, originalUnit.getJavaProject().getOptions(true));
edits.apply(doc);
originalUnit.getBuffer().setContents(doc.get());
