mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-04 15:45:25 +02:00
[391164] [dstore] don't clear cached elements when they're not spirited or deleted
This commit is contained in:
parent
b2a42b4bed
commit
409cbb7119
1 changed files with 12 additions and 5 deletions
|
@ -1211,7 +1211,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
|||
DataElement de = null;
|
||||
if (name.equals(".") && name.equals(remoteParent)) //$NON-NLS-1$
|
||||
{
|
||||
de = getElementFor(name);
|
||||
de = getElementFor(name, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1221,7 +1221,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
|||
buf.append(sep);
|
||||
}
|
||||
buf.append(name);
|
||||
de = getElementFor(buf.toString());
|
||||
de = getElementFor(buf.toString(), true);
|
||||
}
|
||||
return de;
|
||||
}
|
||||
|
@ -2095,8 +2095,12 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
|||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
protected DataElement getElementFor(String path){
|
||||
return getElementFor(path, false);
|
||||
}
|
||||
|
||||
protected DataElement getElementFor(String path)
|
||||
protected DataElement getElementFor(String path, boolean forceReuse)
|
||||
{
|
||||
if (!isInitialized())
|
||||
{
|
||||
|
@ -2113,8 +2117,8 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
|||
String normalizedPath = PathUtility.normalizeUnknown(path);
|
||||
DataElement element = (DataElement)_fileElementMap.get(normalizedPath);
|
||||
if (element != null)
|
||||
{
|
||||
if (element.isDeleted()
|
||||
{
|
||||
if (forceReuse || element.isDeleted()
|
||||
|| element.isSpirit()){ // when using spirit, don't use element cache
|
||||
_fileElementMap.remove(normalizedPath);
|
||||
element = null;
|
||||
|
@ -2408,6 +2412,9 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
|||
*/
|
||||
|
||||
DataElement remoteFile = file.getDataElement();
|
||||
if (remoteFile.isSpirit()){
|
||||
remoteFile = getElementFor(rfile.getAbsolutePath());
|
||||
}
|
||||
|
||||
DataElement status = dsStatusCommand(remoteFile, IUniversalDataStoreConstants.C_QUERY_FILE_PERMISSIONS, monitor);
|
||||
if (status != null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue