Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlain Magloire2004-05-27 11:20:36 -0400
committerAlain Magloire2004-05-27 11:20:36 -0400
commit49b97b4f31ffd4edd78ca0353a2a0644788fe040 (patch)
tree06dffaf2e346946b1249f33ded73497bc10abc6d
parente44330ce843f7bcd249217ab0ac39c8cb61372c4 (diff)
downloadorg.eclipse.cdt-49b97b4f31ffd4edd78ca0353a2a0644788fe040.tar.gz
org.eclipse.cdt-49b97b4f31ffd4edd78ca0353a2a0644788fe040.tar.xz
org.eclipse.cdt-49b97b4f31ffd4edd78ca0353a2a0644788fe040.zip
Do not generate CElementDelta for pathEntries
if none were presents previously.
-rw-r--r--core/org.eclipse.cdt.core/ChangeLog5
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java20
2 files changed, 17 insertions, 8 deletions
diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog
index 276eb59703..36be4f5cc2 100644
--- a/core/org.eclipse.cdt.core/ChangeLog
+++ b/core/org.eclipse.cdt.core/ChangeLog
@@ -1,5 +1,10 @@
2004-05-26 Alain Magloire
+ Do not generate CElementDelta for pathEntries
+ if none were presents previously.
+
+2004-05-26 Alain Magloire
+
Jumbo Patch from Chris Wiebe.
Putting a starting skeleton for C Browsing.
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java
index f1afda40f5..17f0d3b6ff 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java
@@ -420,12 +420,15 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
if (affectedProject == null) {
continue; // was filtered out
}
- IPathEntry[] newEntries = getResolvedPathEntries(affectedProject);
- ICElementDelta[] deltas = generatePathEntryDeltas(affectedProject, oldResolvedEntries[i], newEntries);
- if (deltas.length > 0) {
- shouldFire = true;
- for (int j = 0; j < deltas.length; j++) {
- mgr.registerCModelDelta(deltas[j]);
+ // Only fire deltas if we had previous cache
+ if (oldResolvedEntries[i] != null) {
+ IPathEntry[] newEntries = getResolvedPathEntries(affectedProject);
+ ICElementDelta[] deltas = generatePathEntryDeltas(affectedProject, oldResolvedEntries[i], newEntries);
+ if (deltas.length > 0) {
+ shouldFire = true;
+ for (int j = 0; j < deltas.length; j++) {
+ mgr.registerCModelDelta(deltas[j]);
+ }
}
}
}
@@ -667,10 +670,11 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
public ICElementDelta[] generatePathEntryDeltas(ICProject cproject, IPathEntry[] oldEntries, IPathEntry[] newEntries) {
ArrayList list = new ArrayList();
- // Sanity checks
+ // if nothing was known before do not generate any deltas.
if (oldEntries == null) {
- oldEntries = NO_PATHENTRIES;
+ return new ICElementDelta[0];
}
+ // Sanity checks
if (newEntries == null) {
newEntries = NO_PATHENTRIES;
}

Back to the top