IntentionPreviewInfo (@NotNull Project project, @NotNull PsiElement element) { if (element instanceof PsiAnonymousClass anonymousClass) { myProject = project; myManager = PsiManager.getInstance(myProject); myAnonOrLocalClass = anonymousClass; myNewClassName = AnonymousToInnerDialog.suggestNewClassNames(anonymousClass)[0]; PsiElement targetContainer = findTargetContainer(myAnonOrLocalClass); if (targetContainer instanceof PsiClass) { myTargetClass = (PsiClass)targetContainer; } else { return IntentionPreviewInfo.EMPTY; } myMakeStatic = !needsThis() && !myTargetClass.isInterface(); Map<PsiVariable,VariableInfo> variableInfoMap = new LinkedHashMap<>(); collectUsedVariables(variableInfoMap, myAnonOrLocalClass); myVariableInfos = variableInfoMap.values().toArray(new VariableInfo[0]); VariableData [] variableData = new VariableData[myVariableInfos.length]; AnonymousToInnerDialog.fillVariableData(myProject, myVariableInfos, variableData); AnonymousToInnerDialog.getVariableInfos(myProject, variableData, variableInfoMap); doRefactoring(); return IntentionPreviewInfo.DIFF; } return IntentionPreviewInfo.EMPTY; }