Bug 536645 - Contentassist in CommitMessage textfield of Staging View not working
Summary: Contentassist in CommitMessage textfield of Staging View not working
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 4.11   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 5.11   Edit
Assignee: Simeon Andreev CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 561518 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-07-03 09:20 EDT by Stefan Nöbauer CLA
Modified: 2021-12-07 11:01 EST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Nöbauer CLA 2018-07-03 09:20:34 EDT
After entering messages in the commit message textfield no content assist is provided on new commits.
In the Commit Dialog the content assist is working fine.
Comment 1 Michael Keppler CLA 2018-07-06 12:18:18 EDT
cannot reproduce in 5.0.1 (which is the current version). For me Ctrl-Space gives code completion, and even without typing anything, the light bulb next to the commit message field indicates content assist.
Comment 2 Andrey Loskutov CLA 2018-07-06 12:20:33 EDT
May be it is related to errors I get pretty often in staging view: Conflicting handlers for org.eclipse.ui.edit.copy: {ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1@118224f)} vs {ActionHandler(org.eclipse.egit.ui.internal.dialogs.SpellcheckableMessageArea$TextViewerAction@48e606ff)}
Comment 3 Thomas Wolf CLA 2018-07-07 07:09:48 EDT
(In reply to Andrey Loskutov from comment #2)
> May be it is related to errors I get pretty often in staging view:
> Conflicting handlers for org.eclipse.ui.edit.copy:

Never seen that, but yes, a handler conflict might lead to this. Which platform (Win, gtk) ?

Perhaps bug 535521 is also related. There apparently Ctrl-Z in the commit message viewer doesn't work. Though the user said there were no handler conflicts reported.
Comment 4 Stefan Nöbauer CLA 2018-07-26 11:03:44 EDT
(In reply to Thomas Wolf from comment #3)
> (In reply to Andrey Loskutov from comment #2)
> > May be it is related to errors I get pretty often in staging view:
> > Conflicting handlers for org.eclipse.ui.edit.copy:
> 
> Never seen that, but yes, a handler conflict might lead to this. Which
> platform (Win, gtk) ?
> 
> Perhaps bug 535521 is also related. There apparently Ctrl-Z in the commit
> message viewer doesn't work. Though the user said there were no handler
> conflicts reported.

I am on Windows 

Somehow this failure now disappeared
Comment 5 Andrey Loskutov CLA 2019-01-29 09:26:49 EST
Just got those crazy errors again, with latest platform / egit. Now we have a bit more "context" information.

Both egit handlers are registered for StagingView: one is coming from 

org.eclipse.egit.ui.internal.staging.StagingView.createSelectionPathCopyAction(TreeViewer)

and another one is from

org.eclipse.egit.ui.internal.dialogs.SpellcheckableMessageArea.configureContextMenu()

Both are obviously created for EGit Staging view.


eclipse.buildId=4.11.0.I20190127-1800
java.version=11.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -data file:/data/4x_platform_workspace/ -os linux -ws gtk -arch x86_64

org.eclipse.ui
Error
Mon Jan 28 16:39:05 CET 2019
Conflicting handlers for org.eclipse.ui.edit.copy: {ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1@74403f19)} vs {ActionHandler(org.eclipse.egit.ui.internal.dialogs.SpellcheckableMessageArea$TextViewerAction@41cf97d8)} in: PartImpl (org.eclipse.egit.ui.StagingView) Context

java.lang.IllegalStateException: Conflicting handlers: {[ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1@74403f19),  for 'org.eclipse.ui.edit.copy',  in PartImpl (org.eclipse.egit.ui.StagingView) Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell {4x_platform_workspace - org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java}), ActivePartExpression(org.eclipse.egit.ui.internal.staging.StagingView@a58abd5)]], active=true, sourcePriority=1065984, participating=true]} vs {[ActionHandler(org.eclipse.egit.ui.internal.dialogs.SpellcheckableMessageArea$TextViewerAction@41cf97d8),  for 'org.eclipse.ui.edit.copy',  in PartImpl (org.eclipse.egit.ui.StagingView) Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell {4x_platform_workspace - org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java}), ActivePartExpression(org.eclipse.egit.ui.internal.staging.StagingView@a58abd5)]], active=true, sourcePriority=1065984, participating=true]} in: PartImpl (org.eclipse.egit.ui.StagingView) Context
	at org.eclipse.ui.internal.handlers.LegacyHandlerService$HandlerSelectionFunction.compute(LegacyHandlerService.java:146)
	at org.eclipse.e4.core.internal.contexts.ValueComputation.get(ValueComputation.java:65)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.internalGet(EclipseContext.java:272)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.get(EclipseContext.java:238)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.lookUpHandler(HandlerServiceImpl.java:103)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.handlerChanged(E4HandlerProxy.java:115)
	at org.eclipse.core.commands.AbstractHandler.fireHandlerChanged(AbstractHandler.java:77)
	at org.eclipse.jface.commands.ActionHandler.lambda$0(ActionHandler.java:81)
	at org.eclipse.jface.action.AbstractAction.firePropertyChange(AbstractAction.java:52)
	at org.eclipse.jface.action.AbstractAction.firePropertyChange(AbstractAction.java:75)
	at org.eclipse.jface.action.Action.setEnabled(Action.java:543)
	at org.eclipse.egit.ui.internal.dialogs.SpellcheckableMessageArea$TextViewerAction.update(SpellcheckableMessageArea.java:149)
	at org.eclipse.egit.ui.internal.dialogs.SpellcheckableMessageArea$8.selectionChanged(SpellcheckableMessageArea.java:685)
	at org.eclipse.jface.viewers.Viewer$1.run(Viewer.java:158)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:47)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:176)
	at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:155)
	at org.eclipse.jface.text.TextViewer.fireSelectionChanged(TextViewer.java:2596)
	at org.eclipse.jface.text.TextViewer.selectionChanged(TextViewer.java:2575)
	at org.eclipse.jface.text.TextViewer$1.widgetSelected(TextViewer.java:1749)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5769)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1401)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1427)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1410)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1186)
	at org.eclipse.swt.custom.StyledText.sendSelectionEvent(StyledText.java:8295)
	at org.eclipse.swt.custom.StyledText.doSelection(StyledText.java:3255)
	at org.eclipse.swt.custom.StyledText.doMouseSelection(StyledText.java:2868)
	at org.eclipse.swt.custom.StyledText.doMouseLocationChange(StyledText.java:2853)
	at org.eclipse.swt.custom.StyledText.handleMouseMove(StyledText.java:6181)
	at org.eclipse.swt.custom.StyledText.lambda$1(StyledText.java:5772)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5769)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1401)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5037)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4567)
Comment 6 Thomas Wolf CLA 2019-01-29 11:32:13 EST
(In reply to Andrey Loskutov from comment #5)
> Just got those crazy errors again, with latest platform / egit. Now we have
> a bit more "context" information.
> 
> Both egit handlers are registered for StagingView: one is coming from 
> 
> org.eclipse.egit.ui.internal.staging.StagingView.
> createSelectionPathCopyAction(TreeViewer)
> 
> and another one is from
> 
> org.eclipse.egit.ui.internal.dialogs.SpellcheckableMessageArea.
> configureContextMenu()
> 
> Both are obviously created for EGit Staging view.
> 
> 
> eclipse.buildId=4.11.0.I20190127-1800
> java.version=11.0.1
> java.vendor=Oracle Corporation
> BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
> Command-line arguments:  -data file:/data/4x_platform_workspace/ -os linux
> -ws gtk -arch x86_64
> 
> org.eclipse.ui
> Error
> Mon Jan 28 16:39:05 CET 2019
> Conflicting handlers for org.eclipse.ui.edit.copy:
> {ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1@74403f19)} vs
> {ActionHandler(org.eclipse.egit.ui.internal.dialogs.
> SpellcheckableMessageArea$TextViewerAction@41cf97d8)} in: PartImpl
> (org.eclipse.egit.ui.StagingView) Context
> 
> java.lang.IllegalStateException: Conflicting handlers:
> {[ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1@74403f19),  for
> 'org.eclipse.ui.edit.copy',  in PartImpl (org.eclipse.egit.ui.StagingView)
> Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell
> {4x_platform_workspace -
> org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/
> CompletionProposalPopup.java}),
> ActivePartExpression(org.eclipse.egit.ui.internal.staging.
> StagingView@a58abd5)]], active=true, sourcePriority=1065984,
> participating=true]} vs
> {[ActionHandler(org.eclipse.egit.ui.internal.dialogs.
> SpellcheckableMessageArea$TextViewerAction@41cf97d8),  for
> 'org.eclipse.ui.edit.copy',  in PartImpl (org.eclipse.egit.ui.StagingView)
> Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell
> {4x_platform_workspace -
> org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/
> CompletionProposalPopup.java}),
> ActivePartExpression(org.eclipse.egit.ui.internal.staging.
> StagingView@a58abd5)]], active=true, sourcePriority=1065984,
> participating=true]} in: PartImpl (org.eclipse.egit.ui.StagingView) Context

Both handlers are registered and unregistered at the site's handler service via focus listeners. One should be registered only when the staged/unstaged viewer has the focus, and one when the commit message text area is focused. Both being present would mean that somehow, somewhen, a FocusOut event got lost.
Comment 7 Stephan Herrmann CLA 2020-01-26 08:41:14 EST
I'm seeing the following with EGit 5.7.0. Related?

Happens when activating the Staging View from any other view in the same stack, except: switching from Local History to Staging works (but then some actions in the staging view may trigger it again).

Annoying: when Error Log is in the same stack as Staging View, making the Staging View visible is hardly possible.

java.lang.IllegalStateException: Conflicting handlers: {[ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1@5f417404),  for 'org.eclipse.ui.edit.copy',  in PartImpl (org.eclipse.egit.ui.StagingView) Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell {ws - Compare /org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java Current and Index - Eclipse SDK}), ActivePartExpression(org.eclipse.egit.ui.internal.staging.StagingView@19bdb94c)]], active=true, sourcePriority=1065984, participating=true]} vs {[ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$2@6f606098),  for 'org.eclipse.ui.edit.copy',  in PartImpl (org.eclipse.egit.ui.StagingView) Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell {ws - Compare /org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java Current and Index - Eclipse SDK}), ActivePartExpression(org.eclipse.egit.ui.internal.staging.StagingView@19bdb94c)]], active=true, sourcePriority=1065984, participating=true]} in: PartImpl (org.eclipse.egit.ui.StagingView) Context
	at org.eclipse.ui.internal.handlers.LegacyHandlerService$HandlerSelectionFunction.compute(LegacyHandlerService.java:145)
	at org.eclipse.e4.core.internal.contexts.ValueComputation.get(ValueComputation.java:70)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.internalGet(EclipseContext.java:271)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.get(EclipseContext.java:237)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.lookUpHandler(HandlerServiceImpl.java:103)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.setEnabled(HandlerServiceHandler.java:75)
	at org.eclipse.core.commands.Command.setEnabled(Command.java:856)
	at org.eclipse.ui.menus.CommandContributionItem.isEnabled(CommandContributionItem.java:916)
	at org.eclipse.ui.menus.CommandContributionItem.updateMenuItem(CommandContributionItem.java:531)
	at org.eclipse.ui.menus.CommandContributionItem.update(CommandContributionItem.java:484)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:860)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:860)
	at org.eclipse.ui.internal.Workbench.updateActiveWorkbenchWindowMenuManager(Workbench.java:3216)
	at org.eclipse.ui.internal.Workbench.lambda$0(Workbench.java:3198)
	at org.eclipse.jface.bindings.BindingManager.fireBindingManagerChanged(BindingManager.java:903)
	at org.eclipse.jface.bindings.BindingManager.setActiveBindings(BindingManager.java:2183)
	at org.eclipse.jface.bindings.BindingManager.recomputeBindings(BindingManager.java:1744)
	at org.eclipse.jface.bindings.BindingManager.contextManagerChanged(BindingManager.java:693)
	at org.eclipse.core.commands.contexts.ContextManager.fireContextManagerChanged(ContextManager.java:164)
	at org.eclipse.core.commands.contexts.ContextManager.setEventCaching(ContextManager.java:323)
	at org.eclipse.core.commands.contexts.ContextManager.deferUpdates(ContextManager.java:85)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:781)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:683)
	at org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.activate(AbstractPartRenderer.java:97)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.lambda$0(ContributedPartRenderer.java:63)




Here's what happens when double clicking an unstaged change:

java.lang.IllegalStateException: Conflicting handlers: {[ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1@5f417404),  for 'org.eclipse.ui.edit.copy',  in PartImpl (org.eclipse.egit.ui.StagingView) Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell {ws - Eclipse SDK}), ActivePartExpression(org.eclipse.egit.ui.internal.staging.StagingView@19bdb94c)]], active=true, sourcePriority=1065984, participating=true]} vs {[ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1@14b29807),  for 'org.eclipse.ui.edit.copy',  in PartImpl (org.eclipse.egit.ui.StagingView) Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell {ws - Eclipse SDK}), ActivePartExpression(org.eclipse.egit.ui.internal.staging.StagingView@19bdb94c)]], active=true, sourcePriority=1065984, participating=true]} in: PartImpl (org.eclipse.egit.ui.StagingView) Context
	at org.eclipse.ui.internal.handlers.LegacyHandlerService$HandlerSelectionFunction.compute(LegacyHandlerService.java:145)
	at org.eclipse.e4.core.internal.contexts.ValueComputation.get(ValueComputation.java:70)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.internalGet(EclipseContext.java:271)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.get(EclipseContext.java:237)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.lookUpHandler(HandlerServiceImpl.java:103)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.setEnabled(HandlerServiceHandler.java:75)
	at org.eclipse.core.commands.Command.setEnabled(Command.java:856)
	at org.eclipse.ui.menus.CommandContributionItem.isEnabled(CommandContributionItem.java:916)
	at org.eclipse.ui.menus.CommandContributionItem.updateMenuItem(CommandContributionItem.java:531)
	at org.eclipse.ui.menus.CommandContributionItem.update(CommandContributionItem.java:484)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:860)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:860)
	at org.eclipse.ui.internal.Workbench.updateActiveWorkbenchWindowMenuManager(Workbench.java:3216)
	at org.eclipse.ui.internal.Workbench.lambda$0(Workbench.java:3198)
	at org.eclipse.jface.bindings.BindingManager.fireBindingManagerChanged(BindingManager.java:903)
	at org.eclipse.jface.bindings.BindingManager.setActiveBindings(BindingManager.java:2183)
	at org.eclipse.jface.bindings.BindingManager.recomputeBindings(BindingManager.java:1769)
	at org.eclipse.jface.bindings.BindingManager.contextManagerChanged(BindingManager.java:693)
	at org.eclipse.core.commands.contexts.ContextManager.fireContextManagerChanged(ContextManager.java:164)
	at org.eclipse.core.commands.contexts.ContextManager.setEventCaching(ContextManager.java:323)
	at org.eclipse.core.commands.contexts.ContextManager.deferUpdates(ContextManager.java:85)
	at org.eclipse.ui.internal.contexts.ContextService.deferUpdates(ContextService.java:91)
	at org.eclipse.ui.internal.WorkbenchPage$ActionSwitcher.updateActionSets(WorkbenchPage.java:814)
	at org.eclipse.ui.internal.WorkbenchPage$ActionSwitcher.updateTopEditor(WorkbenchPage.java:727)
	at org.eclipse.ui.internal.WorkbenchPage.updateActiveEditorSources(WorkbenchPage.java:421)
	at org.eclipse.ui.internal.WorkbenchPage.updateBroughtToTop(WorkbenchPage.java:465)
	at org.eclipse.ui.internal.WorkbenchPage.access$4(WorkbenchPage.java:464)
	at org.eclipse.ui.internal.WorkbenchPage$E4PartListener.partBroughtToTop(WorkbenchPage.java:222)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$7.run(PartServiceImpl.java:317)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.firePartBroughtToTop(PartServiceImpl.java:314)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.access$4(PartServiceImpl.java:312)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$1.handleEvent(PartServiceImpl.java:109)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.lambda$0(UIEventHandler.java:38)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:236)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:133)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:5830)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:219)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:205)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:203)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:132)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:75)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:63)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElementGen(ElementContainerImpl.java:170)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:188)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:661)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:625)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:790)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:404)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1266)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3195)
	at org.eclipse.ui.internal.WorkbenchPage.lambda$9(WorkbenchPage.java:3100)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:72)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3098)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3068)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3059)
	at org.eclipse.compare.internal.CompareUIPlugin.lambda$0(CompareUIPlugin.java:565)
	at org.eclipse.compare.internal.CompareUIPlugin.syncExec(CompareUIPlugin.java:1405)
	at org.eclipse.compare.internal.CompareUIPlugin.internalOpenEditor(CompareUIPlugin.java:575)
	at org.eclipse.compare.internal.CompareUIPlugin.openEditorInBackground(CompareUIPlugin.java:547)
	at org.eclipse.compare.internal.CompareUIPlugin.openCompareEditor(CompareUIPlugin.java:536)
	at org.eclipse.compare.CompareUI.openCompareEditorOnPage(CompareUI.java:174)
	at org.eclipse.compare.CompareUI.openCompareEditor(CompareUI.java:143)
	at org.eclipse.compare.CompareUI.openCompareEditor(CompareUI.java:127)
	at org.eclipse.egit.ui.internal.CompareUtils.openInCompare(CompareUtils.java:319)
	at org.eclipse.egit.ui.internal.CompareUtils.openCompareEditorRunnable(CompareUtils.java:533)
	at org.eclipse.egit.ui.internal.CompareUtils.access$3(CompareUtils.java:518)
	at org.eclipse.egit.ui.internal.CompareUtils$2.run(CompareUtils.java:526)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4963)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4484)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:660)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:559)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:154)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1420)


The issue stopped when switching the History view to show git history instead of Local History
Comment 8 Stephan Herrmann CLA 2020-01-26 08:43:10 EST
(In reply to Stephan Herrmann from comment #7)
> The issue stopped when switching the History view to show git history
> instead of Local History

I spoke too soon. The fix didn't last long. One double-click worked. Next click (on Amend) broke it again.
Comment 9 Thomas Wolf CLA 2020-03-27 11:53:41 EDT
*** Bug 561518 has been marked as a duplicate of this bug. ***
Comment 10 Gayan Perera CLA 2020-04-05 14:05:05 EDT
This is not working on linux as well time to time. Seems like we have something wrong here. Will try to look more into it when time permits, if someone else has time please have a look at it.
Comment 11 Simeon Andreev CLA 2020-12-11 08:28:00 EST
(In reply to Stephan Herrmann from comment #7)
> ...
> Conflicting handlers: {[ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1@5f417404),  for 'org.eclipse.ui.edit.copy',  in PartImpl (org.eclipse.egit.ui.StagingView) Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell {ws - Compare /org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java Current and Index - Eclipse SDK}), ActivePartExpression(org.eclipse.egit.ui.internal.staging.StagingView@19bdb94c)]], active=true, sourcePriority=1065984, participating=true]} vs {[ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$2@6f606098)
> ...


The conflicting handlers are registered e.g. with these stack traces (I've changed the code to not use anonymous classes; lines will be different):

java.lang.Exception: ActionUtilsAction with definitionId=org.eclipse.ui.edit.copy
	at org.eclipse.egit.ui.internal.ActionUtils.createGlobalAction(ActionUtils.java:70)
	at org.eclipse.egit.ui.internal.staging.StagingView.createSelectionPathCopyAction(StagingView.java:2249)
	at org.eclipse.egit.ui.internal.staging.StagingView.addCopyAction(StagingView.java:2238)
	at org.eclipse.egit.ui.internal.staging.StagingView.createViewer(StagingView.java:2231)
	at org.eclipse.egit.ui.internal.staging.StagingView.createPartControl(StagingView.java:886)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:158)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityView.createPartControl(CompatibilityView.java:155)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:365)

java.lang.Exception: ActionUtilsUpdateableAction with definitionId=org.eclipse.ui.edit.copy
	at org.eclipse.egit.ui.internal.ActionUtils.createGlobalAction(ActionUtils.java:114)
	at org.eclipse.egit.ui.internal.ActionUtils.createTextAction(ActionUtils.java:163)
	at org.eclipse.egit.ui.internal.ActionUtils.createStandardTextActions(ActionUtils.java:183)
	at org.eclipse.egit.ui.internal.ActionUtils.fillStandardTextActions(ActionUtils.java:210)
	at org.eclipse.egit.ui.internal.dialogs.SpellcheckableMessageArea.configureContextMenu(SpellcheckableMessageArea.java:384)
	at org.eclipse.egit.ui.internal.dialogs.SpellcheckableMessageArea.<init>(SpellcheckableMessageArea.java:271)
	at org.eclipse.egit.ui.internal.dialogs.SpellcheckableMessageArea.<init>(SpellcheckableMessageArea.java:131)
	at org.eclipse.egit.ui.internal.dialogs.CommitMessageArea.<init>(CommitMessageArea.java:36)
	at org.eclipse.egit.ui.internal.staging.StagingView$18.<init>(StagingView.java:1052)
	at org.eclipse.egit.ui.internal.staging.StagingView.createPartControl(StagingView.java:1053)


I see the same for the History view, though I've not seen a conflict reported for the History view (not sure what is different there):

java.lang.Exception: ActionUtilsAction with definitionId=org.eclipse.ui.edit.copy
	at org.eclipse.egit.ui.internal.ActionUtils.createGlobalAction(ActionUtils.java:70)
	at org.eclipse.egit.ui.internal.history.CommitGraphTable.<init>(CommitGraphTable.java:307)
	at org.eclipse.egit.ui.internal.history.CommitGraphTable.<init>(CommitGraphTable.java:342)
	at org.eclipse.egit.ui.internal.history.GitHistoryPage.createControl(GitHistoryPage.java:1420)
	at org.eclipse.team.internal.ui.history.GenericHistoryView.doCreatePage(GenericHistoryView.java:775)
	at org.eclipse.ui.part.PageBookView.createPage(PageBookView.java:369)
	at org.eclipse.ui.part.PageBookView.partActivated(PageBookView.java:696)
	at org.eclipse.team.internal.ui.history.GenericHistoryView.showHistoryPageFor(GenericHistoryView.java:626)
	at org.eclipse.team.internal.ui.history.GenericHistoryView.showLastSelectedElement(GenericHistoryView.java:567)
	at org.eclipse.team.internal.ui.history.GenericHistoryView.access$2(GenericHistoryView.java:552)
	at org.eclipse.team.internal.ui.history.GenericHistoryView$1.selectionChanged(GenericHistoryView.java:406)

