Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 395642 - Conflict Commands
Summary: Conflict Commands
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.2   Edit
Hardware: PC All
: P3 major with 1 vote (vote)
Target Milestone: 3.6.2+   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 408606
  Show dependency tree
 
Reported: 2012-12-03 16:20 EST by Leopoldo (Polo) Miranda CLA
Modified: 2013-08-01 08:49 EDT (History)
9 users (show)

See Also:


Attachments
Test Project (20.49 KB, application/zip)
2012-12-03 16:32 EST, Leopoldo (Polo) Miranda CLA
no flags Details
Fix to prevent the overflow (1.60 KB, patch)
2013-05-16 07:39 EDT, Paul Webster CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Leopoldo (Polo) Miranda CLA 2012-12-03 16:20:26 EST
Our editor is having conflict with some Eclipse base commands like Ctrl + C, Ctrl + V, Ctrl + X, Ctrl + Z and many others. As a result, those commands are disabled. 

This problem cannot be recreated in Eclipse as-is because it requires extenders to exposure the action handlers functionality. Apparently, Eclipse  does not make honor to those actions already overridden by extenders like Page Designer - which is totally acceptable - and Eclipse just  suddenly inserts base actions causing conflict during some of then Eclipse checkers. As a result, affected commands are disabled.

For example, org.eclipse.ui.internal.handlers.HandlerAuthority.resolveConflicts(String, SortedSet,
MultiStatus) has the following activations


[HandlerActivation(commandId=org.eclipse.ui.edit.cut,
	handler=LegacyHandlerWrapper(ActionHandler(action=com.ibm.etools.webedit.editor.internal.actions.override.HookAction@2dd3e753)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp12.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=
com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=1074672202)),sourcePriority=
67113984), HandlerActivation(commandId=org.eclipse.ui.edit.cut,
	handler=LegacyHandlerWrapper(ActionHandler(action=com.ibm.etools.webedit.editor.internal.actions.override.HookAction@3e664758)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp12.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=
com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=-1105734388)),sourcePriority=
67113984), HandlerActivation(commandId=org.eclipse.ui.edit.cut,
	handler=LegacyHandlerWrapper(ActionHandler(action=com.ibm.etools.webedit.editor.internal.actions.override.HookAction@e5264644)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp12.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=
com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=-1138585522)),sourcePriority=
67113984), HandlerActivation(commandId=org.eclipse.ui.edit.cut,
	handler=LegacyHandlerWrapper(ActionHandler(action=com.ibm.etools.webedit.editor.internal.actions.override.HookAction@7facf100)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp12.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=
com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=1050721745)),sourcePriority=
67113984), HandlerActivation(commandId=org.eclipse.ui.edit.cut,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.TextOperationAction@164826bd)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp12.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=
com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=1074672202)),sourcePriority=
67113984), HandlerActivation(commandId=org.eclipse.ui.edit.cut,
	handler=ActionHandler(org.eclipse.ui.texteditor.TextOperationAction@164826bd),
	expression=AndExpression(LegacyEditorActionBarExpression(com.ibm.etools.webedit.editor.HTMLEditor),WorkbenchWindowExpression(
org.eclipse.ui.internal.WorkbenchWindow@987c4c29)),sourcePriority=4210689), HandlerActivation(commandId=org.eclipse.ui.edit.cut,
	handler=ActionHandler(org.eclipse.jdt.internal.ui.refactoring.reorg.CutAction@b72ba92f),
	expression=AndExpression(AndExpression(org.eclipse.ui.SubActionBars$1@40a2b05a,ActivePartExpression(com.ibm.etools.ui.navigator.SDNavigator@fea373f4)),
WorkbenchWindowExpression(org.eclipse.ui.internal.WorkbenchWindow@987c4c29)),sourcePriority=1064961), HandlerActivation(commandId=org.eclipse.ui.edit.cut
,
	handler=org.eclipse.ui.internal.handlers.WidgetMethodHandler@66fcec32,
	expression=,sourcePriority=0)]

And here are the ones that are in conflict 

<0010.3.4.b> conflict... org...HandlerAuthority.resolveConflicts() : currentActivation = 5, HandlerActivation(commandId=org.eclipse.ui.edit.cut, 	handler=
LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.TextOperationAction@164826bd)), 	expression=LegacyHandlerSubmission(Shell {Java EE -
DWP/WebContent/jsp12.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=
com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=1074672202)),sourcePriority=67113984)
          <0010.3.4.c> conflict... org...HandlerAuthority.resolveConflicts() : bestActivation    = 1, HandlerActivation(commandId=org.eclipse.ui.edit.cut, 	handler=
LegacyHandlerWrapper(ActionHandler(action=com.ibm.etools.webedit.editor.internal.actions.override.HookAction@2dd3e753)), 	expression=
LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp12.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=
com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=1074672202)),sourcePriority=
67113984)

