Conflicting handlers and Stackoverflow [message #1729144] |
Mon, 11 April 2016 09:50  |
Eclipse User |
|
|
|
Hi,
When migrating my product to Eclipse Mars, I start to have the following
messages on the console:
Conflicting handlers for system.test.myCmd:
(org.eclipse.ui.internal.workbenchHandlerServiceHandler@202c6396) vs
(system.test.MyHandler)
Once the workbench is loaded, I have a stack overflow !
My product contribute an IStartup to initialize some user profile
preferences and I have the following code which run in the earlyStartup:
ICommandService cmdService =
(ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
IHandlerService handlerService =
(IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
for(Command cmd : cmdService.getDefinedCommands()){
if(isMyRcpCmd(cmd)){
.
.
IHandlerActivation handlerActivation =
handlerService.activateHandler(cmd.getId(), cmd.getHandler());
prefs.put(cmd.getId(), handlerActivation)
...
}
}
I did some debugging and I see that when there is a conflict and the
method
LegacyHandlerService$HandlerSelectionFunction#compute(IEclipseContext,
String) return the workbenchHandlerServiceHandler as bestActivation, I
have the stack overflow which attached as image. When my handler is
returned, no stack overflow appears.
If in LegacyHandlerService#registerLegacyHandler(IEclipseContext,
String, String, IHandler, Expression, String), I comment out two lines
of code:
boolean handledChanged = handled != command.isHandled();
boolean enabledChanged = enabled != command.isEnabled();
My issue disappear !!
So my questions:
Why I'm having this conflict with this internal Eclipse handler (as I
saw it's generated by Eclipse in a handler generator) ??
Am I doing something wrong in the early startup or it's an Eclipse bug ??
Also, this two booleans handledChanged and enabledChanged are not used
and there is a TODO if we need to fire a handler changed event.
Any help is appreciated,
Kind regards,
Ali
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06224 seconds