1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 06:05:24 +02:00

Preventive fix for 207317: Project Explorer freezes when selecting any Working Set

This commit is contained in:
Anton Leherbauer 2007-10-30 10:24:24 +00:00
parent fc77ba4a0a
commit d3fd594242

View file

@ -86,8 +86,12 @@ public class CElementWorkingSetUpdater implements IWorkingSetUpdater, IElementCh
return fElements.indexOf(element);
}
public void set(int index, Object element) {
fElements.set(index, element);
fChanged= true;
if (element == null) {
remove(index);
} else {
fElements.set(index, element);
fChanged= true;
}
}
public void remove(int index) {
if (fElements.remove(index) != null) {
@ -283,6 +287,9 @@ public class CElementWorkingSetUpdater implements IWorkingSetUpdater, IElementCh
IProject project= resource.getProject();
remove= (project != null ? project.isOpen() : true) && !resource.exists();
}
} else if (element == null) {
// should not happen anyway, but who knows?
remove= true;
}
if (remove) {
iter.remove();