DESCRIPTION

Ignore undefined variables when retrieving values from the context

When variables are retrieved from the evaluation context, it can
be null or it may be an undefined value. When a value is
undefined, we want our selection searching algorithm to cascade
down and request a value from a different variable. This ensures
that both null and undefined values are ignored and that our
handlers can ask other a different variable for a value instead
of taking the undefined value as a valid return value.

Bug: 356647
Change-Id: Ib349fdd69288c46173101b9d4ae3d6fbfb9d69c0


COMMENTS

author: Brenden Conley
date: 2011-09-20 23:24:04.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2011-09-20 23:35:55.000000000

Patch Set 1: Build Successful

Build Successful 
 
https://hudson.eclipse.org/sandbox/job/egit.gerrit/1638/ : SUCCESS

-------------------------------------
author: Douglas Trujillo
date: 2011-09-22 21:05:55.000000000

Patch Set 1:

I tried this on a newly started workbench and had no selection yet when clicking CMD-# (on Mac) and this way I hit


eclipse.buildId=I20110613-1736
java.version=1.6.0_26
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -product org.eclipse.platform.ide
Command-line arguments:  -product org.eclipse.platform.ide -data /Users/d029788/Documents/workspace/egit/../runtime-EGit -dev file:/Users/d029788/Documents/workspace/egit/.metadata/.plugins/org.eclipse.pde.core/EGit/dev.properties -os macosx -ws cocoa -arch x86_64 -consoleLog

Error
Thu Sep 22 23:03:01 CEST 2011
Unhandled event loop exception

java.lang.ArrayIndexOutOfBoundsException: 0
	at org.eclipse.egit.ui.internal.actions.CommitActionHandler.execute(CommitActionHandler.java:47)
	at org.eclipse.egit.ui.internal.actions.RepositoryAction.run(RepositoryAction.java:86)
	at org.eclipse.ui.internal.handlers.ActionDelegateHandlerProxy.execute(ActionDelegateHandlerProxy.java:289)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1069)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4124)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1494)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1490)
	at org.eclipse.swt.widgets.Text.sendKeyEvent(Text.java:1518)
	at org.eclipse.swt.widgets.Control.doCommandBySelector(Control.java:1051)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5560)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
	at org.eclipse.swt.widgets.Widget.superKeyDown(Widget.java:1895)
	at org.eclipse.swt.widgets.Widget.keyDown(Widget.java:1076)
	at org.eclipse.swt.widgets.Control.keyDown(Control.java:2358)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5470)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
	at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2092)
	at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2255)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5532)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4986)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5135)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3607)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

when trying the same with a selection e.g. in the package explorer it works properly

-------------------------------------
author: Jaylon Avila
date: 2011-09-22 21:28:09.000000000

Patch Set 1:

I was unable to reproduce this problem on Windows 7.

Matthias, if you unselect the items in the 'Package Explorer' view so you have no selection again, does the problem happen again?

-------------------------------------
author: Douglas Trujillo
date: 2011-09-26 21:04:15.000000000

Patch Set 1: Looks good to me, but someone else must approve; IP review completed

works for me

-------------------------------------
author: Juliet Cantu
date: 2011-10-02 23:08:25.000000000

Patch Set 1: I would prefer that you didn't submit this

Either it doesn't work or has nothing to do with the referenced bug.

-------------------------------------
author: Jaylon Avila
date: 2011-10-03 12:09:52.000000000

Patch Set 1:

Robin, from Matthias's comment on Sept 26, it sounds like it works for him. At least, ignoring the initial error that he is getting. Given your -1, I am assuming the change set does not work for you at all, is this correct?

-------------------------------------
author: Juliet Cantu
date: 2011-10-03 13:27:09.000000000

Patch Set 1:

I tested the Command-# action and that does not work. It is not clear from the commit message, other than the bug number, that this is in fact the issue you are adressing.

-------------------------------------
author: Jaylon Avila
date: 2011-10-03 13:53:39.000000000

Patch Set 1:

This change set _is_ intended to be a fix for bug 356647. I suppose someone on a Mac will have to propose a fix as this one doesn't work for Robin.

-------------------------------------
author: Juliet Cantu
date: 2011-10-03 17:20:55.000000000

Patch Set 1:

#€!"#€ of course it doesn't work, since Command-Shoft-3 is bound to the screenshot function in OS X. I had the sound turned off while testing this patch.

-------------------------------------
author: Jaylon Avila
date: 2011-10-03 21:08:22.000000000

Patch Set 1:

Robin, how would you like to proceed then? If you set a different keybinding does it work?

-------------------------------------
author: Juliet Cantu
date: 2011-10-05 20:30:33.000000000

Patch Set 1:

I ran this patch and changed the key binding and that works when focus in in the project explorer. It's not very useful
if it doesn't work when focus is in the text editor.

-------------------------------------
author: Juliet Cantu
date: 2011-10-05 20:33:09.000000000

Patch Set 1:

It might be that the patch solved key binding problems in general, but not the specific problem referenced in the bug report.

I could rebind the key before this too so, I don't think this did anythimg for me. It night be a platform issue.

-------------------------------------
author: Dashawn Dalton
date: 2012-10-24 13:25:31.000000000

Patch Set 1:

Looks like this change can be abandoned, since the problem is already fixed: https://bugs.eclipse.org/bugs/show_bug.cgi?id=356647#c13

-------------------------------------
author: Jaylon Avila
date: 2012-10-24 13:32:24.000000000

Patch Set 1: Abandoned

Abandoning as Kevin has fixed this in a different commit.

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