void (@NotNull VirtualFile file, int indexerFilter, @Nullable AtomicInteger syncCounter, @Nullable Runnable finishCallback) { var startTime = System.nanoTime(); try { for (SingleIndexValueApplier<?> applier : appliers) { if (indexerFilter < 0 || indexerFilter == getExecutorIndex(applier.indexId)) { boolean applied = applier.apply(); if (!applied) { shouldMarkFileAsIndexed = false; } } } for (SingleIndexValueRemover remover : removers) { if (indexerFilter < 0 || indexerFilter == getExecutorIndex(remover.indexId)) { boolean removed = remover.remove(); if (!removed) { shouldMarkFileAsIndexed = false; } } } } finally { var lastOrOnlyInvocationForFile = syncCounter == null || syncCounter.decrementAndGet() == 0; if (lastOrOnlyInvocationForFile) { if (shouldMarkFileAsIndexed) { IndexingFlag.setIndexedIfFileWithSameLock(file, fileStatusLockObject, indexingStamp); } else if (fileStatusLockObject != IndexingFlag.getNonExistentHash()) { IndexingFlag.unlockFile(file); } doPostModificationJob(file); } separateApplicationTimeNanos.addAndGet(System.nanoTime() - startTime); if (lastOrOnlyInvocationForFile && finishCallback != null) { finishCallback.run(); } } }