java.lang.Exception: ActionUtilsUpdateableAction with definitionId=org.eclipse.ui.edit.copy
	at org.eclipse.egit.ui.internal.ActionUtils.createGlobalAction(ActionUtils.java:114)
	at org.eclipse.egit.ui.internal.history.CommitMessageViewer.<init>(CommitMessageViewer.java:197)
	at org.eclipse.egit.ui.internal.history.CommitAndDiffComponent.<init>(CommitAndDiffComponent.java:102)
	at org.eclipse.egit.ui.internal.history.GitHistoryPage.createControl(GitHistoryPage.java:1427)
	at org.eclipse.team.internal.ui.history.GenericHistoryView.doCreatePage(GenericHistoryView.java:775)
	at org.eclipse.ui.part.PageBookView.createPage(PageBookView.java:369)
	at org.eclipse.ui.part.PageBookView.partActivated(PageBookView.java:696)
	at org.eclipse.team.internal.ui.history.GenericHistoryView.showHistoryPageFor(GenericHistoryView.java:626)
	at org.eclipse.team.internal.ui.history.GenericHistoryView.showLastSelectedElement(GenericHistoryView.java:567)
	at org.eclipse.team.internal.ui.history.GenericHistoryView.access$2(GenericHistoryView.java:552)
	at org.eclipse.team.internal.ui.history.GenericHistoryView$1.selectionChanged(GenericHistoryView.java:406)
Comment 12 Simeon Andreev CLA 2020-12-11 10:21:14 EST
(In reply to Thomas Wolf from comment #6)
> Both handlers are registered and unregistered at the site's handler service
> via focus listeners. One should be registered only when the staged/unstaged
> viewer has the focus, and one when the commit message text area is focused.
> Both being present would mean that somehow, somewhen, a FocusOut event got
> lost.

For the conflict that Shephan listed in comment 7, I think this is correct. In particular I see the handler conflict reported on an SWT event activation, followed by an SWT focus lost event (which disables the handler, but after the conflict is detected):


!ENTRY org.eclipse.ui 4 4 2020-12-11 15:40:10.437
!MESSAGE Conflicting handlers for org.eclipse.ui.edit.copy: {ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1ActionUtilsAction@6f9e6a85)} vs {ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1ActionUtilsUpdateableAction@1f3310fc)} in: PartImpl (org.eclipse.egit.ui.StagingView) Context
!STACK 0
java.lang.IllegalStateException: Conflicting handlers: {[ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1ActionUtilsAction@6f9e6a85),  for 'org.eclipse.ui.edit.copy',  in PartImpl (org.eclipse.egit.ui.StagingView) Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell {contributor_runtime_eclipse_jre11 - /home/sandreev/git/misc/TestRepository/TestProject/src/a/A.java - Eclipse SDK}), ActivePartExpression(org.eclipse.egit.ui.internal.staging.StagingView@6f6998b6)]], active=true, sourcePriority=1065984, participating=true]} vs {[ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1ActionUtilsUpdateableAction@1f3310fc),  for 'org.eclipse.ui.edit.copy',  in PartImpl (org.eclipse.egit.ui.StagingView) Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell {contributor_runtime_eclipse_jre11 - /home/sandreev/git/misc/TestRepository/TestProject/src/a/A.java - Eclipse SDK}), ActivePartExpression(org.eclipse.egit.ui.internal.staging.StagingView@6f6998b6)]], active=true, sourcePriority=1065984, participating=true]} in: PartImpl (org.eclipse.egit.ui.StagingView) Context
	at org.eclipse.ui.internal.handlers.LegacyHandlerService$HandlerSelectionFunction.compute(LegacyHandlerService.java:145)
	at org.eclipse.e4.core.internal.contexts.ValueComputation.get(ValueComputation.java:70)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.internalGet(EclipseContext.java:250)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.get(EclipseContext.java:237)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.lookUpHandler(HandlerServiceImpl.java:103)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.setEnabled(HandlerServiceHandler.java:75)
	at org.eclipse.core.commands.Command.setEnabled(Command.java:856)
	at org.eclipse.ui.menus.CommandContributionItem.isEnabled(CommandContributionItem.java:916)
	at org.eclipse.ui.menus.CommandContributionItem.updateMenuItem(CommandContributionItem.java:531)
	at org.eclipse.ui.menus.CommandContributionItem.update(CommandContributionItem.java:484)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:860)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:860)
	at org.eclipse.ui.internal.Workbench.updateActiveWorkbenchWindowMenuManager(Workbench.java:3152)
	at org.eclipse.ui.internal.Workbench.lambda$0(Workbench.java:3134)
	at org.eclipse.jface.bindings.BindingManager.fireBindingManagerChanged(BindingManager.java:903)
	at org.eclipse.jface.bindings.BindingManager.setActiveBindings(BindingManager.java:2183)
	at org.eclipse.jface.bindings.BindingManager.recomputeBindings(BindingManager.java:1744)
	at org.eclipse.jface.bindings.BindingManager.contextManagerChanged(BindingManager.java:693)
	at org.eclipse.core.commands.contexts.ContextManager.fireContextManagerChanged(ContextManager.java:164)
	at org.eclipse.core.commands.contexts.ContextManager.setEventCaching(ContextManager.java:323)
	at org.eclipse.core.commands.contexts.ContextManager.deferUpdates(ContextManager.java:85)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:777)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:679)
	at org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.activate(AbstractPartRenderer.java:97)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.lambda$0(ContributedPartRenderer.java:63)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5785)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1427)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1453)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1436)
	at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:2105)
	at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:2068)
	at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:4761)
	at org.eclipse.swt.widgets.Control.gtk_event_after(Control.java:3741)
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2283)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:6757)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:6031)
	at org.eclipse.swt.internal.gtk.GTK.gtk_widget_grab_focus(Native Method)
	at org.eclipse.swt.widgets.Control.forceFocus(Control.java:2914)
	at org.eclipse.swt.widgets.Composite.forceFocus(Composite.java:705)
	at org.eclipse.swt.widgets.Control.forceFocus(Control.java:2907)
	at org.eclipse.swt.widgets.Control.setFocus(Control.java:5376)
	at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1648)
	at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1646)
	at org.eclipse.egit.ui.internal.staging.StagingView.setFocus(StagingView.java:4455)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.delegateSetFocus(CompatibilityPart.java:226)
	at jdk.internal.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:319)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:325)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:247)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:147)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.focusGui(PartRenderingEngine.java:792)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$1.setFocus(ContributedPartRenderer.java:106)
	at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1646)
	at org.eclipse.swt.custom.CTabItem.setFocus(CTabItem.java:379)
	at org.eclipse.swt.custom.CTabFolder.setFocus(CTabFolder.java:2676)
	at org.eclipse.swt.widgets.Control.fixFocus(Control.java:316)
	at org.eclipse.swt.widgets.Control.setVisible(Control.java:6043)
	at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3229)
	at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3237)
	at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1879)
	at org.eclipse.swt.custom.CTabFolder.lambda$0(CTabFolder.java:330)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5785)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1427)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5048)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4526)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1461)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1434)

