Module (@NotNull ModuleData moduleData) { String imlName = null; for (String candidate: suggestModuleNameCandidates(moduleData)) { Module module = findIdeModule(candidate); if (module == null) { imlName = candidate; break; } } assert imlName != null : "Too many duplicated module names"; String filePath = ExternalSystemApiUtil.toCanonicalPath(moduleData.getModuleFileDirectoryPath() + "/" + imlName + ModuleFileType.DOT_DEFAULT_EXTENSION); return newModule(filePath, moduleData.getModuleTypeId()); }