mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 19:35:36 +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;
|
DataElement de = null;
|
||||||
if (name.equals(".") && name.equals(remoteParent)) //$NON-NLS-1$
|
if (name.equals(".") && name.equals(remoteParent)) //$NON-NLS-1$
|
||||||
{
|
{
|
||||||
de = getElementFor(name);
|
de = getElementFor(name, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1221,7 +1221,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
||||||
buf.append(sep);
|
buf.append(sep);
|
||||||
}
|
}
|
||||||
buf.append(name);
|
buf.append(name);
|
||||||
de = getElementFor(buf.toString());
|
de = getElementFor(buf.toString(), true);
|
||||||
}
|
}
|
||||||
return de;
|
return de;
|
||||||
}
|
}
|
||||||
|
@ -2096,7 +2096,11 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected DataElement getElementFor(String path)
|
protected DataElement getElementFor(String path){
|
||||||
|
return getElementFor(path, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected DataElement getElementFor(String path, boolean forceReuse)
|
||||||
{
|
{
|
||||||
if (!isInitialized())
|
if (!isInitialized())
|
||||||
{
|
{
|
||||||
|
@ -2114,7 +2118,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
||||||
DataElement element = (DataElement)_fileElementMap.get(normalizedPath);
|
DataElement element = (DataElement)_fileElementMap.get(normalizedPath);
|
||||||
if (element != null)
|
if (element != null)
|
||||||
{
|
{
|
||||||
if (element.isDeleted()
|
if (forceReuse || element.isDeleted()
|
||||||
|| element.isSpirit()){ // when using spirit, don't use element cache
|
|| element.isSpirit()){ // when using spirit, don't use element cache
|
||||||
_fileElementMap.remove(normalizedPath);
|
_fileElementMap.remove(normalizedPath);
|
||||||
element = null;
|
element = null;
|
||||||
|
@ -2408,6 +2412,9 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DataElement remoteFile = file.getDataElement();
|
DataElement remoteFile = file.getDataElement();
|
||||||
|
if (remoteFile.isSpirit()){
|
||||||
|
remoteFile = getElementFor(rfile.getAbsolutePath());
|
||||||
|
}
|
||||||
|
|
||||||
DataElement status = dsStatusCommand(remoteFile, IUniversalDataStoreConstants.C_QUERY_FILE_PERMISSIONS, monitor);
|
DataElement status = dsStatusCommand(remoteFile, IUniversalDataStoreConstants.C_QUERY_FILE_PERMISSIONS, monitor);
|
||||||
if (status != null) {
|
if (status != null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue