void (Module module) { String systemIdString = ExternalSystemModulePropertyManager.getInstance(module).getExternalSystemId(); if (StringUtil.isEmpty(systemIdString)) return; String rootProjectPath = ExternalSystemApiUtil.getExternalRootProjectPath(module); if (StringUtil.isEmpty(rootProjectPath)) return; Project project = module.getProject(); ModulesConfigurator modulesConfigurator = getModulesConfigurator(project); if (modulesConfigurator == null) return; for (Module m : modulesConfigurator.getModules()) { if (m != module && rootProjectPath.equals(ExternalSystemApiUtil.getExternalRootProjectPath(m))) { return; } } ProjectSystemId systemId = new ProjectSystemId(systemIdString); ExternalSystemApiUtil.getSettings(project, systemId).unlinkExternalProject(rootProjectPath); assert myOrphanProjectsCandidates != null; myOrphanProjectsCandidates.put(rootProjectPath, systemId); isExternalSystemsInvolved = true; }