One easy way to read this is that the best activation (from extender) "com.ibm.etools.webedit.editor.internal.actions.override.HookAction@2dd3e753)" is active and has conflict by one defined by Eclipse "org.eclipse.ui.texteditor.TextOperationAction@164826bd)"

Here is the execution point where this conflict occurs.


Thread [main] (Suspended (breakpoint at line 519 in org.eclipse.ui.internal.handlers.HandlerAuthority))	
	org.eclipse.ui.internal.handlers.HandlerAuthority.resolveConflicts(java.lang.String, java.util.SortedSet, org.eclipse.core.runtime.MultiStatus) line: 519	
	org.eclipse.ui.internal.handlers.HandlerAuthority.processChangedCommands() line: 795	
	org.eclipse.ui.internal.handlers.HandlerAuthority.access$1(org.eclipse.ui.internal.handlers.HandlerAuthority) line: 757	
	org.eclipse.ui.internal.handlers.HandlerAuthority$1.propertyChange(org.eclipse.jface.util.PropertyChangeEvent) line: 177	
	org.eclipse.ui.internal.services.EvaluationAuthority$1.run() line: 252	
	org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 42	
	org.eclipse.ui.internal.services.EvaluationAuthority.fireServiceChange(java.lang.String, java.lang.Object, java.lang.Object) line: 246	
	org.eclipse.ui.internal.services.EvaluationAuthority.endSourceChange(java.lang.String[]) line: 197	
	org.eclipse.ui.internal.services.EvaluationAuthority.sourceChanged(java.lang.String[]) line: 135	
	org.eclipse.ui.internal.services.EvaluationAuthority(org.eclipse.ui.internal.services.ExpressionAuthority).sourceChanged(int, java.lang.String[]) line: 311	
	org.eclipse.ui.internal.services.EvaluationAuthority(org.eclipse.ui.internal.services.ExpressionAuthority).sourceChanged(int, java.util.Map) line: 290	
	org.eclipse.ui.internal.services.WorkbenchSourceProvider(org.eclipse.ui.AbstractSourceProvider).fireSourceChanged(int, java.util.Map) line: 99	
	org.eclipse.ui.internal.services.WorkbenchSourceProvider.checkActivePart(boolean) line: 401	
	org.eclipse.ui.internal.services.WorkbenchSourceProvider.checkActivePart() line: 300	
	org.eclipse.ui.internal.services.WorkbenchSourceProvider$1.partDeactivated(org.eclipse.ui.IWorkbenchPart) line: 247	
	org.eclipse.ui.internal.PartListenerList$4.run() line: 117	
	org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 42	
	org.eclipse.core.runtime.Platform.run(org.eclipse.core.runtime.ISafeRunnable) line: 888	
	org.eclipse.ui.internal.PartListenerList.fireEvent(org.eclipse.jface.util.SafeRunnable, org.eclipse.ui.IPartListener, org.eclipse.ui.IWorkbenchPart, java.lang.String) line: 57	
	org.eclipse.ui.internal.PartListenerList.firePartDeactivated(org.eclipse.ui.IWorkbenchPart) line: 115	
	org.eclipse.ui.internal.PartService.firePartDeactivated(org.eclipse.ui.IWorkbenchPartReference) line: 238	
	org.eclipse.ui.internal.PartService.setActivePart(org.eclipse.ui.IWorkbenchPartReference) line: 300	
	org.eclipse.ui.internal.WWinPartService.updateActivePart() line: 134	
	org.eclipse.ui.internal.WWinPartService.access$0(org.eclipse.ui.internal.WWinPartService) line: 125	
	org.eclipse.ui.internal.WWinPartService$WWinListener.partDeactivated(org.eclipse.ui.IWorkbenchPartReference) line: 50	
	org.eclipse.ui.internal.PartListenerList2$4.run() line: 115	
	org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 42	
	org.eclipse.core.runtime.Platform.run(org.eclipse.core.runtime.ISafeRunnable) line: 888	
	org.eclipse.ui.internal.PartListenerList2.fireEvent(org.eclipse.jface.util.SafeRunnable, org.eclipse.ui.IPartListener2, org.eclipse.ui.IWorkbenchPartReference,
java.lang.String) line: 55	
	org.eclipse.ui.internal.PartListenerList2.firePartDeactivated(org.eclipse.ui.IWorkbenchPartReference) line: 113	
	org.eclipse.ui.internal.PartService.firePartDeactivated(org.eclipse.ui.IWorkbenchPartReference) line: 242	
	org.eclipse.ui.internal.PartService.setActivePart(org.eclipse.ui.IWorkbenchPartReference) line: 300	
	org.eclipse.ui.internal.WorkbenchPagePartList.fireActivePartChanged(org.eclipse.ui.IWorkbenchPartReference, org.eclipse.ui.IWorkbenchPartReference) line: 57	
	org.eclipse.ui.internal.WorkbenchPagePartList(org.eclipse.ui.internal.PartList).setActivePart(org.eclipse.ui.IWorkbenchPartReference) line: 136	
	org.eclipse.ui.internal.WorkbenchPage.setActivePart(org.eclipse.ui.IWorkbenchPart, boolean) line: 3537	
	org.eclipse.ui.internal.WorkbenchPage.internalActivate(org.eclipse.ui.IWorkbenchPart, boolean) line: 617	
	org.eclipse.ui.internal.WorkbenchPage.activate(org.eclipse.ui.IWorkbenchPart) line: 589	
	org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(org.eclipse.ui.IEditorInput, java.lang.String, boolean, int, org.eclipse.ui.IMemento) line: 2875	
	org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(org.eclipse.ui.IEditorInput, java.lang.String, boolean, int, org.eclipse.ui.IMemento) line: 2768	
	org.eclipse.ui.internal.WorkbenchPage.access$11(org.eclipse.ui.internal.WorkbenchPage, org.eclipse.ui.IEditorInput, java.lang.String, boolean, int,
org.eclipse.ui.IMemento) line: 2760	
	org.eclipse.ui.internal.WorkbenchPage$10.run() line: 2711	
	org.eclipse.swt.custom.BusyIndicator.showWhile(org.eclipse.swt.widgets.Display, java.lang.Runnable) line: 70	
	org.eclipse.ui.internal.WorkbenchPage.openEditor(org.eclipse.ui.IEditorInput, java.lang.String, boolean, int, org.eclipse.ui.IMemento) line: 2707	
	org.eclipse.ui.internal.WorkbenchPage.openEditor(org.eclipse.ui.IEditorInput, java.lang.String, boolean, int) line: 2691	
	org.eclipse.ui.internal.WorkbenchPage.openEditor(org.eclipse.ui.IEditorInput, java.lang.String, boolean) line: 2682	
	org.eclipse.ui.ide.IDE.openEditor(org.eclipse.ui.IWorkbenchPage, org.eclipse.core.resources.IFile, boolean, boolean) line: 655	
	org.eclipse.ui.ide.IDE.openEditor(org.eclipse.ui.IWorkbenchPage, org.eclipse.core.resources.IFile, boolean) line: 614	
	org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(org.eclipse.core.resources.IFile, boolean) line: 355	
	org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(java.lang.Object, boolean) line: 164	
	org.eclipse.jdt.ui.actions.OpenAction.run(java.lang.Object[]) line: 249	
	org.eclipse.jdt.ui.actions.OpenAction.run(org.eclipse.jface.viewers.IStructuredSelection) line: 228	
	org.eclipse.jdt.ui.actions.OpenAction(org.eclipse.jdt.ui.actions.SelectionDispatchAction).dispatchRun(org.eclipse.jface.viewers.ISelection) line: 275	
	org.eclipse.jdt.ui.actions.OpenAction(org.eclipse.jdt.ui.actions.SelectionDispatchAction).run() line: 251	
	org.eclipse.jdt.internal.ui.navigator.OpenAndExpand.run() line: 50	
	org.eclipse.ui.actions.RetargetAction.run() line: 221	
	org.eclipse.ui.navigator.CommonNavigatorManager$3.open(org.eclipse.jface.viewers.ISelection, boolean) line: 185	
	org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(org.eclipse.jface.viewers.OpenEvent) line: 48	
	org.eclipse.jface.viewers.StructuredViewer$2.run() line: 845	
	org.eclipse.core.runtime.SafeRunner.run(org.eclipse.core.runtime.ISafeRunnable) line: 42	
	org.eclipse.ui.internal.JFaceUtil$1.run(org.eclipse.core.runtime.ISafeRunnable) line: 49	
	org.eclipse.jface.util.SafeRunnable.run(org.eclipse.core.runtime.ISafeRunnable) line: 175	
	com.ibm.etools.ui.navigator.SDFilteredTree$SDNotifyingTreeViewer(org.eclipse.jface.viewers.StructuredViewer).fireOpen(org.eclipse.jface.viewers.OpenEvent) line:
