List<Module> (@NotNull AbstractProjectWizard wizard) { var builder = runWizard(wizard); if (null == builder) return null; List<Module> modules; if (builder instanceof ProjectImportBuilder<?>) { var artifactModel = myProjectStructureConfigurable.getArtifactsStructureConfigurable().getModifiableArtifactModel(); modules = ((ProjectImportBuilder<?>)builder).commit(myProject, myModuleModel, this, artifactModel); } else { modules = builder.commit(myProject, myModuleModel, this); } if (null != modules && !modules.isEmpty()) { ApplicationManager.getApplication().runWriteAction(() -> { for (Module module : modules) { if (module != null && getModule(module.getName()) != null) { getOrCreateModuleEditor(module); } } }); } return modules; }