Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
296,800
void (ContentEntry e, final List<? extends ContentFolder> folders, String... expected) { List<String> actual = new ArrayList<>(); for (ContentFolder f : folders) { String rootUrl = e.getUrl(); String folderUrl = f.getUrl(); if (folderUrl.startsWith(rootUrl)) { int length = rootUrl.length() + 1; folderUrl = folderUrl.su...
doAssertContentFolders
296,801
String (String path) { path = VfsUtilCore.urlToPath(path); path = FileUtil.toCanonicalPath(path); return FileUtil.toSystemIndependentName(path); }
getAbsolutePath
296,802
void (String moduleName, String depName) { assertModuleLibDep(moduleName, depName, null); }
assertModuleLibDep
296,803
void (String moduleName, String depName, String classesPath) { assertModuleLibDep(moduleName, depName, classesPath, null, null); }
assertModuleLibDep
296,804
void (String moduleName, String depName, String classesPath, String sourcePath, String javadocPath) { LibraryOrderEntry lib = ContainerUtil.getFirstItem(getModuleLibDeps(moduleName, depName)); final String errorMessage = "Failed to find dependency with name [" + depName + "] in module [" + moduleName + "]\n" + "Availab...
assertModuleLibDep
296,805
void (String moduleName, String depName, List<String> classesPaths, List<String> sourcePaths, List<String> javadocPaths) { LibraryOrderEntry lib = ContainerUtil.getFirstItem(getModuleLibDeps(moduleName, depName)); assertModuleLibDepPath(lib, OrderRootType.CLASSES, classesPaths); assertModuleLibDepPath(lib, OrderRootTyp...
assertModuleLibDep
296,806
void (LibraryOrderEntry lib, OrderRootType type, List<String> paths) { assertNotNull(lib); if (paths == null) return; assertUnorderedPathsAreEqual(Arrays.asList(lib.getRootUrls(type)), paths); // also check the library because it may contain slight different set of urls (e.g. with duplicates) final Library library = li...
assertModuleLibDepPath
296,807
void (String moduleName, String depName, DependencyScope... scopes) { List<LibraryOrderEntry> deps = getModuleLibDeps(moduleName, depName); assertUnorderedElementsAreEqual(ContainerUtil.map2Array(deps, entry -> entry.getScope()), scopes); }
assertModuleLibDepScope
296,808
List<LibraryOrderEntry> (String moduleName, String depName) { return getModuleDep(moduleName, depName, LibraryOrderEntry.class); }
getModuleLibDeps
296,809
void (String moduleName, String... expectedDeps) { assertModuleDeps(moduleName, LibraryOrderEntry.class, expectedDeps); }
assertModuleLibDeps
296,810
void (BiPredicate<? super String, ? super String> predicate, String moduleName, String... expectedDeps) { assertModuleDeps(predicate, moduleName, LibraryOrderEntry.class, expectedDeps); }
assertModuleLibDeps
296,811
void (String moduleName, String... expectedDeps) { final List<String> actual = new ArrayList<>(); getRootManager(moduleName).orderEntries().withoutSdk().withoutModuleSourceEntries().exportedOnly().process(new RootPolicy<>() { @Override public Object visitModuleOrderEntry(@NotNull ModuleOrderEntry e, Object value) { act...
assertExportedDeps
296,812
Object (@NotNull ModuleOrderEntry e, Object value) { actual.add(e.getModuleName()); return null; }
visitModuleOrderEntry
296,813
Object (@NotNull LibraryOrderEntry e, Object value) { actual.add(e.getLibraryName()); return null; }
visitLibraryOrderEntry
296,814
void (String moduleName, String... expectedDeps) { assertModuleDeps(moduleName, ModuleOrderEntry.class, expectedDeps); }
assertModuleModuleDeps
296,815
void (String moduleName, Class clazz, String... expectedDeps) { assertModuleDeps(equalsPredicate(), moduleName, clazz, expectedDeps); }
assertModuleDeps
296,816
void (BiPredicate<? super String, ? super String> predicate, String moduleName, Class clazz, String... expectedDeps) { assertOrderedElementsAreEqual(predicate, collectModuleDepsNames(moduleName, clazz), expectedDeps); }
assertModuleDeps
296,817
void (String moduleName, String... expectedDeps) { assertOrderedElementsAreEqual(collectModuleDepsNames( moduleName, entry -> entry instanceof ModuleOrderEntry && ((ModuleOrderEntry)entry).isProductionOnTestDependency() ), expectedDeps); }
assertProductionOnTestDependencies
296,818
void (String moduleName, String depName, DependencyScope... scopes) { List<ModuleOrderEntry> deps = getModuleModuleDeps(moduleName, depName); assertUnorderedElementsAreEqual(ContainerUtil.map2Array(deps, entry -> entry.getScope()), scopes); }
assertModuleModuleDepScope
296,819
List<ModuleOrderEntry> (@NotNull String moduleName, @NotNull String depName) { return getModuleDep(moduleName, depName, ModuleOrderEntry.class); }
getModuleModuleDeps
296,820
List<String> (String moduleName, Predicate<? super OrderEntry> predicate) { List<String> actual = new ArrayList<>(); for (OrderEntry e : getRootManager(moduleName).getOrderEntries()) { if (predicate.test(e)) { actual.add(e.getPresentableName()); } } return actual; }
collectModuleDepsNames
296,821
List<String> (String moduleName, Class clazz) { return collectModuleDepsNames(moduleName, entry -> clazz.isInstance(entry)); }
collectModuleDepsNames
296,822
void (String... expectedNames) { List<String> actualNames = new ArrayList<>(); for (Library each : LibraryTablesRegistrar.getInstance().getLibraryTable(myProject).getLibraries()) { String name = each.getName(); actualNames.add(name == null ? "<unnamed>" : name); } assertUnorderedElementsAreEqual(actualNames, expectedNa...
assertProjectLibraries
296,823
void (String moduleName, String... expected) { String[] path = ModuleManager.getInstance(myProject).getModuleGroupPath(getModule(moduleName)); if (expected.length == 0) { assertNull(path); } else { assertNotNull(path); assertOrderedElementsAreEqual(Arrays.asList(path), expected); } }
assertModuleGroupPath
296,824
ContentEntry (String moduleName) { ContentEntry[] ee = getContentRoots(moduleName); List<String> roots = new ArrayList<>(); for (ContentEntry e : ee) { roots.add(e.getUrl()); } String message = "Several content roots found: [" + StringUtil.join(roots, ", ") + "]"; assertEquals(message, 1, ee.length); return ee[0]; }
getContentRoot
296,825
ContentEntry (String moduleName, String path) { for (ContentEntry e : getContentRoots(moduleName)) { if (e.getUrl().equals(VfsUtilCore.pathToUrl(path))) return e; } throw new AssertionError("content root not found"); }
getContentRoot
296,826
ContentEntry[] (String moduleName) { return getRootManager(moduleName).getContentEntries(); }
getContentRoots
296,827
ModuleRootManager (String module) { return ModuleRootManager.getInstance(getModule(module)); }
getRootManager
296,828
void (Predicate<? super DataNode<?>> booleanFunction, final boolean ignored) { final ExternalProjectInfo externalProjectInfo = ProjectDataManagerImpl.getInstance().getExternalProjectData( myProject, getExternalSystemId(), getCurrentExternalProjectSettings().getExternalProjectPath()); assertNotNull(externalProjectInfo);...
ignoreData
296,829
void (Boolean skipIndexing) { if (skipIndexing != null) { PlatformTestUtil.withSystemProperty("idea.skip.indices.initialization", skipIndexing.toString(), () -> doImportProject()); } else { doImportProject(); } }
importProject
296,830
void () { AbstractExternalSystemSettings systemSettings = ExternalSystemApiUtil.getSettings(myProject, getExternalSystemId()); final ExternalProjectSettings projectSettings = getCurrentExternalProjectSettings(); projectSettings.setExternalProjectPath(getProjectPath()); //noinspection unchecked Set<ExternalProjectSettin...
doImportProject
296,831
void (@Nullable final DataNode<ProjectData> externalProject) { if (externalProject == null) { System.err.println("Got null External project after import"); return; } try { ProjectDataManager.getInstance().importData(externalProject, myProject); } catch (Throwable ex) { ex.printStackTrace(System.err); error.set(Couple.o...
onSuccess
296,832
void (@NotNull String errorMessage, @Nullable String errorDetails) { error.set(Couple.of(errorMessage, errorDetails)); }
onFailure
296,833
void (@NotNull ExternalSystemTaskId id, @NotNull String text, boolean stdOut) { printOutput(text, stdOut); }
onTaskOutput
296,834
void (@NotNull String text, boolean stdOut) { if (StringUtil.isEmptyOrSpaces(text)) return; printOutput(stdOut ? System.out : System.err, text); }
printOutput
296,835
void (@NotNull PrintStream stream, @NotNull String text) { stream.print(text); }
printOutput
296,836
void (@NotNull String errorMessage, @Nullable String errorDetails) { String failureMsg = "Import failed: " + errorMessage; if (StringUtil.isNotEmpty(errorDetails)) { failureMsg += "\nError details: \n" + errorDetails; } fail(failureMsg); }
handleImportFailure
296,837
ImportSpec () { ImportSpecBuilder importSpecBuilder = new ImportSpecBuilder(myProject, getExternalSystemId()) .use(ProgressExecutionMode.MODAL_SYNC) .forceWhenUptodate(); return importSpecBuilder.build(); }
createImportSpec
296,838
Collection<UsageInfo> (@NotNull ProgressIndicator indicator) { return runInEdtAndGet(() -> { FindUsagesManager findUsagesManager = ((FindManagerImpl)FindManager.getInstance(element.getProject())).getFindUsagesManager(); FindUsagesHandler handler = findUsagesManager.getFindUsagesHandler(element, false); assertNotNull(ha...
compute
296,839
SourceFolder (@NotNull String moduleName, @NotNull String sourcePath) { return findSource(getRootManager(moduleName), sourcePath); }
findSource
296,840
SourceFolder (@NotNull ModuleRootModel moduleRootManager, @NotNull String sourcePath) { ContentEntry[] contentRoots = moduleRootManager.getContentEntries(); Module module = moduleRootManager.getModule(); String rootUrl = getAbsolutePath(ExternalSystemApiUtil.getExternalProjectPath(module)); for (ContentEntry contentRoo...
findSource
296,841
int (@NotNull Object o1, @NotNull Object o2) { int order1 = getOrder(o1); int order2 = getOrder(o2); return Integer.compare(order1, order2); }
compare
296,842
int (@NotNull Object o) { Queue<Class<?>> toCheck = new ArrayDeque<>(); toCheck.add(o.getClass()); while (!toCheck.isEmpty()) { Class<?> clazz = toCheck.poll(); Order annotation = clazz.getAnnotation(Order.class); if (annotation != null) { return annotation.value(); } Class<?> c = clazz.getSuperclass(); if (c != null) ...
getOrder
296,843
String (@NotNull String path) { String strippedPath = stripPath(path); final int i = strippedPath.lastIndexOf(PATH_SEPARATOR); final String result; if (i < 0 || i >= strippedPath.length() - 1) { result = strippedPath; } else { result = strippedPath.substring(i + 1); } return result; }
extractNameFromPath
296,844
String (@NotNull String path) { String[] endingsToStrip = {"/", "!", ".jar"}; StringBuilder buffer = new StringBuilder(path); for (String ending : endingsToStrip) { if (buffer.lastIndexOf(ending) == buffer.length() - ending.length()) { buffer.setLength(buffer.length() - ending.length()); } } return buffer.toString(); }
stripPath
296,845
String (@NotNull Library library) { final String result = library.getName(); if (result != null) { return result; } for (OrderRootType type : OrderRootType.getAllTypes()) { for (String url : library.getUrls(type)) { String candidate = extractNameFromPath(url); if (!StringUtil.isEmpty(candidate)) { return candidate; } }...
getLibraryName
296,846
boolean (@NotNull Library library, @NotNull LibraryData libraryData) { return getLibraryName(library).equals(libraryData.getInternalName()); }
isRelated
296,847
boolean (@NotNull Library library, @NotNull ProjectSystemId externalSystemId) { return library.getName() != null && StringUtil.startsWithIgnoreCase(library.getName(), externalSystemId.getId() + ": "); }
isExternalSystemLibrary
296,848
void (@NotNull List<?> data) { data.sort(ORDER_AWARE_COMPARATOR); }
orderAwareSort
296,849
String (@NotNull String path) { String p = normalizePath(path); assert p != null; return FileUtil.toCanonicalPath(p); }
toCanonicalPath
296,850
String (@NotNull VirtualFile file) { if (FileTypeRegistry.getInstance().isFileOfType(file, ArchiveFileType.INSTANCE)) { final VirtualFile jar = JarFileSystem.getInstance().getVirtualFileForJar(file); if (jar != null) { return jar.getPath(); } } return toCanonicalPath(file.getPath()); }
getLocalFileSystemPath
296,851
void (@Nullable DataNode<?> originalNode, @NotNull Consumer<? super DataNode<?>> consumer) { if (originalNode != null) { originalNode.visit(consumer); } }
visit
296,852
void (final @NotNull DisposeAwareProjectChange task) { executeProjectChangeAction(true, task); }
executeProjectChangeAction
296,853
void (boolean synchronous, final @NotNull DisposeAwareProjectChange task) { if (!ApplicationManager.getApplication().isDispatchThread()) { TransactionGuard.getInstance().assertWriteSafeContext(ModalityState.defaultModalityState()); } executeOnEdt(synchronous, () -> ApplicationManager.getApplication().runWriteAction(tas...
executeProjectChangeAction
296,854
void (boolean synchronous, @NotNull Runnable task) { final Application app = ApplicationManager.getApplication(); if (app.isDispatchThread()) { task.run(); return; } if (synchronous) { app.invokeAndWait(task); } else { app.invokeLater(task); } }
executeOnEdt
296,855
void (final @NotNull Runnable task) { executeOnEdt(true, () -> ApplicationManager.getApplication().runWriteAction(task)); }
doWriteAction
296,856
void (final Runnable runnable) { final Application application = ApplicationManager.getApplication(); final boolean unitTestMode = application.isUnitTestMode(); if (unitTestMode) { UIUtil.invokeLaterIfNeeded(runnable); } else if (application.isHeadlessEnvironment() || application.isDispatchThread()) { runnable.run(); }...
addToInvokeLater
296,857
boolean (@NotNull Project ideProject, @NotNull ProjectData projectData, Module[] modules) { String linkedExternalProjectPath = null; for (ExternalSystemManager<?, ?, ?, ?, ?> manager : ExternalSystemManager.EP_NAME.getIterable()) { ProjectSystemId externalSystemId = manager.getSystemId(); AbstractExternalSystemSettings...
isOneToOneMapping
296,858
boolean (ProjectSystemId externalSystemId) { return Registry.is(externalSystemId.getId() + ExternalSystemConstants.USE_IN_PROCESS_COMMUNICATION_REGISTRY_KEY_SUFFIX, false); }
isInProcessMode
296,859
ProjectModelExternalSource (@NotNull ProjectSystemId systemId) { return ExternalProjectSystemRegistry.getInstance().getSourceById(systemId.getId()); }
toExternalSource
296,860
boolean (@NotNull ProjectSystemId systemId, @Nullable Module module) { return module != null && !module.isDisposed() && systemId.getId().equals(ExternalSystemModulePropertyManager.getInstance(module).getExternalSystemId()); }
isExternalSystemAwareModule
296,861
boolean (@NotNull String systemId, @Nullable Module module) { return module != null && !module.isDisposed() && systemId.equals(ExternalSystemModulePropertyManager.getInstance(module).getExternalSystemId()); }
isExternalSystemAwareModule
296,862
void (@NotNull Project project, @NotNull ProjectSystemId systemId, @NotNull ExternalSystemSettingsListener listener) { //noinspection unchecked getSettings(project, systemId).subscribe(listener, project); }
subscribe
296,863
void (@NotNull Project project, @NotNull ProjectSystemId systemId, @NotNull ExternalSystemSettingsListener listener, @NotNull Disposable parentDisposable) { //noinspection unchecked getSettings(project, systemId).subscribe(listener, parentDisposable); }
subscribe
296,864
Collection<TaskData> ( @NotNull Project project, @NotNull ProjectSystemId systemId, @NotNull String projectPath ) { var moduleDataNode = findModuleNode(project, systemId, projectPath); if (moduleDataNode == null) return Collections.emptyList(); var taskNodes = findAll(moduleDataNode, ProjectKeys.TASK); return Container...
findProjectTasks
296,865
FileChooserDescriptor (@NotNull ProjectSystemId systemId) { ExternalSystemManager<?, ?, ?, ?, ?> manager = getManager(systemId); if (manager instanceof ExternalSystemUiAware uiAware) { FileChooserDescriptor descriptor = uiAware.getExternalProjectConfigDescriptor(); if (descriptor != null) { return descriptor; } } retur...
getExternalProjectConfigDescriptor
296,866
String () { return myIdeProjectName; }
getIdeProjectName
296,867
String () { return myIdeProjectLocationHash; }
getIdeProjectLocationHash
296,868
ProjectSystemId () { return myExternalSystemId; }
getExternalSystemId
296,869
String () { return myExternalProjectConfigPath; }
getExternalProjectConfigPath
296,870
int () { int result = myIdeProjectName.hashCode(); result = 31 * result + myIdeProjectLocationHash.hashCode(); result = 31 * result + myExternalSystemId.hashCode(); result = 31 * result + myExternalProjectConfigPath.hashCode(); return result; }
hashCode
296,871
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; IntegrationKey key = (IntegrationKey)o; if (!myExternalSystemId.equals(key.myExternalSystemId)) return false; if (!myIdeProjectLocationHash.equals(key.myIdeProjectLocationHash)) return false; if (!myIdeProjectNam...
equals
296,872
String () { return String.format("%s project '%s'", StringUtil.toLowerCase(myExternalSystemId.toString()), myIdeProjectName); }
toString
296,873
void () { if (!myComponentManager.isDisposed()) { execute(); } }
run
296,874
void () {}
onSuccess
296,875
void () {}
onFailure
296,876
Set<String> () { return myModules == null ? Collections.emptySet() : myModules; }
getModules
296,877
void (@Nullable Set<String> modules) { this.myModules = modules; }
setModules
296,878
void () { myUseQualifiedModuleNames = true; }
setupNewProjectDefault
296,879
String () { return myExternalProjectPath; }
getExternalProjectPath
296,880
void (@NotNull String externalProjectPath) { myExternalProjectPath = externalProjectPath; }
setExternalProjectPath
296,881
boolean () { return myCreateEmptyContentRootDirectories; }
isCreateEmptyContentRootDirectories
296,882
void (boolean createEmptyContentRootDirectories) { myCreateEmptyContentRootDirectories = createEmptyContentRootDirectories; }
setCreateEmptyContentRootDirectories
296,883
boolean () { return myUseQualifiedModuleNames; }
isUseQualifiedModuleNames
296,884
void (boolean useQualifiedModuleNames) { myUseQualifiedModuleNames = useQualifiedModuleNames; }
setUseQualifiedModuleNames
296,885
int (@NotNull ExternalProjectSettings that) { return Comparing.compare(myExternalProjectPath, that.myExternalProjectPath); }
compareTo
296,886
int () { return myExternalProjectPath != null ? myExternalProjectPath.hashCode() : 0; }
hashCode
296,887
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ExternalProjectSettings that = (ExternalProjectSettings)o; return myExternalProjectPath == null ? that.myExternalProjectPath == null : myExternalProjectPath.equals(that.myExternalProjectPath); }
equals
296,888
String () { return myExternalProjectPath; }
toString
296,889
void (@NotNull ExternalProjectSettings receiver) { receiver.myExternalProjectPath = myExternalProjectPath; receiver.myModules = myModules != null ? new HashSet<>(myModules) : new HashSet<>(); receiver.myCreateEmptyContentRootDirectories = myCreateEmptyContentRootDirectories; receiver.myUseQualifiedModuleNames = myUseQu...
copyTo
296,890
void (@NotNull String oldName, @NotNull String newName) { myDelegate.onProjectRenamed(oldName, newName); }
onProjectRenamed
296,891
void (@NotNull Collection<S> settings) { myDelegate.onProjectsLoaded(settings); }
onProjectsLoaded
296,892
void (@NotNull Collection<S> settings) { myDelegate.onProjectsLinked(settings); }
onProjectsLinked
296,893
void (@NotNull Set<String> linkedProjectPaths) { myDelegate.onProjectsUnlinked(linkedProjectPaths); }
onProjectsUnlinked
296,894
void () { myDelegate.onBulkChangeStart(); }
onBulkChangeStart
296,895
void () { myDelegate.onBulkChangeEnd(); }
onBulkChangeEnd
296,896
void (@NotNull Set<String> linkedProjectPathsToForget) { Map<ExternalProjectPojo, Collection<ExternalProjectPojo>> projects = state.availableProjects; for (Iterator<Map.Entry<ExternalProjectPojo, Collection<ExternalProjectPojo>>> it = projects.entrySet().iterator(); it.hasNext(); ) { Map.Entry<ExternalProjectPojo, Coll...
forgetExternalProjects
296,897
void (@NotNull Map<ExternalProjectPojo, Collection<ExternalProjectPojo>> projects) { state.availableProjects = projects; }
setAvailableProjects
296,898
List<ExternalTaskExecutionInfo> () { return ContainerUtil.notNullize(state.recentTasks); }
getRecentTasks
296,899
S () { return state; }
getState