843	
	com.ibm.etools.ui.navigator.SDFilteredTree$SDNotifyingTreeViewer(org.eclipse.jface.viewers.StructuredViewer).handleOpen(org.eclipse.swt.events.SelectionEvent) line
: 1131	
	com.ibm.etools.ui.navigator.SDFilteredTree$SDNotifyingTreeViewer(org.eclipse.ui.navigator.CommonViewer).handleOpen(org.eclipse.swt.events.SelectionEvent) line:
462	
	org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(org.eclipse.swt.events.SelectionEvent) line: 1235	
	org.eclipse.jface.util.OpenStrategy.fireOpenEvent(org.eclipse.swt.events.SelectionEvent) line: 264	
	org.eclipse.jface.util.OpenStrategy.access$2(org.eclipse.jface.util.OpenStrategy, org.eclipse.swt.events.SelectionEvent) line: 258	
	org.eclipse.jface.util.OpenStrategy$1.handleEvent(org.eclipse.swt.widgets.Event) line: 298	
	org.eclipse.swt.widgets.EventTable.sendEvent(org.eclipse.swt.widgets.Event) line: 84	
	org.eclipse.swt.widgets.Tree(org.eclipse.swt.widgets.Widget).sendEvent(org.eclipse.swt.widgets.Event) line: 1258	
	org.eclipse.swt.widgets.Display.runDeferredEvents() line: 3540	
	org.eclipse.swt.widgets.Display.readAndDispatch() line: 3161	
	org.eclipse.ui.internal.Workbench.runEventLoop(org.eclipse.jface.window.Window$IExceptionHandler, org.eclipse.swt.widgets.Display) line: 2640	
	org.eclipse.ui.internal.Workbench.runUI() line: 2604	
	org.eclipse.ui.internal.Workbench.access$4(org.eclipse.ui.internal.Workbench) line: 2438	
	org.eclipse.ui.internal.Workbench$7.run() line: 671	
	org.eclipse.core.databinding.observable.Realm.runWithDefault(org.eclipse.core.databinding.observable.Realm, java.lang.Runnable) line: 332	
	org.eclipse.ui.internal.Workbench.createAndRunWorkbench(org.eclipse.swt.widgets.Display, org.eclipse.ui.application.WorkbenchAdvisor) line: 664	
	org.eclipse.ui.PlatformUI.createAndRunWorkbench(org.eclipse.swt.widgets.Display, org.eclipse.ui.application.WorkbenchAdvisor) line: 149	
	org.eclipse.ui.internal.ide.application.IDEApplication.start(org.eclipse.equinox.app.IApplicationContext) line: 115	
	org.eclipse.equinox.internal.app.EclipseAppHandle.run(java.lang.Object) line: 196	
	org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(java.lang.Object) line: 110	
	org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(java.lang.Object) line: 79	
	org.eclipse.core.runtime.adaptor.EclipseStarter.run(java.lang.Object) line: 369	
	org.eclipse.core.runtime.adaptor.EclipseStarter.run(java.lang.String[], java.lang.Runnable) line: 179	
	sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method, java.lang.Object, java.lang.Object[]) line: not available [native method]	
	sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 88	
	sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 55	
	java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: 613	
	org.eclipse.equinox.launcher.Main.invokeFramework(java.lang.String[], java.net.URL[]) line: 620	
	org.eclipse.equinox.launcher.Main.basicRun(java.lang.String[]) line: 575	
	org.eclipse.equinox.launcher.Main.run(java.lang.String[]) line: 1408	
	org.eclipse.equinox.launcher.Main.main(java.lang.String[]) line: 1384	


