This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 422034 - [Workbench] ClassCastException: HandlerProcessingAddon casts an MHandlerContainer to an MContext without check
Summary: [Workbench] ClassCastException: HandlerProcessingAddon casts an MHandlerConta...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.4 M4   Edit
Assignee: Paul Webster CLA
QA Contact: Paul Webster CLA
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks: 422971 423852
  Show dependency tree
 
Reported: 2013-11-19 04:22 EST by Thorsten Hake CLA
Modified: 2013-12-11 13:17 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thorsten Hake CLA 2013-11-19 04:22:18 EST
The HandlerProcessingAddon casts an MHandlerContainer to an MContext without checking if the MHandlerContainer is of type MContext. 

As this is true for most of the classes implementing MHandlerContainer, it is not true for all. One example is MPartDescriptor. The HandlerProcessingAddon fails with an ClassCastException if one removes an MHandler from an MPartDescriptor.


For 4.3.1 the stacktrace is as follows:
java.lang.ClassCastException: org.eclipse.e4.ui.model.application.descriptor.basic.impl.PartDescriptorImpl cannot be cast to org.eclipse.e4.ui.model.application.ui.MContext
	at org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon$1.handleEvent(HandlerProcessingAddon.java:88) ~[na:na]
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41) ~[na:na]
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) ~[na:na]
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135) ~[na:na]
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4145) ~[na:na]
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3762) ~[na:na]
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113) ~[na:na]
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) ~[na:na]
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997) ~[na:na]
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138) ~[na:na]
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:162) ~[na:na]
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) ~[na:na]
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) ~[na:na]
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) ~[na:na]
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354) ~[na:na]
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181) ~[na:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_07]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_07]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_07]
	at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_07]
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636) ~[org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar:na]
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591) ~[org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar:na]
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450) ~[org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar:na]
Comment 1 Thorsten Hake CLA 2013-11-28 03:36:34 EST
Added Gerrit Patch for this bug: https://git.eclipse.org/r/#/c/19039/
Comment 2 Paul Webster CLA 2013-11-29 15:54:15 EST
(In reply to Thorsten Hake from comment #1)
> Added Gerrit Patch for this bug: https://git.eclipse.org/r/#/c/19039/

I've added  https://git.eclipse.org/r/19151

We introduced some kind of weird loop that we had to fix in R4_3_maintenance.

PW
Comment 4 Thorsten Hake CLA 2013-12-02 04:41:35 EST
I'm glad that I could help.

Is there any possibility to merge it into the R4_3_maintenance branch so that this minor fix is available for 4.3 SR2?
Comment 5 Paul Webster CLA 2013-12-11 13:17:00 EST
In 4.4.0.I20131209-2000

PW