Collection<String> (@Nullable GlobalSearchScope scope) { MultiMap<String, Module> map; synchronized (LOCK) { map = myMap; } if (map != null) { return getAllPackagePrefixes(scope, map); } map = new MultiMap<>(); for (final Module module : ModuleManager.getInstance(myProject).getModules()) { for (final ContentEntry entry : ModuleRootManager.getInstance(module).getContentEntries()) { for (final SourceFolder folder : entry.getSourceFolders(JavaModuleSourceRootTypes.SOURCES)) { final String prefix = folder.getPackagePrefix(); if (StringUtil.isNotEmpty(prefix)) { map.putValue(prefix, module); } } } } synchronized (LOCK) { if (myMap == null) { myMap = map; } return getAllPackagePrefixes(scope, myMap); } }