void () { final String targetClassName = getTargetClassName(); if (myDefaultTargetClass == null || !targetClassName.isEmpty() && !Comparing.strEqual(targetClassName, myDefaultTargetClass.getQualifiedName())) { final Module module = ModuleUtilCore.findModuleForPsiElement(myContext.getPlace()); JavaPsiFacade facade = JavaPsiFacade.getInstance(myContext.getProject()); PsiClass newClass = facade.findClass(targetClassName, GlobalSearchScope.projectScope(myContext.getProject())); if (newClass == null && Messages.showOkCancelDialog(myContext.getProject(), GroovyRefactoringBundle.message("class.does.not.exist.in.the.module"), IntroduceConstantHandler.getRefactoringNameText(), Messages.getErrorIcon()) != Messages.OK) { return; } myTargetClassInfo = new TargetClassInfo(targetClassName, myContext.getPlace().getContainingFile().getContainingDirectory(), module, myContext.getProject()); } else { myTargetClassInfo = new TargetClassInfo(myDefaultTargetClass); } JavaRefactoringSettings.getInstance().INTRODUCE_CONSTANT_VISIBILITY = getVisibilityModifier(); RecentsManager.getInstance(myContext.getProject()).registerRecentEntry(RECENTS_KEY, targetClassName); super.doOKAction(); }