public static void replaceField(AddKeyInfo info, String originalName) throws CoreException {
IEditorPart editorPart = JavaUI.openInEditor(info.getComponentType().getCompilationUnit());
if (editorPart != null) {
IRewriteTarget target = (IRewriteTarget) editorPart.getAdapter(IRewriteTarget.class);
if (target != null) {
target.beginCompoundChange();
}
try {
String newName = info.getName();
info.setName(originalName);