another stub update index fix:

- stubs doesn't get buffered status update notifications because they aren't built out of unsaved documents
- also index read also made affected to buffered status
This commit is contained in:
Maxim.Mossienko
2014-01-24 14:27:36 +01:00
parent 455ca8f5b6
commit 10f6a0f9eb
2 changed files with 7 additions and 3 deletions
@@ -1450,6 +1450,7 @@ public class FileBasedIndexImpl extends FileBasedIndex {
// if we have uncommitted documents in unsaved documents, we may index old psi with new uncommitted doc,
// to properly reindex with new psi / new doc we don't mark index up to date in this case (IDEA-111448)
myUpToDateIndices.add(indexId);
}
}
}
@@ -1603,6 +1604,7 @@ public class FileBasedIndexImpl extends FileBasedIndex {
for (ID<?, ?> indexId : myIndices.keySet()) {
final MapReduceIndex index = (MapReduceIndex)getIndex(indexId);
assert index != null;
if (myPsiDependentIndices.contains(indexId)) continue;
final IndexStorage indexStorage = index.getStorage();
((MemoryIndexStorage)indexStorage).setBufferingEnabled(enabled);
}
@@ -187,9 +187,11 @@ public class MemoryIndexStorage<Key, Value> implements IndexStorage<Key, Value>
@Override
@NotNull
public ValueContainer<Value> read(final Key key) throws StorageException {
final ValueContainer<Value> valueContainer = myMap.get(key);
if (valueContainer != null) {
return valueContainer;
if (myBufferingEnabled.get()) {
final ValueContainer<Value> valueContainer = myMap.get(key);
if (valueContainer != null) {
return valueContainer;
}
}
return myBackendStorage.read(key);