mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
- added new check for nested access of indices (that might lead to deadlock)
- removed debug trace in flush when stub indices haven't been initialized
This commit is contained in:
@@ -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 <K> boolean processAllKeys(@NotNull StubIndexKey<K, ?> indexKey, @NotNull Processor<K> processor, @NotNull GlobalSearchScope scope, @Nullable IdFilter idFilter) {
|
||||
|
||||
FileBasedIndex.getInstance().ensureUpToDate(StubUpdatingIndex.INDEX_ID, scope.getProject(), scope);
|
||||
|
||||
final MyIndex<K> index = (MyIndex<K>)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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user