Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
277,200
void (Library library) { getModifiableProjectLibrariesModel().removeLibrary(library); }
removeLibrary
277,201
ModifiableWorkspace () { if (myModifiableWorkspace == null && ExternalProjectsWorkspaceImpl.isDependencySubstitutionEnabled()) { myModifiableWorkspace = doGetModifiableWorkspace(); } return myModifiableWorkspace; }
getModifiableWorkspace
277,202
ModalityState () { return ModalityState.nonModal(); }
getModalityStateForQuestionDialogs
277,203
List<Module> (@NotNull Module module) { final ArrayList<Module> list = new ArrayList<>(); final Graph<Module> graph = getModuleGraph(); for (Iterator<Module> i = graph.getOut(module); i.hasNext(); ) { list.add(i.next()); } return list; }
getAllDependentModules
277,204
ModifiableWorkspace () { return ReadAction.compute(() -> myProject.getService(ExternalProjectsWorkspaceImpl.class) .createModifiableWorkspace(() -> Arrays.asList(getModules()))); }
doGetModifiableWorkspace
277,205
Graph<Module> () { return GraphGenerator.generate(CachingSemiGraph.cache(new InboundSemiGraph<>() { @NotNull @Override public Collection<Module> getNodes() { return Arrays.asList(getModules()); } @NotNull @Override public Iterator<Module> getIn(Module m) { Module[] dependentModules = getModifiableRootModel(m).getModule...
getModuleGraph
277,206
Collection<Module> () { return Arrays.asList(getModules()); }
getNodes
277,207
Iterator<Module> (Module m) { Module[] dependentModules = getModifiableRootModel(m).getModuleDependencies(true); return Arrays.asList(dependentModules).iterator(); }
getIn
277,208
void () { ProjectRootManagerEx.getInstanceEx(myProject).mergeRootsChangesDuring(() -> { if (ExternalProjectsWorkspaceImpl.isDependencySubstitutionEnabled()) { updateSubstitutions(); } for (Map.Entry<Library, Library.ModifiableModel> entry: myModifiableLibraryModels.entrySet()) { Library fromLibrary = entry.getKey(); Li...
commit
277,209
void () { ApplicationManager.getApplication().assertWriteIntentLockAcquired(); assert !myDisposed : "Already disposed!"; myDisposed = true; for (ModifiableRootModel each: myModifiableRootModels.values()) { if (each.isDisposed()) continue; each.dispose(); } Disposer.dispose(getModifiableProjectLibrariesModel()); for (Li...
dispose
277,210
void (Module testModule, String productionModuleName) { myProductionModulesForTestModules.put(testModule, productionModuleName); }
setTestModuleProperties
277,211
String (Module module) { return myProductionModulesForTestModules.get(module); }
getProductionModuleName
277,212
ModuleOrderEntry (Module ownerModule, LibraryOrderEntry libraryOrderEntry, ProjectCoordinate publicationId) { String workspaceModuleCandidate = findModuleByPublication(publicationId); Module workspaceModule = workspaceModuleCandidate == null ? null : findIdeModule(workspaceModuleCandidate); if (workspaceModule == null)...
trySubstitute
277,213
void (Module module, ProjectCoordinate modulePublication) { ModifiableWorkspace workspace = getModifiableWorkspace(); if (workspace != null) { workspace.register(modulePublication, module); } }
registerModulePublication
277,214
boolean (String libraryName) { ModifiableWorkspace workspace = getModifiableWorkspace(); if (workspace == null) return false; return workspace.isSubstituted(libraryName); }
isSubstituted
277,215
String (ProjectCoordinate publicationId) { ModifiableWorkspace workspace = getModifiableWorkspace(); return workspace == null ? null : workspace.findModule(publicationId); }
findModuleByPublication
277,216
void () { ModifiableWorkspace workspace = getModifiableWorkspace(); if (workspace == null) return; final List<String> oldModules = ContainerUtil.map(ModuleManager.getInstance(myProject).getModules(), module -> module.getName()); final List<String> newModules = ContainerUtil.map(myModifiableModuleModel.getModules(), mod...
updateSubstitutions
277,217
ModifiableModuleModel () { return ReadAction.compute(() -> { ModuleManager moduleManager = ModuleManager.getInstance(myProject); ModifiableModuleModel modifiableModel = ((ModuleManagerBridgeImpl)moduleManager).getModifiableModel(getActualStorageBuilder()); Module[] modules = modifiableModel.getModules(); for (Module mo...
doGetModifiableModuleModel
277,218
ModifiableRootModel (@NotNull final Module module) { RootConfigurationAccessor rootConfigurationAccessor = new RootConfigurationAccessor() { @Nullable @Override public Library getLibrary(Library library, String libraryName, String libraryLevel) { if (LibraryTablesRegistrar.PROJECT_LEVEL.equals(libraryLevel)) { return g...
doGetModifiableRootModel
277,219
Library (Library library, String libraryName, String libraryLevel) { if (LibraryTablesRegistrar.PROJECT_LEVEL.equals(libraryLevel)) { return getModifiableProjectLibrariesModel().getLibraryByName(libraryName); } return library; }
getLibrary
277,220
ModifiableFacetModel (Module module) { FacetManager facetManager = FacetManager.getInstance(module); return ((FacetManagerBridge)facetManager).createModifiableModel(getActualStorageBuilder()); }
doGetModifiableFacetModel
277,221
Module (@NotNull String filePath, String moduleTypeId) { Module module = super.newModule(filePath, moduleTypeId); setIdeModelsProviderForModule(module); return module; }
newModule
277,222
Module (@NotNull ModuleData moduleData) { Module module = super.newModule(moduleData); setIdeModelsProviderForModule(module); return module; }
newModule
277,223
void () { LOG.trace("Applying commit for IdeaModifiableModelProvider"); workspaceModelCommit(); }
commit
277,224
void () { ProjectRootManagerEx.getInstanceEx(myProject).mergeRootsChangesDuring(() -> { if (ExternalProjectsWorkspaceImpl.isDependencySubstitutionEnabled()) { updateSubstitutions(); } LibraryTable.ModifiableModel projectLibrariesModel = getModifiableProjectLibrariesModel(); for (Map.Entry<Library, Library.ModifiableMod...
workspaceModelCommit
277,225
void () { if (myModifiableModuleModel != null) { Module[] modules = myModifiableModuleModel.getModules(); for (Module module : modules) { module.putUserData(MODIFIABLE_MODELS_PROVIDER_KEY, null); } } super.dispose(); }
dispose
277,226
MutableEntityStorage () { if (diff != null) return diff; VersionedEntityStorage storage = WorkspaceModel.getInstance(myProject).getEntityStorage(); LOG.info("Ide modifiable models provider, create builder from version " + storage.getVersion()); var initialStorage = storage.getCurrent(); return diff = MutableEntityStora...
getActualStorageBuilder
277,227
void (@NotNull Module module) { module.putUserData(MODIFIABLE_MODELS_PROVIDER_KEY, this); }
setIdeModelsProviderForModule
277,228
ClassMap<ModifiableModel> () { return myModifiableModels; }
getModifiableModels
277,229
void () { updateSubstitutions(); }
forceUpdateSubstitutions
277,230
void (@NotNull Project project) { final ExternalSystemFacadeManager facadeManager = ApplicationManager.getApplication().getService(ExternalSystemFacadeManager.class); for (ExternalSystemManager<?, ?, ?, ?, ?> manager : ExternalSystemApiUtil.getAllManagers()) { AbstractExternalSystemSettings settings = manager.getSettin...
beAware
277,231
void (@NotNull String oldName, @NotNull String newName) { facadeManager.onProjectRename(oldName, newName); }
onProjectRenamed
277,232
State () { return myState; }
getState
277,233
void (@NotNull State state) { myState = state; }
loadState
277,234
boolean () { return Registry.is("external.system.substitute.library.dependencies"); }
isDependencySubstitutionEnabled
277,235
ModifiableWorkspace (Supplier<? extends List<Module>> modulesSupplier) { return new ModifiableWorkspace(myState, modulesSupplier); }
createModifiableWorkspace
277,236
long () { return myId; }
getId
277,237
void (@NotNull String key, long millis) { performanceData.put(key, millis); }
logPerformance
277,238
void (@NotNull Map<String, Long> trace) { performanceData.putAll(trace); }
addTrace
277,239
void () { if (LOG.isDebugEnabled()) { LOG.debug("Gradle successful import performance trace"); for (var entry : getPerformanceTrace().entrySet()) { LOG.debug("%s : %d ms.".formatted(entry.getKey(), entry.getValue())); } } }
reportStatistics
277,240
void (@NotNull Path directory) { var traceJoiner = new StringJoiner("\n"); for (var entry : getPerformanceTrace().entrySet()) { var description = entry.getKey(); var duration = entry.getValue(); var apply = "%s : %d ms.".formatted(description, duration); traceJoiner.add(apply); } try { var file = FileUtil.findSequentNo...
reportStatisticsToFile
277,241
OrderRootType (@NotNull LibraryPathType type) { return MAPPINGS.get(type); }
map
277,242
Module (@NotNull ModuleData module) { Module cachedIdeModule = myIdeModulesCache.get(module); if (cachedIdeModule == null) { for (String candidate : suggestModuleNameCandidates(module)) { Module ideModule = findIdeModule(candidate); if (ideModule != null && isApplicableIdeModule(module, ideModule)) { myIdeModulesCache....
findIdeModule
277,243
Iterable<String> (@NotNull ModuleData module) { ExternalProjectSettings settings = getSettings(myProject, module.getOwner()).getLinkedProjectSettings(module.getLinkedExternalProjectPath()); char delimiter = settings != null && settings.isUseQualifiedModuleNames() ? '.' : '-'; return new ModuleNameGenerator(module, deli...
suggestModuleNameCandidates
277,244
boolean (@NotNull ModuleData moduleData, @NotNull Module ideModule) { for (VirtualFile root : ModuleRootManager.getInstance(ideModule).getContentRoots()) { if (VfsUtilCore.pathEqualsTo(root, moduleData.getLinkedExternalProjectPath())) { return true; } } return isExternalSystemAwareModule(moduleData.getOwner(), ideModul...
isApplicableIdeModule
277,245
Module (@NotNull String ideModuleName) { return ModuleManager.getInstance(myProject).findModuleByName(ideModuleName); }
findIdeModule
277,246
UnloadedModuleDescription (@NotNull ModuleData moduleData) { for (String moduleName : suggestModuleNameCandidates(moduleData)) { UnloadedModuleDescription unloadedModuleDescription = ModuleManager.getInstance(myProject).getUnloadedModuleDescription(moduleName); // TODO external system module options should be honored t...
getUnloadedModuleDescription
277,247
Library (@NotNull LibraryData libraryData) { final LibraryTable libraryTable = LibraryTablesRegistrar.getInstance().getLibraryTable(myProject); for (Library ideLibrary : libraryTable.getLibraries()) { if (isRelated(ideLibrary, libraryData)) return ideLibrary; } return null; }
findIdeLibrary
277,248
ModuleOrderEntry (@NotNull ModuleDependencyData dependency, @NotNull Module module) { Map<String, List<ModuleOrderEntry>> namesToEntries = myIdeModuleToModuleDepsCache.computeIfAbsent( module, (m) -> Arrays.stream(getOrderEntries(m)) .filter(ModuleOrderEntry.class::isInstance) .map(ModuleOrderEntry.class::cast) .collec...
findIdeModuleDependency
277,249
OrderEntry (@NotNull DependencyData data) { Module ownerIdeModule = findIdeModule(data.getOwnerModule()); if (ownerIdeModule == null) return null; LibraryDependencyData libraryDependencyData = null; ModuleDependencyData moduleDependencyData = null; if (data instanceof LibraryDependencyData) { libraryDependencyData = (L...
findIdeModuleOrderEntry
277,250
Library (String name) { return LibraryTablesRegistrar.getInstance().getLibraryTable(myProject).getLibraryByName(name); }
getLibraryByName
277,251
List<Module> (@NotNull Module module) { return ModuleUtilCore.getAllDependentModules(module); }
getAllDependentModules
277,252
Iterator<String> () { return ContainerUtil.concatIterators(names.iterator(), new Iterator<>() { int current = 0; @Override public boolean hasNext() { return current < MAX_NUMBER_SEQ; } @Override public String next() { current++; return namePrefix + '~' + current; } }); }
iterator
277,253
boolean () { return current < MAX_NUMBER_SEQ; }
hasNext
277,254
String () { current++; return namePrefix + '~' + current; }
next
277,255
void () { ExternalSystemProjectTracker projectTracker = ExternalSystemProjectTracker.getInstance(project); List<ExternalSystemProjectId> projectSettings = findAllProjectSettings(); ApplicationManager.getApplication().invokeLater(() -> { projectSettings.forEach(it -> projectTracker.markDirty(it)); for (Contributor contr...
markDirtyAllExternalProjects
277,256
void (@NotNull Module module) { ExternalSystemProjectTracker projectTracker = ExternalSystemProjectTracker.getInstance(project); String projectPath = ExternalSystemApiUtil.getExternalProjectPath(module); List<ExternalSystemProjectId> projectSettings = findAllProjectSettings(); ApplicationManager.getApplication().invoke...
markDirty
277,257
void (@NotNull String projectPath) { ExternalSystemProjectTracker projectTracker = ExternalSystemProjectTracker.getInstance(project); List<ExternalSystemProjectId> projectSettings = findAllProjectSettings(); ApplicationManager.getApplication().invokeLater(() -> { projectSettings.stream() .filter(it -> it.getExternalPro...
markDirty
277,258
List<ExternalSystemProjectId> () { List<ExternalSystemProjectId> list = new ArrayList<>(); ExternalSystemManager.EP_NAME.forEachExtensionSafe(manager -> { ProjectSystemId systemId = manager.getSystemId(); Collection<? extends ExternalProjectSettings> linkedProjectsSettings = manager.getSettingsProvider().fun(project).g...
findAllProjectSettings
277,259
void (@NotNull List<? extends @NotNull VFileEvent> events) { for (VFileEvent each : events) { if (each instanceof VFileDeleteEvent) { deleteRecursively(each.getFile(), each); } else { if (!isRelevant(each.getPath())) continue; if (each instanceof VFilePropertyChangeEvent) { if (isRenamed(each)) { deleteRecursively(each...
before
277,260
void (VirtualFile f, final VFileEvent event) { VfsUtilCore.visitChildrenRecursively(f, new VirtualFileVisitor<Void>() { @Override public boolean visitFile(@NotNull VirtualFile f) { if (isRelevant(f.getPath())) deleteFile(f, event); return true; } @Nullable @Override public Iterable<VirtualFile> getChildrenIterable(@Not...
deleteRecursively
277,261
boolean (@NotNull VirtualFile f) { if (isRelevant(f.getPath())) deleteFile(f, event); return true; }
visitFile
277,262
Iterable<VirtualFile> (@NotNull VirtualFile f) { return f.isDirectory() && f instanceof NewVirtualFile ? ((NewVirtualFile)f).iterInDbChildren() : null; }
getChildrenIterable
277,263
void (@NotNull List<? extends @NotNull VFileEvent> events) { for (VFileEvent each : events) { if (!isRelevant(each.getPath())) continue; if (each instanceof VFileCreateEvent createEvent) { VirtualFile newChild = createEvent.getParent().findChild(createEvent.getChildName()); if (newChild != null) { updateFile(newChild, ...
after
277,264
boolean (VFileEvent each) { return ((VFilePropertyChangeEvent)each).getPropertyName().equals(VirtualFile.PROP_NAME) && !Comparing.equal(((VFilePropertyChangeEvent)each).getOldValue(), ((VFilePropertyChangeEvent)each).getNewValue()); }
isRenamed
277,265
List<File> (String projectPath, @NotNull Project project) { return myDelegate.getAffectedExternalProjectFiles(projectPath, project); }
getAffectedExternalProjectFiles
277,266
boolean (@Nullable ProjectResolverPolicy resolverPolicy) { return myDelegate.isApplicable(resolverPolicy); }
isApplicable
277,267
JComponent () { PaintAwarePanel result = myComponent; if (result == null) { result = new PaintAwarePanel(); myControl.fillUi(result, 0); myControl.reset(true, null); ExternalSystemUiUtil.fillBottom(result); myComponent = result; } return result; }
getComponent
277,268
void () { myControl.apply(myExternalModuleBuilder.getExternalProjectSettings()); }
updateDataModel
277,269
void () { String contentPath = myExternalModuleBuilder.getContentEntryPath(); if (contentPath != null) { myControl.getInitialSettings().setExternalProjectPath(contentPath); } myControl.reset(true, myContext, null); }
updateStep
277,270
void () { super.disposeUIResources(); myControl.disposeUIResources(); }
disposeUIResources
277,271
boolean () { return myContext == null || !Boolean.TRUE.equals(myContext.getUserData(SKIP_STEP_KEY)); }
isStepVisible
277,272
String () { return myControl.getHelpId(); }
getHelpId
277,273
String () { return myExternalSystemId.getReadableName(); }
getPresentableName
277,274
String () { return ExternalSystemBundle.message("module.type.description", myExternalSystemId.getReadableName()); }
getDescription
277,275
Icon () { return myIcon; }
getNodeIcon
277,276
S () { return myExternalProjectSettings; }
getExternalProjectSettings
277,277
Project (String name, String path) { Project project = super.createProject(name, path); if(project != null) { project.putUserData(ExternalSystemDataKeys.NEWLY_CREATED_PROJECT, Boolean.TRUE); } return project; }
createProject
277,278
Key<ContentRootData> () { return ProjectKeys.CONTENT_ROOT; }
getTargetDataKey
277,279
void (@NotNull Collection<? extends DataNode<ContentRootData>> toImport, @Nullable ProjectData projectData, @NotNull Project project, @NotNull IdeModifiableModelsProvider modelsProvider) { logUnitTest("Importing data. Data size is [" + toImport.size() + "]"); if (toImport.isEmpty()) { return; } boolean isNewlyImportedP...
importData
277,280
void (@NotNull Project project, @NotNull IdeModifiableModelsProvider modelsProvider, @NotNull final Collection<? extends DataNode<ContentRootData>> data, @NotNull final Module module, boolean forceDirectoriesCreation, @Nullable ProjectSystemId owner) { logUnitTest("Import data for module [" + module.getName() + "], dat...
importData
277,281
void (@NotNull ContentEntry contentEntry, @NotNull IdeModifiableModelsProvider modelsProvider, @Nullable ProjectSystemId owner, @NotNull Project project) { if (owner == null) { return; // can not remove imported exclude folders is source is not known } if (modelsProvider instanceof IdeModifiableModelsProviderImpl impl)...
removeImportedExcludeFolders
277,282
boolean (@NotNull ProjectSystemId owner, @NotNull ExcludeUrlEntity excludeEntity) { return excludeEntity.getEntitySource() instanceof JpsImportedEntitySource importedEntitySource && owner.getId().equals(importedEntitySource.getExternalSystemId()); }
isImportedEntity
277,283
ContentEntry (@NotNull ModifiableRootModel model, @NotNull ContentRootData contentRootData) { String path = contentRootData.getRootPath(); ContentEntry[] entries = model.getContentEntries(); for (ContentEntry entry : entries) { VirtualFile file = entry.getFile(); if (file == null) { continue; } if (ExternalSystemApiUti...
findOrCreateContentRoot
277,284
Set<String> (@NotNull ContentRootData contentRoot) { Set<String> sourceRoots = CollectionFactory.createFilePathSet(); for (ExternalSystemSourceType externalSrcType : ExternalSystemSourceType.values()) { final JpsModuleSourceRootType<?> type = getJavaSourceRootType(externalSrcType); if (type == null) continue; for (Sour...
getSourceRoots
277,285
void (@NotNull ContentEntry contentEntry, @NotNull ContentRootData contentRoot) { SourceFolder[] sourceFolders = contentEntry.getSourceFolders(); if (sourceFolders.length == 0) return; Set<String> sourceRoots = getSourceRoots(contentRoot); for (SourceFolder sourceFolder : sourceFolders) { String url = sourceFolder.getU...
removeSourceFoldersIfAbsent
277,286
void (@NotNull SourceFolderManager sourceFolderManager, @NotNull ContentEntry contentEntry, @NotNull final SourceRoot sourceRoot, @NotNull Module module, @NotNull JpsModuleSourceRootType<?> sourceRootType, boolean createEmptyContentRootDirectories, @NotNull ProjectModelExternalSource externalSource) { String path = sou...
createOrReplaceSourceFolder
277,287
void (@NotNull SourceFolderManager sourceFolderManager, @NotNull ContentEntry contentEntry, @NotNull SourceRoot sourceRoot, boolean updatePackagePrefix, boolean generated) { String packagePrefix = sourceRoot.getPackagePrefix(); String url = pathToUrl(sourceRoot.getPath()); logDebug("Importing root '%s' with packagePref...
configureSourceFolder
277,288
void (@NotNull String path) { if (Files.exists(Path.of(path))) return; ExternalSystemApiUtil.doWriteAction(() -> { try { VfsUtil.createDirectoryIfMissing(path); } catch (IOException e) { LOG.warn(String.format("Unable to create directory for the path: %s", path), e); } }); }
createEmptyDirectory
277,289
SourceFolder (@NotNull ContentEntry contentEntry, @NotNull SourceRoot sourceRoot) { for (SourceFolder folder : contentEntry.getSourceFolders()) { VirtualFile file = folder.getFile(); if (file == null) continue; String folderPath = ExternalSystemApiUtil.getLocalFileSystemPath(file); String rootPath = sourceRoot.getPath(...
findSourceFolder
277,290
void (@NotNull SourceFolder folder, boolean generated) { JpsModuleSourceRoot jpsElement = folder.getJpsElement(); JavaSourceRootProperties properties = jpsElement.getProperties(JavaModuleSourceRootTypes.SOURCES); if (properties != null) properties.setForGeneratedSources(generated); }
setForGeneratedSources
277,291
void (@NotNull String format, Object... args) { if (ApplicationManager.getApplication().isUnitTestMode()) { LOG.info(String.format(format, args)); } }
logUnitTest
277,292
void (@NotNull String format, Object... args) { if (LOG.isDebugEnabled()) { LOG.debug(String.format(format, args)); } }
logDebug
277,293
void (@NotNull ContentEntry entry, @NotNull SourceRoot root, @NotNull String moduleName) { String rootPath = root.getPath(); for (VirtualFile file : entry.getExcludeFolderFiles()) { if (ExternalSystemApiUtil.getLocalFileSystemPath(file).equals(rootPath)) { return; } } logDebug("Importing excluded root '%s' for content ...
createExcludedRootIfAbsent
277,294
void (@NotNull MultiMap<DataNode<ModuleData>, DataNode<ContentRootData>> moduleNodeToRootNodes, @NotNull Project project) { Map<String, DuplicateModuleReport> filter = new LinkedHashMap<>(); for (Map.Entry<DataNode<ModuleData>, Collection<DataNode<ContentRootData>>> entry : moduleNodeToRootNodes.entrySet()) { ModuleDat...
filterAndReportDuplicatingContentRoots
277,295
void (@NotNull Project project, int reportsCount, @NotNull @Nls String notificationMessage) { int extraReportsCount = reportsCount - 1; if (extraReportsCount > 0) { notificationMessage += ExternalSystemBundle.message("duplicate.content.roots.extra", extraReportsCount); } Notification notification = new Notification("Co...
showNotificationsPopup
277,296
void (@NotNull ModuleData duplicate) { myDuplicates.add(duplicate); }
addDuplicate
277,297
boolean () { return !myDuplicates.isEmpty(); }
hasDuplicates
277,298
String () { return myOriginal.getInternalName(); }
getOriginalName
277,299
Collection<String> () { return ContainerUtil.map(myDuplicates, ModuleData::getInternalName); }
getDuplicatesNames