Project: Eclipse_Platform_UI
Bug 248943 [KeyBindings] [RCP] NullpointerException when entering text after the rcp is restarted
Reported: 2008-09-29 10:18:24 | Status: verified fixed

Build ID: M20080911-1700 Steps To Reproduce: 1. Build an rcp and start the workbench in a loop. For instance, like this : public Object run(Object args) throws Exception { Display display = PlatformUI.createDisplay(); try { while (true) { int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor()); if (returnCode == PlatformUI.RETURN_RESTART) { return IPlatformRunnable.EXIT_RESTART; } //return IPlatformRunnable.EXIT_OK; } } finally { display.dispose(); } } 2. Create a dialog box with a Text field to be able to enter some text and attach it to an action (menu). 3. Start the rcp. 4. Enter text in the dialog and close it. 5. Stop the RCP with the close box. 6. When the rcp restarts for the second time (since the workbench is created and run in a loop), show the dialog again. 7. Try to enter text and a nullPointerException occurs in class WorkbenchKeyboard(Workbench) on the last line of the following method : private boolean isPartialMatch(KeySequence keySequence) { if (bindingService == null) { bindingService = (IBindingService) workbench .getService(IBindingService.class); } return bindingService.isPartialMatch(keySequence); } More information: The bug does not occur if you don't open the dialog box the first time. The bug does not occur if the display is disposed and created again every time the workbench is created and run. But in this case, I lose the Image Registry.

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