AstUtils.rewriteReplace(
compilationUnit, singleMemberAnnotation.getValue(), replacement);
return;
} else {
MarkerAnnotation replacementAnnotation = ast.newMarkerAnnotation();
replacementAnnotation.setTypeName(ast.newName(singleMemberAnnotation.getTypeName().getFullyQualifiedName()));
AstUtils.rewriteReplace(
compilationUnit, singleMemberAnnotation, replacementAnnotation);
return;
}
}
MarkerAnnotation markerAnnotation =
annotation(declaration, MarkerAnnotation.class);
if (markerAnnotation != null) {
AST ast = markerAnnotation.getAST();
if (value != QualifiedNameValue.DEFAULT_VALUE) {
SingleMemberAnnotation replacementAnnotation = ast.newSingleMemberAnnotation();
replacementAnnotation.setTypeName(ast.newName(markerAnnotation.getTypeName().getFullyQualifiedName()));
Expression memberValueExpression =
value != null? AstUtils.createExpression(
ast, value): null;
replacementAnnotation.setValue(memberValueExpression);
AstUtils.rewriteReplace(