DESCRIPTION

Improve ActionUtils: narrow handler activation expression

I noticed in our Hudson builds many warnings about conflicting handlers
since commit e2b8f79c. So far, I have not seen those in the wild.
However, I do know of at least one case where a control does not get
a focusLost notification. If that should happen here, or if SWTBot is
just too fast, or somehow event order gets mixed up an the new focus
control gets the focusGained before the old focus control gets
focusLost, then we may have conflicting handlers.

Avoid that with a more precise handler activation expression. Instead
of only an ActiveShellExpression use a new FocusExpression that
additionally requires that the control be the current focus control.
That should avoid conflicting handlers in all cases where we use this
mechanism.

Change-Id: I7518f30fdc677d009e2da37f855dc6b492fdf14b
Signed-off-by: Alayna Houston xxx@xxx.xxx

COMMENTS

author: Alayna Houston
date: 2016-10-17 20:58:23.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2016-10-17 20:58:29.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/9156/

-------------------------------------
author: Alayna Houston
date: 2016-10-17 21:11:08.000000000

Patch Set 1: Code-Review-1

This didn't help. Interestingly, the log messages are all like

  Conflicting handlers for org.eclipse.ui.edit.selectAll: {ActionHandler(org.eclipse.egit.ui.internal.ActionUtils$1@58ce13bc)} vs xxx@xxx.xxx

i.e., something thinks (during SWTbot test runs) that a handler instance conflicted with itself. I have no idea how that could happen.

-------------------------------------
author: Brenden Conley
date: 2016-10-17 21:24:43.000000000

Patch Set 1: Code-Review-1

Build Unstable 

https://hudson.eclipse.org/egit/job/egit.gerrit/9156/ : UNSTABLE

-------------------------------------
author: Alayna Houston
date: 2017-02-21 22:41:06.000000000

Abandoned

Doesn't help, and the problem doesn't appear to be serious. Would need extensive analysis to figure out why this happens; on the surface, this should never be possible.

-------------------------------------
author: Alayna Houston
date: 2017-03-08 08:25:41.000000000

Restored

-------------------------------------
author: Alayna Houston
date: 2017-03-08 09:01:13.000000000

Abandoned

This time definitively. This is wrong anyway since it wouldn't cause re-evaluations of the expression when the focus changed. So we could use contexts, but those we'd have to activate/deactivate also via a focus listener, so we wouldn't gain anything.

-------------------------------------
