void (Set<String> topLevelSourceFolderUrls, ModifiableRootModel rootModel, Map<String, SourceFolder> sourceFoldersMap) { for (String sourceFolderUrl : topLevelSourceFolderUrls) { if (isAlreadyContentRoot(sourceFolderUrl, rootModel.getProject())) continue; ContentEntry contentEntry = rootModel.addContentEntry(sourceFolderUrl); for (Map.Entry<String, SourceFolder> entry : sourceFoldersMap.entrySet()) { if (FileUtil.isAncestor(sourceFolderUrl, entry.getKey(), false)) { SourceFolder oldSourceFolder = entry.getValue(); SourceFolder newSourceFolder = contentEntry.addSourceFolder(oldSourceFolder.getUrl(), oldSourceFolder.getRootType()); newSourceFolder.setPackagePrefix(oldSourceFolder.getPackagePrefix()); } } } }