void () { String message = null; final String className = getClassName(); final String parameterName = getParameterName(); PsiManager manager = PsiManager.getInstance(myProject); if (className.isEmpty()) { message = JavaRefactoringBundle.message("no.class.name.specified"); } else { if (!PsiNameHelper.getInstance(manager.getProject()).isIdentifier(className)) { message = RefactoringMessageUtil.getIncorrectIdentifierMessage(className); } else { if (myCbPassOuterClass.isSelected()) { if (parameterName != null && parameterName.isEmpty()) { message = JavaRefactoringBundle.message("no.parameter.name.specified"); } else { if (!PsiNameHelper.getInstance(manager.getProject()).isIdentifier(parameterName)) { message = RefactoringMessageUtil.getIncorrectIdentifierMessage(parameterName); } } } if (message == null && myTargetContainer instanceof PsiClass targetClass) { PsiClass[] classes = targetClass.getInnerClasses(); for (PsiClass aClass : classes) { if (className.equals(aClass.getName())) { message = JavaRefactoringBundle.message("inner.class.exists", className, targetClass.getName()); break; } } } } } PsiElement target = null; if (message == null) { if (myCbPassOuterClass.isSelected() && mySuggestedNameInfo != null) { mySuggestedNameInfo.nameChosen(getParameterName()); } target = getTargetContainer(); if (target == null) return; if (target instanceof PsiDirectory) { message = RefactoringMessageUtil.checkCanCreateClass((PsiDirectory)target, className); if (message == null) { final String packageName = getPackageName(); if (packageName.length() > 0 && !PsiNameHelper.getInstance(myProject).isQualifiedName(packageName)) { message = RefactoringMessageUtil.getIncorrectIdentifierMessage(packageName); } } } } if (message != null) { CommonRefactoringUtil.showErrorMessage( MoveInnerImpl.getRefactoringName(), message, HelpID.MOVE_INNER_UPPER, myProject); return; } RecentsManager.getInstance(myProject).registerRecentEntry(RECENTS_KEY, getPackageName()); myProcessor.setup(getInnerClass(), className, isPassOuterClass(), parameterName, isSearchInComments(), isSearchInNonJavaFiles(), target); final boolean openInEditor = isOpenInEditor(); myProcessor.setOpenInEditor(openInEditor); invokeRefactoring(myProcessor); }