Notes.
1. Page Designer Editor is under the split view (Design + Source) by having active the source section
2. We're seeing this problem starting 3.6.x (older released e.g. 3.4.x does seems to have this problem)
3. JSP's contains just the template e.g. (html's does have same behavior when PD is being used, split view)  
4. This problem can be recreated almost always opening between 1..10 JSP files in our editor.


<!DOCTYPE HTML><%@page language="java"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
<title>jsp1</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>

</body>
</html>

Any other information you need, please let me know.
Comment 1 Leopoldo (Polo) Miranda CLA 2012-12-03 16:32:43 EST
Created attachment 224241 [details]
Test Project
Comment 2 Billy Rowe CLA 2012-12-06 11:23:43 EST
Hi,

We have had numerous customer reports of losing keyboard bindings. We would appreciate a fix as soon as feasible.

Thanks
Billy
Comment 3 Leopoldo (Polo) Miranda CLA 2012-12-06 12:01:20 EST
Just a correction at the bottom of the original Description

Notes:
...
2. We're seeing this problem starting 3.6.x (older releases e.g. 3.4.x does NOT seem to have this problem)
...
Comment 4 Paul Webster CLA 2012-12-10 09:39:10 EST
Where is the definition for your action that is causing the conflict?  i.e. what does the code and plugin.xml look like for contributing com.ibm.etools.webedit.editor.internal.actions.override.HookAction?  That's the one you expect to be active, right?

PW
Comment 5 Leopoldo (Polo) Miranda CLA 2012-12-10 16:13:01 EST
Hello Paul,

