summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorSnjezana Peco2013-02-05 16:01:59 (EST)
committer Paul Webster2013-02-05 16:01:59 (EST)
commite090c714b97e644ac953b9d86f00cc0c5cfecc32 (patch)
tree09be23c219e6b8dc0528e26dd24780f553906e78
parent0fbbfb1bd4d8f09828bc358be83af63c78b2c1cc (diff)
downloadeclipse.platform.ui-e090c714b97e644ac953b9d86f00cc0c5cfecc32.zip
eclipse.platform.ui-e090c714b97e644ac953b9d86f00cc0c5cfecc32.tar.gz
eclipse.platform.ui-e090c714b97e644ac953b9d86f00cc0c5cfecc32.tar.bz2
Bug 398399 - ToolItemUpdateTimer unnecessarily creates array of Runnable
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java12
1 files changed, 7 insertions, 5 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 b6d2319..f6a599b 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
@@ -157,11 +157,13 @@ public class HandledContributionItem extends ContributionItem {
orphanedToolItems.clear();
}
- Runnable[] array = new Runnable[windowRunnables.size()];
- windowRunnables.toArray(array);
- for (Runnable r : array) {
- runner.setRunnable(r);
- SafeRunner.run(runner);
+ if (windowRunnables.size() > 0) {
+ Runnable[] array = new Runnable[windowRunnables.size()];
+ windowRunnables.toArray(array);
+ for (Runnable r : array) {
+ runner.setRunnable(r);
+ SafeRunner.run(runner);
+ }
}
// repeat until the list goes empty