aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThorsten Hake2013-11-28 03:33:24 (EST)
committerPaul Webster2013-12-02 12:39:14 (EST)
commit74e39c5dbc57f8dd56afafd418d38d4d14c9e050 (patch)
treebf1b6a7793ee99e6bd1589fc820e82b216bf19ef
parent05acc7e65afe5fa982104d2f7cfdb41c88cefe50 (diff)
downloadeclipse.platform.ui-74e39c5dbc57f8dd56afafd418d38d4d14c9e050.zip
eclipse.platform.ui-74e39c5dbc57f8dd56afafd418d38d4d14c9e050.tar.gz
eclipse.platform.ui-74e39c5dbc57f8dd56afafd418d38d4d14c9e050.tar.bz2
[422034] Fixed unchecked cast from MHandlerContainer to MContext.M20131204-0800refs/changes/39/19039/2
Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=422034 Change-Id: I4e01f9824bd8ccbf4d3eebca8f3d53dec1afb7af Signed-off-by: Thorsten Hake <eclipse@thorsten-hake.com>
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/HandlerProcessingAddon.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/HandlerProcessingAddon.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/HandlerProcessingAddon.java
index c2859c4..9b8cc56 100644
--- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/HandlerProcessingAddon.java
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/addons/HandlerProcessingAddon.java
@@ -52,11 +52,13 @@ public class HandlerProcessingAddon {
List<MHandlerContainer> findElements = modelService.findElements(application, null,
MHandlerContainer.class, null);
for (MHandlerContainer mHandlerContainer : findElements) {
- for (MHandler mHandler : mHandlerContainer.getHandlers()) {
+ if (mHandlerContainer instanceof MContext) {
MContext mContext = (MContext) mHandlerContainer;
IEclipseContext context = mContext.getContext();
if (context != null) {
- processActiveHandler(mHandler, context);
+ for (MHandler mHandler : mHandlerContainer.getHandlers()) {
+ processActiveHandler(mHandler, context);
+ }
}
}
}
@@ -67,7 +69,8 @@ public class HandlerProcessingAddon {
private void registerModelListeners() {
eventHandler = new EventHandler() {
public void handleEvent(Event event) {
- if ((event.getProperty(UIEvents.EventTags.ELEMENT) instanceof MHandlerContainer)) {
+ if ((event.getProperty(UIEvents.EventTags.ELEMENT) instanceof MHandlerContainer)
+ && (event.getProperty(UIEvents.EventTags.ELEMENT) instanceof MContext)) {
MHandlerContainer handlerContainer = (MHandlerContainer) event
.getProperty(UIEvents.EventTags.ELEMENT);
if (UIEvents.EventTypes.ADD.equals(event.getProperty(UIEvents.EventTags.TYPE))) {