summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorPaul Elder2013-01-24 11:58:19 (EST)
committer Paul Webster2013-01-24 11:58:36 (EST)
commit3b52355ebf44a9e1ba722681a3f1663c1d3a6249 (patch)
tree372a11399ad78ad66ca04616553dbe63a326de62
parent3c6afd6b7e488a493b3e0c886c41dd3648943a6b (diff)
downloadeclipse.platform.ui-3b52355ebf44a9e1ba722681a3f1663c1d3a6249.zip
eclipse.platform.ui-3b52355ebf44a9e1ba722681a3f1663c1d3a6249.tar.gz
eclipse.platform.ui-3b52355ebf44a9e1ba722681a3f1663c1d3a6249.tar.bz2
Bug 388516 - Regression: Never ending exceptions after closing allv20130124-165836
perspectives and restarting
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java15
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/SearchField.java2
2 files changed, 14 insertions, 3 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java
index 4cf7674..fea0915 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java
@@ -118,6 +118,7 @@ public class HandledContributionItem extends ContributionItem {
List<HandledContributionItem> itemsToCheck = new ArrayList<HandledContributionItem>();
List<Runnable> windowRunnables = new ArrayList<Runnable>();
+ final List<HandledContributionItem> orphanedToolItems = new ArrayList<HandledContributionItem>();
public void addWindowRunnable(Runnable r) {
windowRunnables.add(r);
@@ -142,8 +143,18 @@ public class HandledContributionItem extends ContributionItem {
}
public void run() {
- for (HandledContributionItem hci : itemsToCheck) {
- hci.updateItemEnablement();
+
+ for (final HandledContributionItem hci : itemsToCheck) {
+ // HACK. Remove orphaned entries. See bug 388516.
+ if (hci.model != null && hci.model.getParent() != null) {
+ hci.updateItemEnablement();
+ } else {
+ orphanedToolItems.add(hci);
+ }
+ }
+ if (!orphanedToolItems.isEmpty()) {
+ itemsToCheck.removeAll(orphanedToolItems);
+ orphanedToolItems.clear();
}
Runnable[] array = new Runnable[windowRunnables.size()];
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/SearchField.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/SearchField.java
index 83437da..9911553 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/SearchField.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/SearchField.java
@@ -118,7 +118,7 @@ public class SearchField {
}
private void closeDropDown() {
- if (shell.isDisposed() || text.isDisposed() || !shell.isVisible())
+ if (shell == null || shell.isDisposed() || text.isDisposed() || !shell.isVisible())
return;
quickAccessContents.doClose();