In com.ibm.etools.webedit.editor.actions.PageDesignerContributor.setEditEditMenuItems(IMenuManager) we override /activate the actions required by Page Designer (PD). Here a code snippet for the PD-source editor view:

IActionBars ab = getActionBars();

ab.setGlobalActionHandler(ActionFactory.UNDO.getId(), getSourceGlobalAction(ActionFactory.UNDO.getId()));
ab.setGlobalActionHandler(ActionFactory.REDO.getId(), getSourceGlobalAction(ActionFactory.REDO.getId()));
ab.setGlobalActionHandler(ActionFactory.CUT.getId(), getSourceGlobalAction(ActionFactory.CUT.getId()));
ab.setGlobalActionHandler(ActionFactory.COPY.getId(), getSourceGlobalAction(ActionFactory.COPY.getId()));
..
..


Now, in com.ibm.etools.webedit.editor.actions.PageDesignerContributor.getSourceGlobalAction(String), we define the following:

	private IAction getSourceGlobalAction(String id) {
		if (id == null)
			return null;

		StructuredTextEditor ste = lastSourceEditor;
		if (null == ste) {
			return null;
		}

		IAction a = ste.getAction(id);
		if (a != null) {
			String overrideActionId = HookAction.getOverrideActionId(a);
			if (overrideActionId != null) {
				a = new HookAction(a, overrideActionId);
			}
		}
		if (a != null && a.getActionDefinitionId() != null) {
			setRegisterAction(a);
		}
		return a;
	}


And  com.ibm.etools.webedit.editor.internal.actions.override.HookAction.HookAction(IAction, String) looks like this


	public HookAction(IAction action, String overrideActionId) {
		this.action = action;
		this.overrideActionId = overrideActionId;
	}

After we get an instance of the command e.g. "undo" thru HookAction(),  we have the following action "com.ibm.etools.webedit.editor.internal.actions.override.HookAction" to be activated thru setRegisterAction(a);

Thanks, Polo.
Comment 6 Leopoldo (Polo) Miranda CLA 2012-12-10 16:30:45 EST
Similar problem reported here : https://bugs.eclipse.org/bugs/show_bug.cgi?id=395924
Comment 7 Paul Webster CLA 2012-12-11 08:24:58 EST
What is setRegisterAction(a); doing?  The setGlobalActionHandler(*) should do what is needed to "activate" an action, no?

PW
Comment 8 Leopoldo (Polo) Miranda CLA 2012-12-11 10:55:34 EST
Here the content of com.ibm.etools.webedit.editor.actions.PageDesignerContributor.setRegisterAction(IAction)

	private void setRegisterAction(IAction action) {
		IKeyBindingService svc = (getActionTarget() != null) ? getActionTarget().getEditorSite().getKeyBindingService() : null;
			...
			svc.registerAction(action);
			...
	}


This is full qualified name of registerAction(), 
org.eclipse.ui.internal.KeyBindingService.registerAction(IAction)
Comment 9 Paul Webster CLA 2012-12-11 11:01:34 EST
setGlobalActionHandler(*) already registers the action if it defines an actionDefinitionId

If you then use the keybinding service, you'll end up with a conflict.

You need to remove those calls.

PW
Comment 10 Leopoldo (Polo) Miranda CLA 2012-12-14 19:05:26 EST
Thanks Paul.

By not calling the setRegisterAction() source editor conflicts commands are pretty much gone. I did test it with 20 html files and 10 JSP's opened in a row. 

However, a bunch of other command conflicts are still around, here is the list:

Warning
Fri Dec 14 17:36:33 CST 2012
Conflict for 'org.eclipse.wst.xml.ui.gotoMatchingTag':
HandlerActivation(commandId=org.eclipse.wst.xml.ui.gotoMatchingTag,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.wst.xml.ui.internal.actions.GoToMatchingTagAction@c62b236b)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp8.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=-1849886810)),sourcePriority=67113984)
HandlerActivation(commandId=org.eclipse.wst.xml.ui.gotoMatchingTag,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.wst.xml.ui.internal.actions.GoToMatchingTagAction@380bd767)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp8.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=-1849886810)),sourcePriority=67113984)


Warning
Fri Dec 14 17:33:32 CST 2012
Conflict for 'org.eclipse.ui.edit.text.select.lineEnd':
HandlerActivation(commandId=org.eclipse.ui.edit.text.select.lineEnd,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.AbstractTextEditor$LineEndAction@114c5047)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp8.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=-1849886810)),sourcePriority=67113984)
HandlerActivation(commandId=org.eclipse.ui.edit.text.select.lineEnd,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.TextNavigationAction@2741912e)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp8.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=-1849886810)),sourcePriority=67113984)