java.lang.Exception: deactivating handlers: [[ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1ActionUtilsUpdateableAction@978475b),  for 'org.eclipse.ui.edit.undo',  in PartImpl (org.eclipse.egit.ui.StagingView) Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell {contributor_runtime_eclipse_jre11 - /home/sandreev/git/misc/TestRepository/TestProject/src/a/A.java - Eclipse SDK}), ActivePartExpression(org.eclipse.egit.ui.internal.staging.StagingView@6f6998b6)]], active=false, sourcePriority=1065984, participating=true], [ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1ActionUtilsUpdateableAction@5bb90b89),  for 'org.eclipse.ui.edit.redo',  in PartImpl (org.eclipse.egit.ui.StagingView) Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell {contributor_runtime_eclipse_jre11 - /home/sandreev/git/misc/TestRepository/TestProject/src/a/A.java - Eclipse SDK}), ActivePartExpression(org.eclipse.egit.ui.internal.staging.StagingView@6f6998b6)]], active=false, sourcePriority=1065984, participating=true], [ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1ActionUtilsUpdateableAction@4c231f62),  for 'org.eclipse.ui.edit.cut',  in PartImpl (org.eclipse.egit.ui.StagingView) Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell {contributor_runtime_eclipse_jre11 - /home/sandreev/git/misc/TestRepository/TestProject/src/a/A.java - Eclipse SDK}), ActivePartExpression(org.eclipse.egit.ui.internal.staging.StagingView@6f6998b6)]], active=true, sourcePriority=1065984, participating=true], [ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1ActionUtilsUpdateableAction@1f3310fc),  for 'org.eclipse.ui.edit.copy',  in PartImpl (org.eclipse.egit.ui.StagingView) Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell {contributor_runtime_eclipse_jre11 - /home/sandreev/git/misc/TestRepository/TestProject/src/a/A.java - Eclipse SDK}), ActivePartExpression(org.eclipse.egit.ui.internal.staging.StagingView@6f6998b6)]], active=true, sourcePriority=1065984, participating=true], [ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1ActionUtilsUpdateableAction@7bfedfb7),  for 'org.eclipse.ui.edit.paste',  in PartImpl (org.eclipse.egit.ui.StagingView) Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell {contributor_runtime_eclipse_jre11 - /home/sandreev/git/misc/TestRepository/TestProject/src/a/A.java - Eclipse SDK}), ActivePartExpression(org.eclipse.egit.ui.internal.staging.StagingView@6f6998b6)]], active=true, sourcePriority=1065984, participating=true], [ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1ActionUtilsUpdateableAction@393d4e34),  for 'org.eclipse.ui.edit.delete',  in PartImpl (org.eclipse.egit.ui.StagingView) Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell {contributor_runtime_eclipse_jre11 - /home/sandreev/git/misc/TestRepository/TestProject/src/a/A.java - Eclipse SDK}), ActivePartExpression(org.eclipse.egit.ui.internal.staging.StagingView@6f6998b6)]], active=true, sourcePriority=1065984, participating=true], [ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1ActionUtilsUpdateableAction@2d5b549b),  for 'org.eclipse.ui.edit.selectAll',  in PartImpl (org.eclipse.egit.ui.StagingView) Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell {contributor_runtime_eclipse_jre11 - /home/sandreev/git/misc/TestRepository/TestProject/src/a/A.java - Eclipse SDK}), ActivePartExpression(org.eclipse.egit.ui.internal.staging.StagingView@6f6998b6)]], active=true, sourcePriority=1065984, participating=true], [ActionHandler(org.eclipse.egit.ui.internal.dialogs.SpellcheckableMessageArea$QuickfixAction@60493524),  for 'org.eclipse.jdt.ui.edit.text.java.correction.assist.proposals',  in PartImpl (org.eclipse.egit.ui.StagingView) Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell {contributor_runtime_eclipse_jre11 - /home/sandreev/git/misc/TestRepository/TestProject/src/a/A.java - Eclipse SDK}), ActivePartExpression(org.eclipse.egit.ui.internal.staging.StagingView@
6f6998b6)]], active=false, sourcePriority=1065984, participating=true], [ActionHandler(org.eclipse.egit.ui.internal.dialogs.SpellcheckableMessageArea$8@1da5635e),  for 'org.eclipse.ui.edit.text.contentAssist.proposals',  in PartImpl (org.eclipse.egit.ui.StagingView) Context, activeWhen=AndExpression [children=[ActiveShellExpression(Shell {contributor_runtime_eclipse_jre11 - /home/sandreev/git/misc/TestRepository/TestProject/src/a/A.java - Eclipse SDK}), ActivePartExpression(org.eclipse.egit.ui.internal.staging.StagingView@6f6998b6)]], active=false, sourcePriority=1065984, participating=true]]
	at org.eclipse.egit.ui.internal.ActionUtils$1ActionUtilsFocusListener.focusLost(ActionUtils.java:260)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:147)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5785)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1427)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1453)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1432)
	at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:4749)
	at org.eclipse.swt.widgets.Control.gtk_event_after(Control.java:3741)
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2283)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:6757)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:6031)
	at org.eclipse.swt.internal.gtk.GTK.gtk_widget_grab_focus(Native Method)
	at org.eclipse.swt.widgets.Control.forceFocus(Control.java:2914)
	at org.eclipse.swt.widgets.Control.forceFocus(Control.java:2907)
	at org.eclipse.swt.widgets.Control.setFocus(Control.java:5376)
	at org.eclipse.ui.internal.views.log.LogView.setFocus(LogView.java:1222)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.delegateSetFocus(CompatibilityPart.java:226)
	at jdk.internal.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:319)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:325)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:247)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:147)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.focusGui(PartRenderingEngine.java:792)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$1.setFocus(ContributedPartRenderer.java:106)
	at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1646)
	at org.eclipse.swt.custom.CTabItem.setFocus(CTabItem.java:379)
	at org.eclipse.swt.custom.CTabFolder.setFocus(CTabFolder.java:2676)
	at org.eclipse.swt.widgets.Control.fixFocus(Control.java:316)
	at org.eclipse.swt.widgets.Control.setVisible(Control.java:6043)
	at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3229)
	at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3186)
	at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1221)
	at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.lambda$0(LazyStackRenderer.java:83)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.lambda$0(UIEventHandler.java:38)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:236)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:133)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:5895)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:219)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:205)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:203)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:132)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:75)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:63)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElementGen(ElementContainerImpl.java:170)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:188)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:659)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:623)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:786)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:757)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:679)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:674)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:394)
	at org.eclipse.ui.internal.WorkbenchPage.bringToTop(WorkbenchPage.java:1032)
	at org.eclipse.ui.internal.views.log.LogView.lambda$11(LogView.java:1203)
Comment 13 Eclipse Genie CLA 2020-12-11 10:45:11 EST
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/173707
Comment 14 Andrey Loskutov CLA 2020-12-24 05:54:05 EST
To reproduce:
1) Open Staging view
2) Open Java editor on some file in git project
3) Change the file & save, so it appears in the unstaged area
4) Right click on the file in staging area and say "Open Working Tree Version"
5) After editor tab is *activated* and Staging view tab is *deactivated*, click once on Staging view tab to make it active - kaboom, error.

Patch from Simeon fixes that.
Comment 16 Andrey Loskutov CLA 2021-01-12 11:21:23 EST
I've just saw the same error, not sure how to reproduce now, I was scrolling in the History view and selecting commits with the mouse. The stack says there was a button_press, but I can't remember to click any button except selecting commits.

eclipse.buildId=4.19.0.I20210111-1800
java.version=11.0.8
java.vendor=N/A
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -data /data/4x_platform_workspace -os linux -ws gtk -arch x86_64

