void () { final PsiClass clazz = (PsiClass)myContext.getScope(); final String name = getName(); String message = RefactoringBundle.message("field.exists", name, clazz.getQualifiedName()); if (clazz.findFieldByName(name, true) != null && Messages.showYesNoDialog(myContext.getProject(), message, IntroduceFieldHandler.getRefactoringNameText(), Messages.getWarningIcon()) != Messages.YES) { return; } super.doOKAction(); }