Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
252,800
DirectoryIndex (Project project) { // todo enable later when all usages will be fixed //assert !project.isDefault() : "Must not call DirectoryIndex for default project"; return project.getService(DirectoryIndex.class); }
getInstance
252,801
Query<VirtualFile> (@NotNull String packageName, @NotNull GlobalSearchScope scope) { return getDirectoriesByPackageName(packageName, true).filtering(scope::contains); }
getDirectoriesByPackageName
252,802
void () { if (myRootsDisposable != null) { Disposer.dispose(myRootsDisposable); } if (!Disposer.isDisposed(myParentDisposable)) { Disposer.register(myParentDisposable, myRootsDisposable = Disposer.newDisposable()); } }
disposePointers
252,803
VirtualFilePointerContainer (@NotNull Collection<String> urls) { // optimization: avoid creating heavy container for empty list, use 'EMPTY' stub for that case VirtualFilePointerContainer container; if (urls.isEmpty()) { container = EMPTY; } else { container = VirtualFilePointerManager.getInstance().createContainer(myR...
createContainer
252,804
VirtualFilePointerContainer (@NotNull OrderRootType rootType, int flags, @NotNull Supplier<? extends Collection<String>> rootUrlsComputer) { ConcurrentMap<CacheKey, VirtualFilePointerContainer> map = myRoots.get(); CacheKey key = new CacheKey(rootType, flags); VirtualFilePointerContainer cached = map == null ? null : m...
getOrComputeContainer
252,805
void () { ApplicationManager.getApplication().assertWriteIntentLockAcquired(); disposePointers(); myRoots.set(null); }
clearCache
252,806
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CacheKey cacheKey = (CacheKey)o; return myFlags == cacheKey.myFlags && myRootType.equals(cacheKey.myRootType); }
equals
252,807
int () { return 31 * myRootType.hashCode() + myFlags; }
hashCode
252,808
boolean () { return myFiletypes; }
isCausedByFileTypesChange
252,809
boolean () { return myInFromWorkspaceModelOnly; }
isCausedByWorkspaceModelChangesOnly
252,810
List<VirtualFile> (@NotNull JpsModuleSourceRootType<?> rootType) { return getSourceRoots(Collections.singleton(rootType)); }
getSourceRoots
252,811
List<VirtualFile> (@NotNull Set<? extends JpsModuleSourceRootType<?>> rootTypes) { List<VirtualFile> result = new SmartList<>(); for (ContentEntry contentEntry : getContent()) { final List<SourceFolder> sourceFolders = contentEntry.getSourceFolders(rootTypes); for (SourceFolder sourceFolder : sourceFolders) { final Vir...
getSourceRoots
252,812
Sdk () { for (OrderEntry orderEntry : getOrderEntries()) { if (orderEntry instanceof JdkOrderEntry) { return ((JdkOrderEntry)orderEntry).getJdk(); } } return null; }
getSdk
252,813
boolean () { for (OrderEntry orderEntry : getOrderEntries()) { if (orderEntry instanceof InheritedJdkOrderEntry) { return true; } } return false; }
isSdkInherited
252,814
OrderEnumerator () { return new ModuleOrderEnumerator(this, null); }
orderEntries
252,815
List<String> (@NotNull ModuleOrderEntry moduleOrderEntry, @NotNull List<String> arrayList) { arrayList.add(moduleOrderEntry.getModuleName()); return arrayList; }
visitModuleOrderEntry
252,816
void () { myDisposed = true; myRootIndex = null; }
dispose
252,817
void () { myConnection.subscribe(VirtualFileManager.VFS_CHANGES, new BulkFileListener() { @Override public void after(@NotNull List<? extends @NotNull VFileEvent> events) { RootIndex rootIndex = myRootIndex; if (rootIndex != null && shouldResetOnEvents(events)) { for (VFileEvent event : events) { if (isIgnoredFileCreat...
subscribeToFileChanges
252,818
void (@NotNull List<? extends @NotNull VFileEvent> events) { RootIndex rootIndex = myRootIndex; if (rootIndex != null && shouldResetOnEvents(events)) { for (VFileEvent event : events) { if (isIgnoredFileCreated(event)) { reset(); break; } } } }
after
252,819
boolean (@NotNull List<? extends VFileEvent> events) { for (VFileEvent event : events) { // VFileCreateEvent.getFile() is expensive if (event instanceof VFileCreateEvent) { if (((VFileCreateEvent)event).isDirectory()) return true; } else { VirtualFile file = event.getFile(); if (file == null || file.isDirectory()) { re...
shouldResetOnEvents
252,820
boolean (@NotNull VFileEvent event) { return event instanceof VFileMoveEvent && FileTypeRegistry.getInstance().isFileIgnored(((VFileMoveEvent)event).getNewParent()) || event instanceof VFilePropertyChangeEvent && ((VFilePropertyChangeEvent)event).getPropertyName().equals(VirtualFile.PROP_NAME) && FileTypeRegistry.getIn...
isIgnoredFileCreated
252,821
Query<VirtualFile> (@NotNull String packageName, boolean includeLibrarySources) { return myWorkspaceFileIndex.getDirectoriesByPackageName(packageName, includeLibrarySources); }
getDirectoriesByPackageName
252,822
Query<VirtualFile> (@NotNull String packageName, @NotNull GlobalSearchScope scope) { return myWorkspaceFileIndex.getDirectoriesByPackageName(packageName, scope); }
getDirectoriesByPackageName
252,823
DirectoryInfo (@NotNull VirtualFile file) { return new DirectoryInfo() { @Override public @Nullable VirtualFile getContentRoot() { return myWorkspaceFileIndex.getContentFileSetRoot(file, true); } }; }
getInfoForFile
252,824
String (@NotNull VirtualFile dir) { checkAvailability(); return myWorkspaceFileIndex.getPackageName(dir); }
getPackageName
252,825
List<OrderEntry> (@NotNull VirtualFile fileOrDir) { checkAvailability(); if (myProject.isDefault()) return Collections.emptyList(); WorkspaceFileInternalInfo fileInfo = myWorkspaceFileIndex.getFileInfo(fileOrDir, true, true, true, true, false); WorkspaceFileSetWithCustomData<?> fileSet = fileInfo.findFileSet(data -> tr...
getOrderEntries
252,826
Set<String> (@NotNull Module module) { checkAvailability(); return getRootIndex().getDependentUnloadedModules(module); }
getDependentUnloadedModules
252,827
void () { ApplicationManager.getApplication().assertReadAccessAllowed(); if (myDisposed) { ProgressManager.checkCanceled(); LOG.error("Directory index is already disposed for " + myProject); } }
checkAvailability
252,828
Sdk (@NotNull String name, @NotNull String sdkType) { return null; }
findSdk
252,829
String (boolean plural) { return ProjectModelBundle.message("module.library.display.name", plural ? 2 : 1); }
getDisplayName
252,830
String () { return ProjectModelBundle.message("libraries.node.text.module"); }
getDescription
252,831
String () { return ProjectModelBundle.message("library.configure.module.title"); }
getLibraryTableEditorTitle
252,832
Library () { return createLibrary(null); }
createLibrary
252,833
Library (String name) { return createLibrary(name, null); }
createLibrary
252,834
Library (String name, @Nullable PersistentLibraryKind<?> type) { return createLibrary(name, type, null); }
createLibrary
252,835
String () { return LibraryTableImplUtil.MODULE_LEVEL; }
getTableLevel
252,836
LibraryTablePresentation () { return MODULE_LIBRARY_TABLE_PRESENTATION; }
getPresentation
252,837
Library (@NotNull String name) { final Iterator<Library> libraryIterator = getLibraryIterator(); while (libraryIterator.hasNext()) { Library library = libraryIterator.next(); if (name.equals(library.getName())) return library; } return null; }
getLibraryByName
252,838
void (@NotNull Listener listener) { throw new UnsupportedOperationException(); }
addListener
252,839
void (@NotNull Listener listener, @NotNull Disposable parentDisposable) { throw new UnsupportedOperationException("Method addListener is not yet implemented in " + getClass().getName()); }
addListener
252,840
void (@NotNull Listener listener) { throw new UnsupportedOperationException(); }
removeListener
252,841
void () { }
commit
252,842
void () { }
dispose
252,843
ModifiableModel () { return this; }
getModifiableModel
252,844
boolean (@NotNull Module module) { return module.getOptionValue(JpsProjectLoader.CLASSPATH_ATTRIBUTE) != null; }
isClasspathStorage
252,845
LibraryTable (Project project) { return project.getService(ProjectLibraryTable.class); }
getInstance
252,846
ProjectModelExternalSource (@NotNull Element element) { @Nullable String externalSourceId = element.getAttributeValue(SerializationConstants.EXTERNAL_SYSTEM_ID_ATTRIBUTE); return externalSourceId != null ? ExternalProjectSystemRegistry.getInstance().getSourceById(externalSourceId) : null; }
findExternalSource
252,847
Set<OrderRootType> () { Set<OrderRootType> rootTypes = ContainerUtil.newHashSet(OrderRootType.getAllTypes()); if (myKind != null) { rootTypes.addAll(Arrays.asList(myKind.getAdditionalRootTypes())); } return rootTypes; }
getAllRootTypes
252,848
void () { checkDisposed(); myDisposed = true; kill(null); }
dispose
252,849
void () { if (isDisposed()) { throwDisposalError("'" + myName + "' already disposed: " + getStackTrace()); } }
checkDisposed
252,850
boolean () { return myDisposed; }
isDisposed
252,851
String () { return myName; }
getName
252,852
String () { return getPresentableName(this); }
getPresentableName
252,853
void (String name) { LOG.assertTrue(isWritable()); myName = name; }
setName
252,854
ModifiableModelEx () { checkDisposed(); return new LibraryImpl(this, this, myRootModel); }
getModifiableModel
252,855
List<String> (@NotNull OrderRootType type) { if (myDisposed) return Collections.emptyList(); VirtualFilePointerContainer container = myRoots.get(type); final List<VirtualFilePointer> pointers = container == null ? Collections.emptyList() : container.getList(); List<String> invalidPaths = null; for (VirtualFilePointer p...
getInvalidRootUrls
252,856
void (LibraryProperties properties) { LOG.assertTrue(isWritable()); if (myKind == null) { if (properties != null && !(properties instanceof DummyLibraryProperties)) { LOG.error("Cannot set properties for library with default type"); } return; } myProperties = properties; }
setProperties
252,857
RootProvider () { return this; }
getRootProvider
252,858
VirtualFilePointerListener () { if (myRootPointerListener == null) { myRootPointerListener = new LibraryRootPointerListener(); } return myRootPointerListener; }
getListener
252,859
ProjectModelExternalSource () { return myExternalSource; }
getExternalSource
252,860
VirtualFilePointerContainer (@NotNull OrderRootType rootType) { VirtualFilePointerContainer roots = myRoots.get(rootType); if (roots == null) { roots = VirtualFilePointerManager.getInstance().createContainer(myPointersDisposable, getListener()); myRoots.put(rootType, roots); } return roots; }
getOrCreateContainer
252,861
void (@NotNull Element element) { final List<Element> jarDirs = element.getChildren(VirtualFilePointerContainerImpl.JAR_DIRECTORY_ELEMENT); for (Element jarDir : jarDirs) { final String url = jarDir.getAttributeValue(VirtualFilePointerContainerImpl.URL_ATTR); if (url != null) { final String recursive = jarDir.getAttrib...
readJarDirectories
252,862
OrderRootType (@Nullable String type) { for (PersistentOrderRootType rootType : OrderRootType.getAllPersistentTypes()) { if (rootType.name().equals(type)) { return rootType; } } return DEFAULT_JAR_DIRECTORY_TYPE; }
getJarDirectoryRootType
252,863
void (@NotNull Element element) { final String typeId = element.getAttributeValue(JpsLibraryTableSerializer.TYPE_ATTRIBUTE); if (typeId == null) return; myKind = (PersistentLibraryKind<?>)LibraryKindRegistry.getInstance().findKindById(typeId); final Element propertiesElement = element.getChild(JpsLibraryTableSerializer...
readProperties
252,864
void (@NotNull Element element) { myName = element.getAttributeValue(JpsLibraryTableSerializer.NAME_ATTRIBUTE); }
readName
252,865
VirtualFilePointerContainer () { VirtualFilePointerContainer excludedRoots = myExcludedRoots; if (excludedRoots == null) { myExcludedRoots = excludedRoots = VirtualFilePointerManager.getInstance().createContainer(myPointersDisposable); } return excludedRoots; }
getOrCreateExcludedRoots
252,866
List<OrderRootType> (@NotNull Collection<? extends OrderRootType> rootTypes) { List<OrderRootType> allTypes = new ArrayList<>(rootTypes); allTypes.sort((o1, o2) -> o1.name().compareToIgnoreCase(o2.name())); return allTypes; }
sortRootTypes
252,867
void (Element rootElement) { checkDisposed(); Element element = new Element(JpsLibraryTableSerializer.LIBRARY_TAG); if (myName != null) { element.setAttribute(JpsLibraryTableSerializer.NAME_ATTRIBUTE, myName); } if (myKind != null) { element.setAttribute(JpsLibraryTableSerializer.TYPE_ATTRIBUTE, myKind.getKindId()); LO...
writeExternal
252,868
void (@NotNull Element element) { final List<OrderRootType> rootTypes = sortRootTypes(myRoots.keySet()); for (OrderRootType rootType : rootTypes) { VirtualFilePointerContainer container = myRoots.get(rootType); List<Pair<String, Boolean>> jarDirectories = new ArrayList<>(container.getJarDirectories()); jarDirectories.s...
writeJarDirectories
252,869
boolean () { return mySource != null; }
isWritable
252,870
void (@NotNull ProjectModelExternalSource externalSource) { myExternalSource = externalSource; }
setExternalSource
252,871
void () { if (myKind == null) return; myKind = UnknownLibraryKind.getOrCreate(myKind.getKindId()); Object propertiesState = myProperties.getState(); if (propertiesState != null) { UnknownLibraryKind.UnknownLibraryProperties properties = new UnknownLibraryKind.UnknownLibraryProperties(); properties.setConfiguration(XmlS...
forgetKind
252,872
void () { if (myKind == null || !(myKind instanceof UnknownLibraryKind)) return; myKind = (PersistentLibraryKind<?>)LibraryKindRegistry.getInstance().findKindById(myKind.getKindId()); Element configuration = ((UnknownLibraryKind.UnknownLibraryProperties)myProperties).getConfiguration(); myProperties = myKind.createDefa...
restoreKind
252,873
void (@NotNull String url) { VirtualFilePointerContainer roots = getOrCreateExcludedRoots(); if (roots.findByUrl(url) == null) { roots.add(url); } }
addExcludedRoot
252,874
boolean (@NotNull String url) { if (myExcludedRoots != null) { VirtualFilePointer pointer = myExcludedRoots.findByUrl(url); if (pointer != null) { myExcludedRoots.remove(pointer); return true; } } return false; }
removeExcludedRoot
252,875
LibraryProperties () { return myProperties; }
getProperties
252,876
void (@Nullable PersistentLibraryKind<?> kind) { LOG.assertTrue(isWritable()); myKind = kind; myProperties = kind != null ? kind.createDefaultProperties() : null; }
setKind
252,877
void (@NotNull String url, @NotNull OrderRootType rootType) { checkDisposed(); LOG.assertTrue(isWritable()); final VirtualFilePointerContainer container = getOrCreateContainer(rootType); container.add(url); }
addRoot
252,878
void (@NotNull VirtualFile file, @NotNull OrderRootType rootType) { checkDisposed(); LOG.assertTrue(isWritable()); final VirtualFilePointerContainer container = getOrCreateContainer(rootType); container.add(file); }
addRoot
252,879
void (@NotNull final String url, final boolean recursive) { addJarDirectory(url, recursive, OrderRootType.CLASSES); }
addJarDirectory
252,880
void (@NotNull final VirtualFile file, final boolean recursive) { addJarDirectory(file, recursive, OrderRootType.CLASSES); }
addJarDirectory
252,881
void (@NotNull final String url, final boolean recursive, @NotNull OrderRootType rootType) { checkDisposed(); LOG.assertTrue(isWritable()); final VirtualFilePointerContainer container = getOrCreateContainer(rootType); container.addJarDirectory(url, recursive); }
addJarDirectory
252,882
void (@NotNull final VirtualFile file, final boolean recursive, @NotNull OrderRootType rootType) { checkDisposed(); LOG.assertTrue(isWritable()); final VirtualFilePointerContainer container = getOrCreateContainer(rootType); container.addJarDirectory(file.getUrl(), recursive); }
addJarDirectory
252,883
boolean (@NotNull final String url) { return isJarDirectory(url, OrderRootType.CLASSES); }
isJarDirectory
252,884
boolean (@NotNull final String url, @NotNull final OrderRootType rootType) { VirtualFilePointerContainer container = myRoots.get(rootType); if (container == null) return false; List<Pair<String, Boolean>> jarDirectories = container.getJarDirectories(); return jarDirectories.contains(Pair.create(url, false)) || jarDirec...
isJarDirectory
252,885
boolean (@NotNull final String url, @NotNull final OrderRootType rootType) { final VirtualFilePointerContainer container = myRoots.get(rootType); final VirtualFilePointer fp = container == null ? null : container.findByUrl(url); return fp != null && fp.isValid(); }
isValid
252,886
boolean (@NotNull Library library) { return this.equals(library); }
hasSameContent
252,887
boolean (@NotNull String url, @NotNull OrderRootType rootType) { checkDisposed(); LOG.assertTrue(isWritable()); final VirtualFilePointerContainer container = myRoots.get(rootType); final VirtualFilePointer byUrl = container == null ? null : container.findByUrl(url); if (byUrl != null) { container.remove(byUrl); if (myE...
removeRoot
252,888
boolean (@NotNull String url) { for (VirtualFilePointerContainer container : myRoots.values()) { if (VfsUtilCore.isUnder(url, Arrays.asList(container.getUrls()))) { return true; } } return false; }
isUnderRoots
252,889
void (@NotNull String url, @NotNull OrderRootType rootType) { checkDisposed(); LOG.assertTrue(isWritable()); final VirtualFilePointerContainer container = myRoots.get(rootType); if (container != null) { container.moveUp(url); } }
moveRootUp
252,890
void (@NotNull String url, @NotNull OrderRootType rootType) { checkDisposed(); LOG.assertTrue(isWritable()); final VirtualFilePointerContainer container = myRoots.get(rootType); if (container != null) { container.moveDown(url); } }
moveRootDown
252,891
boolean () { return !mySource.equals(this); }
isChanged
252,892
boolean (@NotNull LibraryImpl that) { return !that.equals(this); }
areRootsChanged
252,893
Library () { return mySource; }
getSource
252,894
void () { checkDisposed(); if (isChanged()) { mySource.commit(this); } Disposer.dispose(this); }
commit
252,895
void (@NotNull LibraryImpl fromModel) { if (myLibraryTable != null) { ApplicationManager.getApplication().assertWriteAccessAllowed(); } if (!Objects.equals(fromModel.myName, myName)) { String oldName = myName; myName = fromModel.myName; if (myLibraryTable instanceof LibraryTableBase) { ((LibraryTableBase)myLibraryTable...
commit
252,896
void (@NotNull LibraryImpl fromModel) { Map<OrderRootType, VirtualFilePointerContainer> clonedRoots = new HashMap<>(); for (Map.Entry<OrderRootType, VirtualFilePointerContainer> entry : fromModel.myRoots.entrySet()) { OrderRootType rootType = entry.getKey(); VirtualFilePointerContainer container = entry.getValue(); Vir...
copyRootsFrom
252,897
void () { for (VirtualFilePointerContainer container : new HashSet<>(myRoots.values())) { container.killAll(); } if (myExcludedRoots != null) { myExcludedRoots.killAll(); } Disposer.dispose(myPointersDisposable); Disposer.register(this, myPointersDisposable); }
disposeMyPointers
252,898
LibraryTable () { return myLibraryTable; }
getTable
252,899
boolean (final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; final LibraryImpl library = (LibraryImpl)o; if (!Objects.equals(myName, library.myName)) return false; if (!myRoots.equals(library.myRoots)) return false; if (!Objects.equals(myKind, library.myKind)) return...
equals