org.eclipse.ui
Error
Tue Jan 12 17:11:19 CET 2021
Conflicting handlers for org.eclipse.ui.edit.copy: {ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1@3c2b3052)} vs {ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$2@1e0352e8)} in: PartImpl (org.eclipse.team.ui.GenericHistoryView) Context

java.lang.IllegalStateException: Conflicting handlers: {[ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1@3c2b3052),  for 'org.eclipse.ui.edit.copy',  in WorkbenchContext, activeWhen=ActiveShellExpression(Shell {4x_platform_workspace - org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java}), active=true, sourcePriority=17408, participating=true]} vs {[ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$2@1e0352e8),  for 'org.eclipse.ui.edit.copy',  in WorkbenchContext, activeWhen=ActiveShellExpression(Shell {4x_platform_workspace - org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java}), active=true, sourcePriority=17408, participating=true]} in: PartImpl (org.eclipse.team.ui.GenericHistoryView) Context
	at org.eclipse.ui.internal.handlers.LegacyHandlerService$HandlerSelectionFunction.compute(LegacyHandlerService.java:145)
	at org.eclipse.e4.core.internal.contexts.ValueComputation.get(ValueComputation.java:70)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.internalGet(EclipseContext.java:250)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.get(EclipseContext.java:237)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.lookUpHandler(HandlerServiceImpl.java:103)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.handlerChanged(E4HandlerProxy.java:114)
	at org.eclipse.core.commands.AbstractHandler.fireHandlerChanged(AbstractHandler.java:77)
	at org.eclipse.jface.commands.ActionHandler.lambda$0(ActionHandler.java:81)
	at org.eclipse.jface.action.AbstractAction.firePropertyChange(AbstractAction.java:52)
	at org.eclipse.jface.action.AbstractAction.firePropertyChange(AbstractAction.java:75)
	at org.eclipse.jface.action.Action.setEnabled(Action.java:541)
	at org.eclipse.egit.ui.internal.ActionUtils$2.update(ActionUtils.java:102)
	at org.eclipse.egit.ui.internal.ActionUtils$1ActivationListener.handleEvent(ActionUtils.java:250)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5829)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1427)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1453)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1432)
	at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:4789)
	at org.eclipse.swt.widgets.Control.gtk_event_after(Control.java:3769)
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2322)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:6812)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:6075)
	at org.eclipse.swt.internal.gtk.GTK.gtk_widget_grab_focus(Native Method)
	at org.eclipse.swt.widgets.Control.forceFocus(Control.java:2938)
	at org.eclipse.swt.widgets.Composite.forceFocus(Composite.java:705)
	at org.eclipse.swt.widgets.Control.forceFocus(Control.java:2931)
	at org.eclipse.swt.widgets.Control.setFocus(Control.java:5416)
	at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1648)
	at org.eclipse.egit.ui.internal.history.GitHistoryPage.setFocus(GitHistoryPage.java:1785)
	at org.eclipse.team.internal.ui.history.GenericHistoryView.setFocus(GenericHistoryView.java:549)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.delegateSetFocus(CompatibilityPart.java:226)
	at jdk.internal.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:319)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:325)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:247)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:147)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.focusGui(PartRenderingEngine.java:792)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:764)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:679)
	at org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.activate(AbstractPartRenderer.java:97)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.lambda$0(ContributedPartRenderer.java:63)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5829)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1427)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1453)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1436)
	at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:2142)
	at org.eclipse.swt.widgets.Control.gtk_button_press_event(Control.java:3574)
	at org.eclipse.swt.widgets.Control.gtk_button_press_event(Control.java:3472)
	at org.eclipse.swt.widgets.Composite.gtk_button_press_event(Composite.java:872)
	at org.eclipse.swt.widgets.Table.gtk_button_press_event(Table.java:2082)
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2316)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:6812)
	at org.eclipse.swt.widgets.Table.windowProc(Table.java:4257)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:6075)
	at org.eclipse.swt.internal.gtk.GTK.gtk_main_do_event(Native Method)
	at org.eclipse.swt.widgets.Display.eventProc(Display.java:1537)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(Native Method)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4568)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Unknown Source)
	at org.eclipse.equinox.launcher.Main.basicRun(Unknown Source)
	at org.eclipse.equinox.launcher.Main.run(Unknown Source)
	at org.eclipse.equinox.launcher.Main.main(Unknown Source)
Comment 17 Andrey Loskutov CLA 2021-01-12 11:26:09 EST
(In reply to Andrey Loskutov from comment #16)
> I've just saw the same error

I'm using most recent nightly Egit build 5.11.0.202101102233 with nightly SDK build 4.19.0.I20210111-1800.
Comment 18 Simeon Andreev CLA 2021-01-15 10:26:59 EST
(In reply to Andrey Loskutov from comment #17)
> (In reply to Andrey Loskutov from comment #16)
> > I've just saw the same error
> 
> I'm using most recent nightly Egit build 5.11.0.202101102233 with nightly
> SDK build 4.19.0.I20210111-1800.

So far I can reproduce this with open views:

1. Package Explorer
2. Git Repositories
3. History, linked to the git repository

It takes a while to reproduce, but repeat the following until the conflict is seen:

a) click on some tag in the Git Repositories view (a different tag from last time)
b) click on a commit somewhere in the commit graph of the History view
c) click anywhere on a mostly empty Package Explorer

Here are some debug outputs:

Activated: org.eclipse.ui.edit.copy 1610722314685 [java.base/java.lang.Thread.getStackTrace(Thread.java:1607),
 org.eclipse.egit.ui.internal.ActionUtils$1ActivationListener.handleEvent(ActionUtils.java:284),
 org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89),
 org.eclipse.swt.widgets.Display.sendEvent(Display.java:5805),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1427),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1453),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1436),
 org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:2129),
 org.eclipse.swt.widgets.Control.gtk_button_press_event(Control.java:3552),
 org.eclipse.swt.widgets.Control.gtk_button_press_event(Control.java:3450),
 org.eclipse.swt.widgets.Composite.gtk_button_press_event(Composite.java:872),
 org.eclipse.swt.widgets.Canvas.gtk_button_press_event(Canvas.java:159),
 org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2316),
 org.eclipse.swt.widgets.Control.windowProc(Control.java:6790),
 org.eclipse.swt.widgets.Display.windowProc(Display.java:6051),
 org.eclipse.swt.internal.gtk.GTK.gtk_main_do_event(Native Method)...]
add stack: [java.base/java.lang.Thread.getStackTrace(Thread.java:1607),
 org.eclipse.egit.ui.internal.ActionUtils.setGlobalActions(ActionUtils.java:233),
 org.eclipse.egit.ui.internal.ActionUtils.setGlobalActions(ActionUtils.java:334),
 org.eclipse.egit.ui.internal.ActionUtils.setGlobalActions(ActionUtils.java:350),
 org.eclipse.egit.ui.internal.history.CommitMessageViewer.<init>(CommitMessageViewer.java:200)...]
handler: ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$2@35a2a66f)

Deactivating: org.eclipse.ui.edit.copy 1610722314979 [java.base/java.lang.Thread.getStackTrace(Thread.java:1607),
 org.eclipse.egit.ui.internal.ActionUtils$1ActivationListener.handleEvent(ActionUtils.java:252),
 org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89),
 org.eclipse.swt.widgets.Display.sendEvent(Display.java:5805),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1427),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1453),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1432),
 org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:2122),
 org.eclipse.swt.widgets.Control.gtk_button_press_event(Control.java:3552),
 org.eclipse.swt.widgets.Control.gtk_button_press_event(Control.java:3450),
 org.eclipse.swt.widgets.Composite.gtk_button_press_event(Composite.java:872),
 org.eclipse.swt.widgets.Tree.gtk_button_press_event(Tree.java:2218),
 org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2316),
 org.eclipse.swt.widgets.Control.windowProc(Control.java:6790),
 org.eclipse.swt.widgets.Tree.windowProc(Tree.java:4272),
 org.eclipse.swt.widgets.Display.windowProc(Display.java:6051),
 org.eclipse.swt.internal.gtk.GTK.gtk_main_do_event(Native Method)...]
