void () { var index = myStubUpdatingIndexStorage.getValue(); if (index == null) { myProbablyExpensiveUpdates.clear(); registerModificationForAllElementTypes(); return; } DataIndexer<Integer, SerializedStubTree, FileContent> stubIndexer = index.getIndexer(); while (!myProbablyExpensiveUpdates.isEmpty()) { FileInfo info = myProbablyExpensiveUpdates.poll(); if (wereModificationsInCurrentBatch(info.type) || info.project.isDisposed()) continue; FileBasedIndexImpl.markFileIndexed(info.file, null); try { var diffBuilder = (StubCumulativeInputDiffBuilder)index.getForwardIndexAccessor() .getDiffBuilder( FileBasedIndex.getFileId(info.file), null // see SingleEntryIndexForwardIndexAccessor#getDiffBuilder ); // file might be deleted from actual fs, but still be "valid" in vfs (e.g. that happen sometimes in tests) final FileContent fileContent = getTransientAwareFileContent(info); if (fileContent == null) { registerModificationFor(info.type); continue; } final Stub stub = StubTreeBuilder.buildStubTree(fileContent); Map<Integer, SerializedStubTree> serializedStub = stub == null ? Collections.emptyMap() : stubIndexer.map(fileContent); if (diffBuilder.differentiate(serializedStub, (__, ___, ____) -> { }, (__, ___, ____) -> { }, (__, ___) -> { }, true)) { registerModificationFor(info.type); } } catch (IOException | StorageException e) { LOG.error(e); } finally { FileBasedIndexImpl.unmarkBeingIndexed(); } } }