1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Do not generate CElementDelta for pathEntries

if none were presents previously.
This commit is contained in:
Alain Magloire 2004-05-27 15:20:36 +00:00
parent e44330ce84
commit 49b97b4f31
2 changed files with 17 additions and 8 deletions

View file

@ -1,3 +1,8 @@
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.

View file

@ -420,6 +420,8 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
if (affectedProject == null) {
continue; // was filtered out
}
// 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) {
@ -429,6 +431,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
}
}
}
}
if (shouldFire) {
mgr.fire(ElementChangedEvent.POST_CHANGE);
}
@ -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;
}