add stack: [java.base/java.lang.Thread.getStackTrace(Thread.java:1607),
 org.eclipse.egit.ui.internal.ActionUtils.setGlobalActions(ActionUtils.java:233),
 org.eclipse.egit.ui.internal.ActionUtils.setGlobalActions(ActionUtils.java:334),
 org.eclipse.egit.ui.internal.ActionUtils.setGlobalActions(ActionUtils.java:350),
 org.eclipse.egit.ui.internal.history.CommitMessageViewer.<init>(CommitMessageViewer.java:200)...]
handler: ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$2@35a2a66f)

Activated: org.eclipse.ui.edit.copy 1610722315141 [java.base/java.lang.Thread.getStackTrace(Thread.java:1607),
 org.eclipse.egit.ui.internal.ActionUtils$1ActivationListener.handleEvent(ActionUtils.java:284),
 org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89),
 org.eclipse.swt.widgets.Display.sendEvent(Display.java:5805),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1427),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1453),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1436),
 org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:2129),
 org.eclipse.swt.widgets.Control.gtk_button_press_event(Control.java:3552),
 org.eclipse.swt.widgets.Control.gtk_button_press_event(Control.java:3450),
 org.eclipse.swt.widgets.Composite.gtk_button_press_event(Composite.java:872),
 org.eclipse.swt.widgets.Table.gtk_button_press_event(Table.java:2082),
 org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2316),
 org.eclipse.swt.widgets.Control.windowProc(Control.java:6790),
 org.eclipse.swt.widgets.Table.windowProc(Table.java:4257),
 org.eclipse.swt.widgets.Display.windowProc(Display.java:6051),
 org.eclipse.swt.internal.gtk.GTK.gtk_main_do_event(Native Method)...]
add stack: [java.base/java.lang.Thread.getStackTrace(Thread.java:1607),
 org.eclipse.egit.ui.internal.ActionUtils.setGlobalActions(ActionUtils.java:233),
 org.eclipse.egit.ui.internal.ActionUtils.setGlobalActions(ActionUtils.java:334),
 org.eclipse.egit.ui.internal.ActionUtils.setGlobalActions(ActionUtils.java:350),
 org.eclipse.egit.ui.internal.history.CommitGraphTable.<init>(CommitGraphTable.java:347)...]
handler: ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1@52d0a5fe)

!ENTRY org.eclipse.ui 4 4 2021-01-15 15:51:55.145
!MESSAGE Conflicting handlers for org.eclipse.ui.edit.copy: {ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1@52d0a5fe)} vs {ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$2@35a2a66f)} in: PartImpl (org.eclipse.team.ui.GenericHistoryView) Context
!STACK 0

Activated: org.eclipse.ui.edit.copy 1610722315147 [java.base/java.lang.Thread.getStackTrace(Thread.java:1607),
 org.eclipse.egit.ui.internal.ActionUtils$1ActivationListener.handleEvent(ActionUtils.java:284),
 org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89),
 org.eclipse.swt.widgets.Display.sendEvent(Display.java:5805),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1427),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1453),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1432),
 org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:4767),
 org.eclipse.swt.widgets.Control.gtk_event_after(Control.java:3747),
 org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2322),
 org.eclipse.swt.widgets.Control.windowProc(Control.java:6790),
 org.eclipse.swt.widgets.Display.windowProc(Display.java:6051),
 org.eclipse.swt.internal.gtk.GTK.gtk_widget_grab_focus(Native Method),
 org.eclipse.swt.widgets.Control.forceFocus(Control.java:2916),
 org.eclipse.swt.widgets.Composite.forceFocus(Composite.java:705),
 org.eclipse.swt.widgets.Control.forceFocus(Control.java:2909),
 org.eclipse.swt.widgets.Control.setFocus(Control.java:5394),
 org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1648),
 org.eclipse.egit.ui.internal.history.GitHistoryPage.setFocus(GitHistoryPage.java:1785),
 org.eclipse.team.internal.ui.history.GenericHistoryView.setFocus(GenericHistoryView.java:549),
 org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.delegateSetFocus(CompatibilityPart.java:226),
 jdk.internal.reflect.GeneratedMethodAccessor51.invoke(Unknown Source),
 java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43),
 java.base/java.lang.reflect.Method.invoke(Method.java:566),
 org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58),
 org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:319),
 org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:325),
 org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:247),
 org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:147),
 org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.focusGui(PartRenderingEngine.java:792),
 org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:764),
 org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:679),
 org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.activate(AbstractPartRenderer.java:97),
 org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.lambda$0(ContributedPartRenderer.java:63),
 org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89),
 org.eclipse.swt.widgets.Display.sendEvent(Display.java:5805),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1427),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1453),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1436),
 org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:2129),
 org.eclipse.swt.widgets.Control.gtk_button_press_event(Control.java:3552),
 org.eclipse.swt.widgets.Control.gtk_button_press_event(Control.java:3450),
 org.eclipse.swt.widgets.Composite.gtk_button_press_event(Composite.java:872),
 org.eclipse.swt.widgets.Table.gtk_button_press_event(Table.java:2082),
 org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2316),
 org.eclipse.swt.widgets.Control.windowProc(Control.java:6790),
 org.eclipse.swt.widgets.Table.windowProc(Table.java:4257),
 org.eclipse.swt.widgets.Display.windowProc(Display.java:6051),
 org.eclipse.swt.internal.gtk.GTK.gtk_main_do_event(Native Method)...]
add stack: [java.base/java.lang.Thread.getStackTrace(Thread.java:1607),
 org.eclipse.egit.ui.internal.ActionUtils.setGlobalActions(ActionUtils.java:233),
 org.eclipse.egit.ui.internal.ActionUtils.setGlobalActions(ActionUtils.java:334),
 org.eclipse.egit.ui.internal.ActionUtils.setGlobalActions(ActionUtils.java:350),
 org.eclipse.egit.ui.internal.history.CommitMessageViewer.<init>(CommitMessageViewer.java:200)...]
handler: ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$2@35a2a66f)