Warning
Fri Dec 14 17:33:27 CST 2012
Conflict for 'org.eclipse.ui.file.print':
HandlerActivation(commandId=org.eclipse.ui.file.print,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.TextOperationAction@2ac27390)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp4.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=1749366671)),sourcePriority=67113984)
HandlerActivation(commandId=org.eclipse.ui.file.print,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.AbstractDecoratedTextEditor$11@5d5432f0)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp4.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=1749366671)),sourcePriority=67113984)


Warning
Fri Dec 14 17:33:18 CST 2012
Conflict for 'org.eclipse.ui.edit.text.toggleOverwrite':
HandlerActivation(commandId=org.eclipse.ui.edit.text.toggleOverwrite,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.AbstractTextEditor$ToggleOverwriteModeAction@6c14bfe4)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp12.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=-1043660339)),sourcePriority=67113984)
HandlerActivation(commandId=org.eclipse.ui.edit.text.toggleOverwrite,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.TextNavigationAction@b0258ee6)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp12.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=-1043660339)),sourcePriority=67113984)


Warning
Fri Dec 14 17:33:18 CST 2012
Conflict for 'org.eclipse.ui.file.save':
HandlerActivation(commandId=org.eclipse.ui.file.save,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.internal.SaveAction@3d78b110)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp12.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=-1043660339)),sourcePriority=67113984)
HandlerActivation(commandId=org.eclipse.ui.file.save,
	handler=LegacyHandlerWrapper(ActionHandler(action=com.ibm.etools.webedit.editor.internal.page.SaveSourcePageAction@be9cbf71)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp12.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=-1043660339)),sourcePriority=67113984)


Warning
Fri Dec 14 17:33:16 CST 2012
Conflict for 'org.eclipse.ui.edit.cut':
HandlerActivation(commandId=org.eclipse.ui.edit.cut,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.TextOperationAction@ace6a459)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp11.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=78228174)),sourcePriority=67113984)
HandlerActivation(commandId=org.eclipse.ui.edit.cut,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.TextNavigationAction@2e5dfee6)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp11.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=78228174)),sourcePriority=67113984)


Warning
Fri Dec 14 17:33:14 CST 2012
Conflict for 'org.eclipse.ui.edit.text.goto.lineEnd':
HandlerActivation(commandId=org.eclipse.ui.edit.text.goto.lineEnd,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.TextNavigationAction@4c3d33e2)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp10.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=584474988)),sourcePriority=67113984)
HandlerActivation(commandId=org.eclipse.ui.edit.text.goto.lineEnd,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.AbstractTextEditor$LineEndAction@1b0bc07e)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp10.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=584474988)),sourcePriority=67113984)


Warning
Fri Dec 14 17:32:45 CST 2012
Conflict for 'org.eclipse.ui.edit.text.contentAssist.proposals':
HandlerActivation(commandId=org.eclipse.ui.edit.text.contentAssist.proposals,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.TextOperationAction@a5ad6595)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/html8.html - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=287263651)),sourcePriority=67113984)
HandlerActivation(commandId=org.eclipse.ui.edit.text.contentAssist.proposals,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.ContentAssistAction@1495329c)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/html8.html - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=287263651)),sourcePriority=67113984)


Warning
Fri Dec 14 17:32:25 CST 2012
Conflict for 'org.eclipse.ui.edit.text.goto.lineStart':
HandlerActivation(commandId=org.eclipse.ui.edit.text.goto.lineStart,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.AbstractTextEditor$LineStartAction@8645731)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/html2.html - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=-1238209230)),sourcePriority=67113984)
HandlerActivation(commandId=org.eclipse.ui.edit.text.goto.lineStart,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.TextNavigationAction@9725ec86)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/html2.html - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=-1238209230)),sourcePriority=67113984)



From this list, just one is related with Page Designer (com.ibm.etools.webedit.editor.internal.page.SaveSourcePageAction@be9cbf71)) others are conflicts between eclipse handlers. Any clue ?


I'll do more test on it (PD patch w/out setRegisterAction()).
Comment 11 Paul Webster CLA 2012-12-17 11:13:10 EST
(In reply to comment #8)
> Here the content of
> com.ibm.etools.webedit.editor.actions.PageDesignerContributor.
> setRegisterAction(IAction)
> 
> 	private void setRegisterAction(IAction action) {
> 		IKeyBindingService svc = (getActionTarget() != null) ?
> getActionTarget().getEditorSite().getKeyBindingService() : null;
> 			...
> 			svc.registerAction(action);
> 			...
> 	}

It might be that in 3.x this registers the same action in such a way that it's never used, but also doesn't conflict

PW
Comment 12 Leopoldo (Polo) Miranda CLA 2012-12-18 15:49:21 EST
comment #10, cont... 

More test results... after removing setRegisterAction() calls, editor commands does not conflict as much as before. However, other sort of conflicts still occurs. The following list appears while opening 20 HTML's and 10 JSP's in a row.


Warning
Tue Dec 18 14:08:00 CST 2012
Conflict for 'org.eclipse.ui.edit.text.contentAssist.proposals':
HandlerActivation(commandId=org.eclipse.ui.edit.text.contentAssist.proposals,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.ContentAssistAction@60f4b454)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/html16.html - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=-1243283032)),sourcePriority=67113984)
HandlerActivation(commandId=org.eclipse.ui.edit.text.contentAssist.proposals,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.TextOperationAction@efa1e305)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/html16.html - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=-1243283032)),sourcePriority=67113984)



