diff --git a/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java b/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java index 59a0719c1686..5f1b1fe0dbcb 100644 --- a/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/stubs/StubIndexImpl.java @@ -205,7 +205,6 @@ public class StubIndexImpl extends StubIndex implements ApplicationComponent, Pe public void flush() throws StorageException { if (!myInitialized) { - System.out.println("No flushing, stub index isn't initialized"); return; } AsyncState state = getAsyncState(); @@ -375,11 +374,12 @@ public class StubIndexImpl extends StubIndex implements ApplicationComponent, Pe } public boolean processAllKeys(@NotNull StubIndexKey indexKey, @NotNull Processor processor, @NotNull GlobalSearchScope scope, @Nullable IdFilter idFilter) { - FileBasedIndex.getInstance().ensureUpToDate(StubUpdatingIndex.INDEX_ID, scope.getProject(), scope); final MyIndex index = (MyIndex)getAsyncState().myIndices.get(indexKey); + myAccessValidator.checkAccessingIndexDuringOtherIndexProcessing(indexKey); try { + myAccessValidator.startedProcessingActivityForIndex(indexKey); return index.processAllKeys(processor, scope, idFilter); } catch (StorageException e) { @@ -391,6 +391,8 @@ public class StubIndexImpl extends StubIndex implements ApplicationComponent, Pe forceRebuild(e); } throw e; + } finally { + myAccessValidator.stoppedProcessingActivityForIndex(indexKey); } return true; }