1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-02 13:55:39 +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,9 +86,13 @@ public class CElementWorkingSetUpdater implements IWorkingSetUpdater, IElementCh
return fElements.indexOf(element); return fElements.indexOf(element);
} }
public void set(int index, Object element) { public void set(int index, Object element) {
if (element == null) {
remove(index);
} else {
fElements.set(index, element); fElements.set(index, element);
fChanged= true; fChanged= true;
} }
}
public void remove(int index) { public void remove(int index) {
if (fElements.remove(index) != null) { if (fElements.remove(index) != null) {
fChanged= true; fChanged= true;
@ -283,6 +287,9 @@ public class CElementWorkingSetUpdater implements IWorkingSetUpdater, IElementCh
IProject project= resource.getProject(); IProject project= resource.getProject();
remove= (project != null ? project.isOpen() : true) && !resource.exists(); remove= (project != null ? project.isOpen() : true) && !resource.exists();
} }
} else if (element == null) {
// should not happen anyway, but who knows?
remove= true;
} }
if (remove) { if (remove) {
iter.remove(); iter.remove();