Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Magloire2005-02-18 14:45:11 +0000
committerAlain Magloire2005-02-18 14:45:11 +0000
commit263763ea703074f39e276225fe51bd4cea60e390 (patch)
treecda32e1ce51928a52a7084403a10a9212e2e7aea
parentf0d5e221b07917325a5eec9b0b90808712ed5e48 (diff)
downloadorg.eclipse.cdt-263763ea703074f39e276225fe51bd4cea60e390.tar.gz
org.eclipse.cdt-263763ea703074f39e276225fe51bd4cea60e390.tar.xz
org.eclipse.cdt-263763ea703074f39e276225fe51bd4cea60e390.zip
2005-02-16 Alain Magloire
Fix for PR 85625, The IBinary info were not remove in the cache. * model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java
-rw-r--r--core/org.eclipse.cdt.core/ChangeLog4
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java29
2 files changed, 28 insertions, 5 deletions
diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog
index 0146007c264..53b2d95b4dc 100644
--- a/core/org.eclipse.cdt.core/ChangeLog
+++ b/core/org.eclipse.cdt.core/ChangeLog
@@ -1,3 +1,7 @@
+2005-02-16 Alain Magloire
+ Fix for PR 85625, The IBinary info were not remove in the cache.
+ * model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java
+
2005-01-19 Alain Magloire
PR 83224
* model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java
index a1d4ee1295e..1b00bfabedf 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DeltaProcessor.java
@@ -5,6 +5,7 @@ package org.eclipse.cdt.internal.core.model;
* All Rights Reserved.
*/
+
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.IArchive;
@@ -289,6 +290,7 @@ public class DeltaProcessor {
}
CModelInfo rootInfo = (CModelInfo)CModelManager.getDefault().getCModel().getElementInfo();
rootInfo.setNonCResources(null);
+
} else {
fCurrentDelta.opened(element);
}
@@ -306,6 +308,24 @@ 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) {
+ 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
* the element reflecting its new structure.
@@ -313,12 +333,11 @@ public class DeltaProcessor {
* </ul>
*/
protected void elementChanged(ICElement element, IResourceDelta delta) {
+ // 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);
}

Back to the top