Warning
Tue Dec 18 14:08:51 CST 2012
Conflict for 'org.eclipse.ui.edit.cut':
HandlerActivation(commandId=org.eclipse.ui.edit.cut,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.TextOperationAction@6e52688a)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/html17.html - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=878421822)),sourcePriority=67113984)
HandlerActivation(commandId=org.eclipse.ui.edit.cut,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.TextOperationAction@c5b96b2c)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/html17.html - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=878421822)),sourcePriority=67113984)


Warning
Tue Dec 18 14:12:05 CST 2012
Conflict for 'org.eclipse.wst.xml.ui.gotoMatchingTag':
HandlerActivation(commandId=org.eclipse.wst.xml.ui.gotoMatchingTag,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.wst.xml.ui.internal.actions.GoToMatchingTagAction@6047f030)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/html20.html - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=1683731684)),sourcePriority=67113984)
HandlerActivation(commandId=org.eclipse.wst.xml.ui.gotoMatchingTag,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.wst.xml.ui.internal.actions.GoToMatchingTagAction@68cd5ab0)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/html20.html - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=1683731684)),sourcePriority=67113984)


Warning
Tue Dec 18 14:12:09 CST 2012
Conflict for 'org.eclipse.ui.edit.text.select.lineEnd':
HandlerActivation(commandId=org.eclipse.ui.edit.text.select.lineEnd,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.TextNavigationAction@dc9f786f)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/html5.html - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=-68316139)),sourcePriority=67113984)
HandlerActivation(commandId=org.eclipse.ui.edit.text.select.lineEnd,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.AbstractTextEditor$LineEndAction@50743fb6)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/html5.html - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=-68316139)),sourcePriority=67113984)

Warning
Tue Dec 18 14:12:12 CST 2012
Conflict for 'org.eclipse.ui.edit.text.select.lineStart':
HandlerActivation(commandId=org.eclipse.ui.edit.text.select.lineStart,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.AbstractTextEditor$LineStartAction@4987592f)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/html8.html - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=1344979352)),sourcePriority=67113984)
HandlerActivation(commandId=org.eclipse.ui.edit.text.select.lineStart,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.TextNavigationAction@374b649)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/html8.html - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=1344979352)),sourcePriority=67113984)

Warning
Tue Dec 18 14:12:15 CST 2012
Conflict for 'org.eclipse.ui.file.print':
HandlerActivation(commandId=org.eclipse.ui.file.print,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.AbstractDecoratedTextEditor$11@86b31a34)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/html9.html - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=-218093913)),sourcePriority=67113984)
HandlerActivation(commandId=org.eclipse.ui.file.print,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.TextOperationAction@26c41633)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/html9.html - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=-218093913)),sourcePriority=67113984)

Warning
Tue Dec 18 14:12:20 CST 2012
Conflict for 'org.eclipse.ui.edit.text.goto.lineEnd':
HandlerActivation(commandId=org.eclipse.ui.edit.text.goto.lineEnd,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.TextNavigationAction@6dd0d41a)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp12.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=1024966552)),sourcePriority=67113984)
HandlerActivation(commandId=org.eclipse.ui.edit.text.goto.lineEnd,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.AbstractTextEditor$LineEndAction@927b8185)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp12.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=1024966552)),sourcePriority=67113984)

Warning
Tue Dec 18 14:12:22 CST 2012
Conflict for 'org.eclipse.ui.edit.text.goto.lineStart':
HandlerActivation(commandId=org.eclipse.ui.edit.text.goto.lineStart,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.AbstractTextEditor$LineStartAction@be800366)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp14.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=674517196)),sourcePriority=67113984)
HandlerActivation(commandId=org.eclipse.ui.edit.text.goto.lineStart,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.texteditor.TextNavigationAction@dbdd4a11)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp14.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=674517196)),sourcePriority=67113984)

Warning
Tue Dec 18 14:12:41 CST 2012
Conflict for 'org.eclipse.ui.file.save':
HandlerActivation(commandId=org.eclipse.ui.file.save,
	handler=LegacyHandlerWrapper(ActionHandler(action=com.ibm.etools.webedit.editor.internal.page.SaveSourcePageAction@55caab86)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp8.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=468577301)),sourcePriority=67113984)
