Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2007-10-30 06:24:24 -0400
committerAnton Leherbauer2007-10-30 06:24:24 -0400
commitd3fd594242c0a9c39b7802e57cd942276e299584 (patch)
tree9727fef5031eec00adb6ce99cdd065351fd87ec9
parentfc77ba4a0ac54a2ddfe6b9ffa12c59e79466bb82 (diff)
downloadorg.eclipse.cdt-d3fd594242c0a9c39b7802e57cd942276e299584.tar.gz
org.eclipse.cdt-d3fd594242c0a9c39b7802e57cd942276e299584.tar.xz
org.eclipse.cdt-d3fd594242c0a9c39b7802e57cd942276e299584.zip
Preventive fix for 207317: Project Explorer freezes when selecting any Working Set
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetUpdater.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetUpdater.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetUpdater.java
index b2bf49662be..ce26ee76c6f 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetUpdater.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetUpdater.java
@@ -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();

Back to the top