1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

2005-02-16 Alain Magloire

Fix for PR 85633, The IBinary info were not remove in the cache.
	* model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java
This commit is contained in:
Alain Magloire 2005-02-17 03:23:37 +00:00
parent ba438552cb
commit fe014751c8
2 changed files with 27 additions and 6 deletions

View file

@ -1,3 +1,7 @@
2005-02-16 Alain Magloire
Fix for PR 85633, The IBinary info were not remove in the cache.
* model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java
2004-03-04 Peter Faltaous
Add e_machine values for X86_64.
getAttributes(): Add cases for X86_64.

View file

@ -5,6 +5,8 @@ package org.eclipse.cdt.internal.core.model;
* All Rights Reserved.
*/
import java.util.ArrayList;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.IArchive;
@ -306,6 +308,25 @@ public class DeltaProcessor {
}
}
/**
* This is use to remove the cache info for IArchive and IBinary
* We can use IBinary.close() doing this will remove the binary
* for the virtual binary/archive containers.
* @param celement
*/
private void closeBinary(ICElement celement) {
CModelManager factory = CModelManager.getDefault();
CElementInfo pinfo = (CElementInfo)factory.peekAtInfo(celement);
if (pinfo != null) {
ArrayList list = new ArrayList();
ICElement[] celems = pinfo.getChildren();
for (int i = 0; i < celems.length; ++i) {
closeBinary(celems[i]);
}
factory.removeInfo(celement);
}
}
/**
* Generic processing for elements with changed contents:<ul>
* <li>The element is closed such that any subsequent accesses will re-open
@ -314,15 +335,11 @@ public class DeltaProcessor {
* </ul>
*/
protected void elementChanged(ICElement element, IResourceDelta delta) {
// For Binary/Archive We can not call close() to the work
// For Binary/Archive We can not call close() to do the work
// closing will remove the element from the {Binary,Archive}Container
// We nee to clear the cache explicitely
if (element instanceof IBinary || element instanceof IArchive) {
CModelManager factory = CModelManager.getDefault();
CElementInfo pinfo = (CElementInfo)factory.peekAtInfo(element);
if (pinfo != null) {
factory.removeInfo(element);
}
closeBinary(element);
} else if (element instanceof Openable) {
close((Openable)element);
}