HandlerActivation(commandId=org.eclipse.ui.file.save,
	handler=LegacyHandlerWrapper(ActionHandler(action=org.eclipse.ui.internal.SaveAction@6a02e87a)),
	expression=LegacyHandlerSubmission(Shell {Java EE - DWP/WebContent/jsp8.jsp - Rational® Application Developer for WebSphere® Software},null,PartSite(id=com.ibm.etools.webedit.editor.HTMLEditor,pluginId=com.ibm.etools.webedit.editor,registeredName=Page Designer,hashCode=468577301)),sourcePriority=67113984)
Comment 13 Nick Sandonato CLA 2013-01-16 14:34:42 EST
A case where I can see this happening is with an XML Schema file using the XSD Editor from WTP.

In ActionContributorXML's setActiveEditor, it calls setAction using the GoToMatchingTagAction on the text editor. This is done every time the XSD editor is set as the active editor. It ends up unregistering that GoToMatchingTagAction, and in the process , it activates the nested service and creates new LegacyHandlerWrappers.

LegacyHandlerWrapper.<init>(IHandler) line: 49	
WorkbenchCommandSupport.addHandlerSubmission(HandlerSubmission) line: 118	
WorkbenchCommandSupport.addHandlerSubmissions(Collection) line: 131	
KeyBindingService.activateNestedService(IKeyBindingService) line: 235	
KeyBindingService.unregisterAction(IAction) line: 625	
KeyBindingService.registerAction(IAction) line: 501	
AbstractTextEditor$ActivationCodeTrigger.registerActionForKeyActivation(IAction) line: not available	
StructuredTextEditor(AbstractTextEditor).setAction(String, IAction) line: not available	
SourcePageActionContributor(ActionContributorXML).setActiveEditor(IEditorPart) line: 199	


So later on down the road, the HandlerAuthority tries to resolve conflicts. When it compares the two handlers, the activation comparison is 0, so then it checks the handler equivalence. This is where the conflict is found.

I think the problem is that the handlers are being compared using == instead of .equals(). These LegacyHandlerWrapper's contain the exact same ActionHandler; however, the LegacyHandlerWrappers are *not* the same object. I think they need to be compared with .equals().
Comment 14 Paul Webster CLA 2013-03-22 09:16:00 EDT
(In reply to comment #13)
> A case where I can see this happening is with an XML Schema file using the
> XSD Editor from WTP.

Do you have steps to reproduce this in WTP?

The impression I get:

1) have multiple multi-page editors open
2) use their source views and switch around and edit
3) eventually this problem will manifest

PW
Comment 15 Leopoldo (Polo) Miranda CLA 2013-04-05 19:17:58 EDT
One thing to keep in mind in regard of "Target Milestone", currently set to 4.3 M7. According my tests based in Eclipse 4.2.2, I was not able to reproduce this problem (unless following the same patter as I used to follow based on Eclipse 3.6.2+), however, tests on Eclipse 3.6.2+ easily hits this problem flooding the log with warning conflict-commands.
Comment 16 Paul Webster CLA 2013-05-16 07:37:38 EDT
It seems there's a problem in some JVMs that can cause org.eclipse.ui.internal.util.Util.compareIdentity(Object, Object) to fail (System.identityHashCode(left) - System.identityHashCode(right)).  That means that sometimes the Set of active handlers (which uses this method in its comparator) can fail to find an existing activation (so it doesn't get removed from the set) and the next time a new one is added, you get this conflict.
Comment 17 Paul Webster CLA 2013-05-16 07:39:20 EDT
Created attachment 231071 [details]
Fix to prevent the overflow

Taking the ABS values prevents the int overflow we suspect of causing the problem.  For those with the reproducible problem, this patch prevents the problem from surfacing.

PW
Comment 18 Leopoldo (Polo) Miranda CLA 2013-05-20 10:09:35 EDT
Hi Paul,

I've tested the patch and I have no conflicts in the log. Looks good to me.

Thanks, Polo.
Comment 20 Dani Megert CLA 2013-07-29 10:38:34 EDT
(In reply to comment #19)
> Released as 
> http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/
> ?h=R3_7_maintenance&id=91f5f783c263ec7860010b30745401a54aff0db5

This backport forgot to update the bundle version, tag the fix and update the map file. This has now been done as part of backporting bug 413623.
Comment 21 Paul Webster CLA 2013-07-29 10:57:22 EDT
(In reply to comment #20)
> 
> This backport forgot to update the bundle version, tag the fix and update
> the map file. This has now been done as part of backporting bug 413623.

Thanks Dani, and sorry about that.

PW