Deactivating: org.eclipse.ui.edit.copy 1610722315148 [java.base/java.lang.Thread.getStackTrace(Thread.java:1607),
 org.eclipse.egit.ui.internal.ActionUtils$1ActivationListener.handleEvent(ActionUtils.java:252),
 org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89),
 org.eclipse.swt.widgets.Display.sendEvent(Display.java:5805),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1427),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1453),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1432),
 org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:2122),
 org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:2092),
 org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:4779),
 org.eclipse.swt.widgets.Control.gtk_event_after(Control.java:3747),
 org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2322),
 org.eclipse.swt.widgets.Control.windowProc(Control.java:6790),
 org.eclipse.swt.widgets.Display.windowProc(Display.java:6051),
 org.eclipse.swt.internal.gtk.GTK.gtk_widget_grab_focus(Native Method),
 org.eclipse.swt.widgets.Control.forceFocus(Control.java:2916),
 org.eclipse.swt.widgets.Composite.forceFocus(Composite.java:705),
 org.eclipse.swt.widgets.Control.forceFocus(Control.java:2909),
 org.eclipse.swt.widgets.Control.setFocus(Control.java:5394),
 org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1648),
 org.eclipse.egit.ui.internal.history.GitHistoryPage.setFocus(GitHistoryPage.java:1785),
 org.eclipse.team.internal.ui.history.GenericHistoryView.setFocus(GenericHistoryView.java:549),
 org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.delegateSetFocus(CompatibilityPart.java:226),
 jdk.internal.reflect.GeneratedMethodAccessor51.invoke(Unknown Source),
 java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43),
 java.base/java.lang.reflect.Method.invoke(Method.java:566),
 org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58),
 org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:319),
 org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:325),
 org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:247),
 org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:147),
 org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.focusGui(PartRenderingEngine.java:792),
 org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:764),
 org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:679),
 org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.activate(AbstractPartRenderer.java:97),
 org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.lambda$0(ContributedPartRenderer.java:63),
 org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89),
 org.eclipse.swt.widgets.Display.sendEvent(Display.java:5805),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1427),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1453),
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1436),
 org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:2129),
 org.eclipse.swt.widgets.Control.gtk_button_press_event(Control.java:3552),
 org.eclipse.swt.widgets.Control.gtk_button_press_event(Control.java:3450),
 org.eclipse.swt.widgets.Composite.gtk_button_press_event(Composite.java:872),
 org.eclipse.swt.widgets.Table.gtk_button_press_event(Table.java:2082),
 org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2316),
 org.eclipse.swt.widgets.Control.windowProc(Control.java:6790),
 org.eclipse.swt.widgets.Table.windowProc(Table.java:4257),
 org.eclipse.swt.widgets.Display.windowProc(Display.java:6051),
 org.eclipse.swt.internal.gtk.GTK.gtk_main_do_event(Native Method)...]
add stack: [java.base/java.lang.Thread.getStackTrace(Thread.java:1607),
 org.eclipse.egit.ui.internal.ActionUtils.setGlobalActions(ActionUtils.java:233),
 org.eclipse.egit.ui.internal.ActionUtils.setGlobalActions(ActionUtils.java:334),
 org.eclipse.egit.ui.internal.ActionUtils.setGlobalActions(ActionUtils.java:350),
 org.eclipse.egit.ui.internal.history.CommitGraphTable.<init>(CommitGraphTable.java:347)...]
handler: ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1@52d0a5fe)

I do see this code explicitly setting focus: org.eclipse.egit.ui.internal.history.GitHistoryPage.setFocus()
(see the stack traces above, the activation which I assume lead to the conflict was done due to this code setting focus)

The SWT listener in org.eclipse.egit.ui.internal.commit.FocusTracker is:

	private final Listener listener = event -> {
		switch (event.type) {
		case SWT.Dispose:
			trackedControls.remove(event.widget);
			break;
		case SWT.FocusIn:
		case SWT.FocusOut:
			if (event.widget instanceof Control) {
				lastFocusControl = (Control) event.widget;
			}
			break;
		default:
			break;
		}
	};

I guess I'll look into how the above works and why it sometimes apparently doesn't work.

I'm not sure if we want to just kick out the focus listening for the handlers, and leave only activation/deactivation event handling. In https://git.eclipse.org/r/c/egit/egit/+/173707 that seems fine, but maybe with the code there will be trouble (the EGit history view page setting focus itself).
Comment 19 Thomas Wolf CLA 2021-01-15 10:51:42 EST
You could try to remove that FocusTracker. It was added to resolve bug 503198, which also had to do with handler conflicts. But then verify that this bug doesn't re-appear.

It was introduced in https://git.eclipse.org/r/c/egit/egit/+/116640 . The commit message some other bugs that need to be verified that we don't re-introduce them: bug 322751 and bug 477510.
Comment 20 Simeon Andreev CLA 2021-01-18 06:07:30 EST
(In reply to Thomas Wolf from comment #19)
> You could try to remove that FocusTracker. It was added to resolve bug
> 503198, which also had to do with handler conflicts. But then verify that
> this bug doesn't re-appear.
> 
> It was introduced in https://git.eclipse.org/r/c/egit/egit/+/116640 . The
> commit message some other bugs that need to be verified that we don't
> re-introduce them: bug 322751 and bug 477510.

With the following change, at least under Linux, I cant reproduce bug 322751, bug 477510 or bug 503198. I also can't reproduce a handler conflcit. I'll try full removal of FocusTracker (requires quite some changes).

diff --git a/org.eclipse.egit.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.egit.ui/.settings/org.eclipse.jdt.core.prefs
index 992b7e0c5..72d52b5c1 100644
--- a/org.eclipse.egit.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.egit.ui/.settings/org.eclipse.jdt.core.prefs
@@ -18,6 +18,7 @@ org.eclipse.jdt.core.compiler.debug.localVariable=generate
 org.eclipse.jdt.core.compiler.debug.sourceFile=generate
 org.eclipse.jdt.core.compiler.doc.comment.support=enabled
 org.eclipse.jdt.core.compiler.problem.APILeak=warning
+org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
 org.eclipse.jdt.core.compiler.problem.autoboxing=warning
@@ -122,7 +123,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
 org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
 org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
 org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
 org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorPage.java
index 13c2b4115..d9f56e52d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorPage.java
@@ -583,10 +583,10 @@ public void widgetDisposed(DisposeEvent e) {
 
                        @Override
                        public boolean setFocus() {
-                               Control control = focusTracker.getLastFocusControl();
-                               if (control != null && control.forceFocus()) {
-                                       return true;
-                               }
+                               // Control control = focusTracker.getLastFocusControl();
+                               // if (control != null && control.forceFocus()) {
+                               // return true;
+                               // }
                                return super.setFocus();
                        }
                };
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/FocusManagerFormPart.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/FocusManagerFormPart.java
index 219e7ac3a..1c1a5964e 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/FocusManagerFormPart.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/FocusManagerFormPart.java
@@ -34,10 +34,10 @@ public FocusManagerFormPart(FocusTracker focusTracker) {
 
        @Override
        public void setFocus() {
-               Control control = focusTracker.getLastFocusControl();
-               if (control != null && control.forceFocus()) {
-                       return;
-               }
+               // Control control = focusTracker.getLastFocusControl();
+               // if (control != null && control.forceFocus()) {
+               // return;
+               // }
                setDefaultFocus();
        }
 
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/FocusTracker.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/FocusTracker.java
index 816183041..caebd2c6c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/FocusTracker.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/FocusTracker.java
@@ -87,7 +87,7 @@ public void removeFromFocusTracking(Control control) {
         *
         * @return the control, or {@code null}<C2><A0>if none determined yet.
         */
-       public Control getLastFocusControl() {
+       private Control getLastFocusControl() {
                if (lastFocusControl != null && lastFocusControl.isDisposed()) {
                        trackedControls.remove(lastFocusControl);
                        lastFocusControl = null;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
index 383f60ba7..576654c00 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
@@ -1778,11 +1778,12 @@ public void setFocus() {
                        clearHistoryPage();
                        graph.getControl().setFocus();
                } else {
-                       Control control = focusTracker.getLastFocusControl();
-                       if (control == null) {
-                               control = graph.getControl();
-                       }
-                       control.setFocus();
+                       // Control control = focusTracker.getLastFocusControl();
+                       // if (control == null) {
+                       // control = graph.getControl();
+                       // }
+                       // control.setFocus();
+                       graph.getControl().setFocus();
                }
        }
Comment 21 Eclipse Genie CLA 2021-01-18 09:28:57 EST
New Gerrit change created: https://git.eclipse.org/r/c/egit/egit/+/174993