ast, getAnnotationFullyQualifiedName(), memberValues);
normalAnnotation.setSourceRange(
AstUtils.calculateOffset(declaration, true).offset,
normalAnnotation.getLength());
ImportDeclaration importDeclaration =
AstUtils.createImportStatement(ast, getAnnotationFullyQualifiedName());
String source = compilationUnit.getBuffer().getContents();
Document document= new Document(source);
ASTParser parser = ASTParser.newParser(AST.JLS3);
parser.setSource(compilationUnit);
ASTRewrite rewrite = ASTRewrite.create(declaration.getAST());
ChildListPropertyDescriptor modifiersProperty = declaration.getModifiersProperty();
ListRewrite listRewrite = rewrite.getListRewrite(declaration, modifiersProperty);
listRewrite.insertFirst(normalAnnotation, null);
maintainValuesProperty(normalAnnotation, memberValues, ast, rewrite);
TextEdit importEdits = null;
ImportRewrite importRewrite = ImportRewrite.create(compilationUnit, true);
importRewrite.addImport(importDeclaration.getName().getFullyQualifiedName());
importEdits = importRewrite.rewriteImports(null);
Map options = compilationUnit.getJavaProject().getOptions(true);
TextEdit edits = rewrite.rewriteAST(document, options);