mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-30 20:35:38 +02:00
Bug 297641: Result cache of read-only fragments is not cleared.
This commit is contained in:
parent
cd89d01394
commit
78e2f65d6d
6 changed files with 22 additions and 1 deletions
|
@ -139,4 +139,7 @@ public class EmptyIndexFragment implements IIndexFragment {
|
|||
public Object putCachedResult(Object key, Object value, boolean replace) {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void clearResultCache() {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -614,6 +614,12 @@ public class CIndex implements IIndex {
|
|||
}
|
||||
}
|
||||
|
||||
void clearResultCaches() {
|
||||
for (IIndexFragment frag : fFragments) {
|
||||
frag.clearResultCache();
|
||||
}
|
||||
}
|
||||
|
||||
public IIndexFileSet createFileSet() {
|
||||
return new IndexFileSet();
|
||||
}
|
||||
|
|
|
@ -273,4 +273,9 @@ public interface IIndexFragment {
|
|||
* longer holds a locks.
|
||||
*/
|
||||
Object getCachedResult(Object key);
|
||||
|
||||
/**
|
||||
* Clears the result cache.
|
||||
*/
|
||||
void clearResultCache();
|
||||
}
|
||||
|
|
|
@ -122,6 +122,9 @@ public class WritableCIndex extends CIndex implements IWritableIndex {
|
|||
|
||||
fIsWriteLocked= false;
|
||||
fWritableFragment.releaseWriteLock(establishReadlockCount, flush);
|
||||
|
||||
// Bug 297641: Result cache of read only providers needs to be cleared.
|
||||
clearResultCaches();
|
||||
}
|
||||
|
||||
public void flush() throws CoreException {
|
||||
|
|
|
@ -1145,7 +1145,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
|||
clearResultCache();
|
||||
}
|
||||
|
||||
private void clearResultCache() {
|
||||
public void clearResultCache() {
|
||||
synchronized (fResultCache) {
|
||||
fResultCache.clear();
|
||||
}
|
||||
|
|
|
@ -274,4 +274,8 @@ public class PDOMProxy implements IPDOM {
|
|||
public Object putCachedResult(Object key, Object value, boolean replace) {
|
||||
return value;
|
||||
}
|
||||
public void clearResultCache() {
|
||||
if (fDelegate != null)
|
||||
fDelegate.clearResultCache();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue