Project: Eclipse_Platform_UI
Bug 380676 NPE when attempting to create keybinding for empty binding contexts
Reported: 2012-05-25 10:36:18 | Status: verified fixed

Version: 4.2.0 Build id: I20120524-2100 None of the programmatically-contributed keybindings are being loaded (e.g., the CSS Spy, the Live Model Editor). Attempting to create such a binding from the Keys pref page results in an NPE: !ENTRY org.eclipse.ui 4 0 2012-05-25 10:32:24.558 !MESSAGE Unhandled event loop exception !STACK 0 java.lang.NullPointerException at org.eclipse.ui.internal.keys.BindingService.findPotentialConflict(BindingService.java:509) at org.eclipse.ui.internal.keys.BindingService.persistToModel(BindingService.java:467) at org.eclipse.ui.internal.keys.BindingService.savePreferences(BindingService.java:416) at org.eclipse.ui.internal.keys.model.KeyController.saveBindings(KeyController.java:427) at org.eclipse.ui.internal.keys.NewKeysPreferencePage.performOk(NewKeysPreferencePage.java:1272) at org.eclipse.jface.preference.PreferencePage.performApply(PreferencePage.java:432) at org.eclipse.jface.preference.PreferencePage$2.widgetSelected(PreferencePage.java:281) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4130) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1458) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1481) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1271) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3976) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3615) at org.eclipse.jface.window.Window.runEventLoop(Window.java:825) at org.eclipse.jface.window.Window.open(Window.java:801) at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.open(WorkbenchPreferenceDialog.java:215) at org.eclipse.ui.internal.keys.GlobalKeyAssistDialog.openPreferencePage(GlobalKeyAssistDialog.java:126) at org.eclipse.ui.internal.keys.GlobalKeyAssistDialog.open(GlobalKeyAssistDialog.java:71) at org.eclipse.ui.internal.keys.BindingService.openKeyAssistDialog(BindingService.java:371) at org.eclipse.ui.internal.handlers.ShowKeyAssistHandler.execute(ShowKeyAssistHandler.java:37) at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293) at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:76) 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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56) at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:229) at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:210) at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:131) at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:171) at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:276) at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:494) at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:545) at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:366) at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:313) at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:82) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1068) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4129) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1458) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1481) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1495) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1491) at org.eclipse.swt.widgets.Table.sendKeyEvent(Table.java:3064) at org.eclipse.swt.widgets.Control.keyDown(Control.java:2371) at org.eclipse.swt.widgets.Composite.keyDown(Composite.java:600) at org.eclipse.swt.widgets.Table.keyDown(Table.java:1920) at org.eclipse.swt.widgets.Display.windowProc(Display.java:5471) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:221) at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2102) at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2284) at org.eclipse.swt.widgets.Display.windowProc(Display.java:5533) at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method) at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4978) at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5127) 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:3612) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1021) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:915) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:585) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:540) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124) 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:353) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180) 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:629) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/keys/BindingService.java