void () { final String error = myValidator.check(getMethodName()); if (error != null){ if (ApplicationManager.getApplication().isUnitTestMode()){ Messages.showInfoMessage(error, RefactoringBundle.message("error.title")); return; } if (Messages.showOkCancelDialog(error + ". " + RefactoringBundle.message("do.you.wish.to.continue"), RefactoringBundle.message("warning.title"), Messages.getWarningIcon()) != Messages.OK){ return; } } super.doOKAction(); }