Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
252,300
void (@NotNull Throwable e) { ((StubIndexEx)StubIndex.getInstance()).initializationFailed(e); }
handleInitializationError
252,301
IndexingStampInfo (@NotNull FileContent content) { VirtualFile file = content.getFile(); boolean isBinary = file.getFileType().isBinary(); int contentLength = isBinary ? -1 : content.getPsiFile().getTextLength(); long byteLength = file.getLength(); return new IndexingStampInfo(file.getTimeStamp(), byteLength, contentLe...
calculateIndexingStamp
252,302
StubUpdatableIndexFactory () { return ApplicationManager.getApplication().getService(StubUpdatableIndexFactory.class); }
getInstance
252,303
Collection<Integer> () { return myCurrentTree != null ? Collections.singleton(myInputId) : Collections.emptySet(); }
getKeys
252,304
boolean (@NotNull SerializedStubTree newSerializedStubTree, @NotNull SerializedStubTree currentTree) { return Arrays.equals(currentTree.getTreeHash(), newSerializedStubTree.getTreeHash()) && treesAreReallyEqual(newSerializedStubTree, currentTree); }
treesAreEqual
252,305
boolean (@NotNull SerializedStubTree newSerializedStubTree, @NotNull SerializedStubTree currentTree) { if (newSerializedStubTree.equals(currentTree)) { return true; } if (IndexDebugProperties.DEBUG) { reportStubTreeHashCollision(newSerializedStubTree, currentTree); } return false; }
treesAreReallyEqual
252,306
void (@Nullable SerializedStubTree newTree) { try { Map<StubIndexKey<?, ?>, Map<Object, StubIdList>> oldForwardIndex = myCurrentTree == null ? Collections.emptyMap() : myCurrentTree.getStubIndicesValueMap(); Map<StubIndexKey<?, ?>, Map<Object, StubIdList>> newForwardIndex = newTree == null ? Collections.emptyMap() : ne...
updateStubIndices
252,307
void (@NotNull SerializedStubTree newTree, @NotNull SerializedStubTree existingTree) { String oldTreeDump = "\nexisting tree " + dumpStub(existingTree); String newTreeDump = "\nnew tree " + dumpStub(newTree); byte[] hash = newTree.getTreeHash(); LOG.info("Stub tree hashing collision. " + "Different trees have the same ...
reportStubTreeHashCollision
252,308
String (@NotNull SerializedStubTree tree) { String deserialized; try { deserialized = "stub: " + DebugUtil.stubTreeToString(tree.getStub()); } catch (SerializerNotFoundException e) { LOG.error(e); deserialized = "error while stub deserialization: " + e.getMessage(); } return deserialized + "\n bytes: " + StringUtil.toH...
dumpStub
252,309
void (final VirtualFile file) { if (SKIP_INDEX_REPAIR_ON_ERROR) return; Set<VirtualFile> set = myFilesHavingProblems.get(); if (set == null) { myFilesHavingProblems.set(set = new HashSet<>()); } set.add(file); }
onInternalError
252,310
void () { // initialize stub index keys for (StubIndexExtension<?, ?> extension : StubIndexExtension.EP_NAME.getExtensionList()) { extension.getKey(); } }
initExtensions
252,311
boolean (int id, Void value) { if (finalIdFilter == null || finalIdFilter.containsFileId(id)) { if (result == null) { result = new IntLinkedOpenHashSet(); } result.add(id); } return true; }
perform
252,312
void () { StubIndexKeyDescriptorCache.INSTANCE.clear(); ((SerializationManagerImpl)SerializationManagerEx.getInstanceEx()).dropSerializerData(); myCachedStubIds.clear(); }
clearState
252,313
boolean () { return true; }
dependsOnFileContent
252,314
boolean () { return false; }
needsForwardIndexWhenSharing
252,315
KeyDescriptor<K> () { return extension.getKeyDescriptor(); }
getKeyDescriptor
252,316
DataExternalizer<Void> () { return VoidDataExternalizer.INSTANCE; }
getValueExternalizer
252,317
int () { return extension.getVersion(); }
getVersion
252,318
boolean () { return extension instanceof StringStubIndexExtension && ((StringStubIndexExtension<?>)extension).traceKeyHashToVirtualFileMapping(); }
traceKeyHashToVirtualFileMapping
252,319
boolean () { return myStubProcessingHelper.areAllProblemsProcessedInTheCurrentThread(); }
areAllProblemsProcessedInTheCurrentThread
252,320
void () { myCachedStubIds.clear(); }
cleanCaches
252,321
int (byte[] object) { return Arrays.hashCode(object); }
hashCode
252,322
boolean (byte[] o1, byte[] o2) { return Arrays.equals(o1, o2); }
equals
252,323
SerializationManagerEx () { return ApplicationManager.getApplication().getService(SerializationManagerEx.class); }
getInstanceEx
252,324
StubStringInterner () { return ApplicationManager.getApplication().getService(StubStringInterner.class); }
getInstance
252,325
void () { }
dispose
252,326
List<StubbedSpine> (PsiFile psiFile) { if (!(psiFile instanceof PsiFileImpl) && psiFile instanceof PsiFileWithStubSupport) { return Collections.singletonList(((PsiFileWithStubSupport)psiFile).getStubbedSpine()); } return ContainerUtil.map(StubTreeBuilder.getStubbedRoots(psiFile.getViewProvider()), t -> ((PsiFileImpl)t....
getAllSpines
252,327
PsiElement (List<? extends StubbedSpine> spines, int index) { if (spines.size() == 1) return spines.get(0).getStubPsi(index); for (StubbedSpine spine : spines) { int count = spine.getStubCount(); if (index < count) { return spine.getStubPsi(index); } index -= count; } return null; }
getStubPsi
252,328
void (@Nullable ObjectStubTree stubTree, @NotNull PsiFileWithStubSupport psiFile, @NotNull String extraMessage) { try { IndexStatisticGroup.reportStubIndexInconsistencyRegistered(psiFile.getProject()); StubTextInconsistencyException.checkStubTextConsistency(psiFile); LOG.error(extraMessage + "\n" + StubTreeLoader.getIn...
inconsistencyDetected
252,329
String (@NotNull VirtualFile file, @NotNull Project project) { return "file = "+file + (file.isValid() ? "" : " (invalid)") +", " + "file type = " + file.getFileType() + ", " + "indexed file type = " + FileTypeIndex.getIndexedFileType(file, project); }
getFileTypeInfo
252,330
void (int parentIndex, int index, int start, IElementType type) { parentsAndStarts.add(parentIndex); parentsAndStarts.add(start); stubList.addLazyStub(type, index, parentIndex); }
addStub
252,331
void () { if (myInitialized.get()) return; doInitialize(); }
initialize
252,332
void () { try { // we need to cache last id -> String mappings due to StringRefs and stubs indexing that initially creates stubs (doing enumerate on String) // and then index them (valueOf), also similar string items are expected to be enumerated during stubs processing StubSerializerEnumerator enumerator = new StubSer...
doInitialize
252,333
boolean () { return myNameStorageCrashed.get(); }
isNameStorageCorrupted
252,334
void (@NotNull Exception corruptionCause) { if (myNameStorageCrashed.getAndSet(false)) { if (myUnmodifiable) { LOG.error("Data provided by unmodifiable serialization manager can be invalid after repair"); } LOG.info("Name storage is repaired"); StubSerializerEnumerator enumerator = mySerializerEnumerator; if (enumerato...
repairNameStorage
252,335
void (ObjectStubSerializer<?, ? extends Stub> serializer) { registerSerializer(serializer.getExternalId(), () -> serializer); }
registerSerializer
252,336
void () { nameStorageCrashed(); repairNameStorage(new Exception("Indexes are requested to rebuild")); }
reinitializeNameStorage
252,337
void () { myNameStorageCrashed.set(true); }
nameStorageCrashed
252,338
void () { performShutdown(); }
dispose
252,339
void () { if (!myInitialized.compareAndSet(true, false)) { return; // already shut down } String name = myOpenFile != null ? myOpenFile.toString() : "in-memory storage"; if (!myUnmodifiable) { LOG.info("Start shutting down " + name); } try { mySerializerEnumerator.close(); if (!myUnmodifiable) { LOG.info("Finished shut...
performShutdown
252,340
void (@NotNull String externalId, @NotNull Supplier<? extends ObjectStubSerializer<?, ? extends Stub>> lazySerializer) { try { mySerializerEnumerator.assignId(lazySerializer, externalId); } catch (IOException e) { LOG.info(e); nameStorageCrashed(); } }
registerSerializer
252,341
void (@NotNull Stub rootStub, @NotNull OutputStream stream) { initSerializers(); try { myStubSerializationHelper.serialize(rootStub, stream); } catch (IOException e) { LOG.info(e); nameStorageCrashed(); } }
serialize
252,342
void () { if (mySerializersLoaded) return; //noinspection SynchronizeOnThis synchronized (this) { if (mySerializersLoaded) { return; } ProgressManager.getInstance().executeNonCancelableSection(() -> { instantiateElementTypesFromFields(); StubIndexEx.initExtensions(); }); registerSerializer(PsiFileStubImpl.TYPE); final ...
initSerializers
252,343
void () { //noinspection SynchronizeOnThis synchronized (this) { IStubElementType.dropRegisteredTypes(); IStubFileElementType.dropTemplateStubBaseVersion(); StubSerializerEnumerator enumerator = mySerializerEnumerator; if (enumerator != null) { enumerator.dropRegisteredSerializers(); } else { // has been corrupted prev...
dropSerializerData
252,344
void () { // load stub serializers before usage FileTypeRegistry.getInstance().getRegisteredFileTypes(); getExtensions(BinaryFileStubBuilders.INSTANCE, builder -> {}); getExtensions(LanguageParserDefinitions.INSTANCE, ParserDefinition::getFileNodeType); }
instantiateElementTypesFromFields
252,345
Iterator<VirtualFile> (@NotNull IntIterator idIterator, @NotNull IntPredicate filter) { FileBasedIndexEx fileBasedIndex = (FileBasedIndexEx)FileBasedIndex.getInstance(); return new Iterator<>() { VirtualFile next; boolean hasNext; { findNext(); } @Override public boolean hasNext() { return hasNext; } private void findN...
mapIdIterator
252,346
boolean () { return hasNext; }
hasNext
252,347
void () { hasNext = false; while (idIterator.hasNext()) { int id = idIterator.nextInt(); if (!filter.test(id)) { continue; } VirtualFile t = fileBasedIndex.findFileById(id); if (t != null) { next = t; hasNext = true; break; } } }
findNext
252,348
VirtualFile () { if (hasNext) { VirtualFile result = next; findNext(); return result; } else { throw new NoSuchElementException(); } }
next
252,349
void () { idIterator.remove(); }
remove
252,350
IntEnumerator () { return new IntEnumerator(); }
createSerializationState
252,351
SerializedStubTree () { try { restoreIndexedStubs(); } catch (IOException e) { throw new RuntimeException(e); } return new SerializedStubTree(ArrayUtil.EMPTY_BYTE_ARRAY, 0, myIndexedStubBytes, myIndexedStubByteLength, myDeserializedIndexedStubs.myMap, myStubIndexesExternalizer, mySerializationManager); }
withoutStub
252,352
boolean (final Object that) { if (this == that) { return true; } if (!(that instanceof SerializedStubTree thatTree)) { return false; } final int length = myTreeByteLength; if (length != thatTree.myTreeByteLength) { return false; } for (int i = 0; i < length; i++) { if (myTreeBytes[i] != thatTree.myTreeBytes[i]) { retur...
equals
252,353
int () { int result = 1; for (int i = 0; i < myTreeByteLength; i++) { result = 31 * result + myTreeBytes[i]; } return result; }
hashCode
252,354
Stub () { return null; }
getParentStub
252,355
String () { return "<no stub>"; }
toString
252,356
int (@Nullable String value) { if (value == null) { return 0; } assert myEnumerates != null; // enumerate possible only when writing stub int i = myEnumerates.getInt(value); if (i == 0) { myEnumerates.put(value, i = myStrings.size() + 1); myStrings.add(value); } return i; }
enumerate
252,357
String (int idx) { if (idx == 0) return null; return myStrings.get(idx - 1); }
valueOf
252,358
void () { }
markCorrupted
252,359
void () { }
close
252,360
boolean () { return false; }
isDirty
252,361
void () { }
force
252,362
Void (@NotNull DataOutput out, @NotNull Set<StubIndexKey<?, ?>> set) { return null; }
createStubIndexKeySerializationState
252,363
Void (@NotNull DataInput input, int stubIndexKeyCount) { return null; }
createStubIndexKeySerializationState
252,364
boolean (String name) { // // todo temporary https://github.com/JetBrains/kotlin/commit/298494fa08d11b9c374368aac4ae547b6f972f1a return "kotlin.FILE".equals(name); }
isKnownDuplicatedIdViolation
252,365
SerializerNotFoundException (int id, @Nullable String name, @NotNull MissingSerializerReporter reporter) { String externalId = null; Throwable storageException = null; try { externalId = myNameStorage.valueOf(id); } catch (Throwable e) { LOG.info(e); storageException = e; } SerializerNotFoundException exception = new S...
reportMissingSerializer
252,366
void () { if (myNameStorage instanceof SelfDiagnosing) { ((SelfDiagnosing)myNameStorage).diagnose(); } }
tryDiagnose
252,367
SearchScope (@NotNull PsiElement element) { return getUseScope(element, false); }
getUseScope
252,368
SearchScope (@NotNull PsiElement element) { return getUseScope(element, true); }
getCodeUsageScope
252,369
SearchScope (@NotNull PsiElement element, boolean restrictToCodeUsageScope) { SearchScope scope = PsiSearchScopeUtil.USE_SCOPE_KEY.get(element.getContainingFile()); if (scope != null) return scope; scope = element.getUseScope(); for (UseScopeEnlarger enlarger : UseScopeEnlarger.EP_NAME.getExtensionList()) { ProgressMan...
getUseScope
252,370
SearchScope (@NotNull SearchScope baseScope, @NotNull List<ScopeOptimizer> optimizers, @NotNull PsiElement element) { SearchScope scopeToRestrict = ScopeOptimizer.calculateOverallRestrictedUseScope(optimizers, element); if (scopeToRestrict != null) { return baseScope.intersectWith(scopeToRestrict); } return baseScope; ...
restrictScope
252,371
boolean (@NotNull String identifier, @NotNull SearchScope searchScope, @NotNull Processor<? super PsiElement> processor) { TextOccurenceProcessor occurrenceProcessor = (element, offsetInElement) -> { if (CommentUtilCore.isCommentTextElement(element) && element.findReferenceAt(offsetInElement) == null) { return processo...
processCommentsContainingIdentifier
252,372
boolean (@NotNull TextOccurenceProcessor processor, @NotNull SearchScope searchScope, @NotNull String text, short searchContext, boolean caseSensitive) { return processElementsWithWord(processor, searchScope, text, searchContext, caseSensitive, shouldProcessInjectedPsi(searchScope)); }
processElementsWithWord
252,373
boolean (@NotNull TextOccurenceProcessor processor, @NotNull SearchScope searchScope, @NotNull String text, short searchContext, boolean caseSensitive, boolean processInjectedPsi) { EnumSet<Options> options = makeOptions(caseSensitive, processInjectedPsi); return processElementsWithWord(searchScope, text, searchContext...
processElementsWithWord
252,374
boolean (@NotNull PsiFile file, @NotNull String name) { PsiUtilCore.ensureValid(file); if (file.getVirtualFile() == null || DumbService.isDumb(file.getProject())) { return StringUtil.contains(file.getViewProvider().getContents(), name); } // TODO: direct forward index access is not used right now since IdIndex shared i...
hasIdentifierInFile
252,375
AsyncFuture<Boolean> (@NotNull TextOccurenceProcessor processor, @NotNull SearchScope searchScope, @NotNull String text, short searchContext, boolean caseSensitively) { boolean result = processElementsWithWord(processor, searchScope, text, searchContext, caseSensitively, shouldProcessInjectedPsi(searchScope)); return A...
processElementsWithWordAsync
252,376
AsyncFuture<Boolean> (@NotNull SearchRequestCollector collector, @NotNull Processor<? super PsiReference> processor) { return AsyncUtil.wrapBoolean(processRequests(collector, processor)); }
processRequestsAsync
252,377
boolean (@NotNull SearchScope searchScope, @NotNull String text, short searchContext, @NotNull EnumSet<Options> options, @Nullable String containerName, @NotNull SearchSession session, @NotNull TextOccurenceProcessor processor) { return bulkProcessElementsWithWord(searchScope, text, searchContext, options, containerNam...
processElementsWithWord
252,378
boolean (PsiElement scopeElement) { if (!scopeElement.isValid()) return true; if (!scopeElement.isPhysical() || scopeElement instanceof PsiCompiledElement) { scopeElement = scopeElement.getNavigationElement(); } if (scopeElement instanceof PsiCompiledElement) { // can't scan text of the element return true; } if (scope...
processInReadAction
252,379
String () { return processor.toString(); }
toString
252,380
boolean (@NotNull SearchScope scope) { return !(scope instanceof LocalSearchScope) || !((LocalSearchScope)scope).isIgnoreInjectedPsi(); }
shouldProcessInjectedPsi
252,381
SearchCostResult (@NotNull String name, @NotNull GlobalSearchScope scope, @Nullable PsiFile fileToIgnoreOccurrencesIn, @Nullable ProgressIndicator progress) { if (!ReadAction.compute(() -> scope.getUnloadedModulesBelongingToScope().isEmpty())) { return SearchCostResult.TOO_MANY_OCCURRENCES; } AtomicInteger filesCount =...
isCheapEnoughToSearch
252,382
boolean (VirtualFile file) { ProgressManager.checkCanceled(); if (Comparing.equal(file, virtualFileToIgnoreOccurrencesIn)) return true; int currentFilesCount = filesCount.incrementAndGet(); long accumulatedFileSizeToProcess = filesSizeToProcess.addAndGet(file.isDirectory() ? 0 : file.getLength()); return currentFilesCo...
process
252,383
boolean (@NotNull GlobalSearchScope scope, @NotNull StringSearcher searcher, short searchContext, boolean caseSensitively, @Nullable String containerName, @NotNull SearchSession session, @NotNull ProgressIndicator progress, @NotNull BulkOccurrenceProcessor processor) { progress.setIndeterminate(false); progress.pushSta...
processElementsWithTextInGlobalScope
252,384
List<List<VirtualFile>> (@NotNull GlobalSearchScope scope, @NotNull StringSearcher searcher, short searchContext, boolean caseSensitively, @Nullable String containerName, @NotNull SearchSession session) { String text = searcher.getPattern(); Set<VirtualFile> allFiles = new HashSet<>(); getFilesWithText(scope, searchCon...
computePriorities
252,385
boolean (@NotNull VirtualFile file) { return super.contains(file) && directories.contains(file.getParent()); }
contains
252,386
boolean (@NotNull List<? extends VirtualFile> files, int totalSize, int alreadyProcessedFiles, @NotNull ProgressIndicator progress, @NotNull Processor<? super PsiFile> localProcessor) { return myManager.runInBatchFilesMode(() -> { AtomicInteger counter = new AtomicInteger(alreadyProcessedFiles); AtomicBoolean stopped =...
processPsiFileRoots
252,387
boolean (@NotNull Project project, @NotNull List<? extends VirtualFile> files, @NotNull ProgressIndicator progress, @NotNull AtomicBoolean stopped, @NotNull Processor<? super VirtualFile> localProcessor) { ApplicationEx app = (ApplicationEx)ApplicationManager.getApplication(); if (!app.isDispatchThread()) { CoreProgres...
processFilesConcurrentlyDespiteWriteActions
252,388
void (@NotNull Object action) { wrapper.cancel(); }
beforeWriteActionStart
252,389
void (@NotNull GlobalSearchScope scope, short searchContext, boolean caseSensitively, @NotNull String text, @NotNull Collection<? super VirtualFile> result) { processCandidateFilesForText(scope, searchContext, caseSensitively, text, Processors.cancelableCollectProcessor(result)); }
getFilesWithText
252,390
boolean (@NotNull GlobalSearchScope scope, short searchContext, boolean caseSensitively, boolean useOnlyWordHashToSearch, @NotNull String text, @NotNull Processor<? super VirtualFile> processor) { return processFilesContainingAllKeys(myManager.getProject(), scope, processor, TextIndexQuery.fromWord(text, caseSensitivel...
processCandidateFilesForText
252,391
boolean (@NotNull GlobalSearchScope scope, short searchContext, boolean caseSensitively, @NotNull String text, @NotNull Processor<? super VirtualFile> processor) { return processCandidateFilesForText(scope, searchContext, caseSensitively, false, text, processor); }
processCandidateFilesForText
252,392
boolean (@NotNull String qName, @NotNull PsiNonJavaFileReferenceProcessor processor, @NotNull GlobalSearchScope searchScope) { return processUsagesInNonJavaFiles(null, qName, processor, searchScope); }
processUsagesInNonJavaFiles
252,393
boolean (@Nullable PsiElement originalElement, @NotNull String qName, @NotNull PsiNonJavaFileReferenceProcessor processor, @NotNull GlobalSearchScope initialScope) { if (qName.isEmpty()) { throw new IllegalArgumentException("Cannot search for elements with empty text. Element: "+originalElement+ "; "+(originalElement =...
processUsagesInNonJavaFiles
252,394
boolean (@NotNull String word, @NotNull GlobalSearchScope scope, @NotNull Processor<? super PsiFile> processor, boolean caseSensitively) { return CacheManager.getInstance(myManager.getProject()).processFilesWithWord(processor, word, UsageSearchContext.IN_CODE, scope, caseSensitively); }
processAllFilesWithWord
252,395
boolean (@NotNull String word, @NotNull GlobalSearchScope scope, @NotNull Processor<? super PsiFile> processor, boolean caseSensitively) { return CacheManager.getInstance(myManager.getProject()).processFilesWithWord(processor, word, UsageSearchContext.IN_PLAIN_TEXT, scope, caseSensitively); }
processAllFilesWithWordInText
252,396
boolean (@NotNull String word, @NotNull GlobalSearchScope scope, @NotNull Processor<? super PsiFile> processor) { return CacheManager.getInstance(myManager.getProject()).processFilesWithWord(processor, word, UsageSearchContext.IN_COMMENTS, scope, true); }
processAllFilesWithWordInComments
252,397
boolean (@NotNull String word, @NotNull GlobalSearchScope scope, @NotNull Processor<? super PsiFile> processor) { return CacheManager.getInstance(myManager.getProject()).processFilesWithWord(processor, word, UsageSearchContext.IN_STRINGS, scope, true); }
processAllFilesWithWordInLiterals
252,398
EnumSet<Options> (boolean caseSensitive, boolean processInjectedPsi) { EnumSet<Options> options = EnumSet.of(Options.PROCESS_ONLY_JAVA_IDENTIFIERS_IF_POSSIBLE); if (caseSensitive) options.add(Options.CASE_SENSITIVE_SEARCH); if (processInjectedPsi) options.add(Options.PROCESS_INJECTED_PSI); return options; }
makeOptions
252,399
boolean (@NotNull SearchRequestCollector collector, @NotNull Processor<? super PsiReference> processor) { Map<SearchRequestCollector, Processor<? super PsiReference>> collectors = new HashMap<>(); collectors.put(collector, processor); ProgressIndicator progress = getOrCreateIndicator(); if (appendCollectorsFromQueryReq...
processRequests