Bug 90415 [Contributions] NPE in ActionContributionItem.update when trying to set accelerator in menu
Exception in thread "main" java.lang.NullPointerException at org.eclipse.jface.action.ActionContributionItem.update(ActionContributionItem.java:749) at org.eclipse.jface.action.ActionContributionItem.fill(ActionContributionItem.java:281) at org.eclipse.jface.action.MenuManager.update(MenuManager.java:627) at org.eclipse.jface.action.MenuManager.update(MenuManager.java:549) at org.eclipse.jface.action.MenuManager.createMenuBar(MenuManager.java:158) at org.eclipse.jface.window.ApplicationWindow.createTrimWidgets(ApplicationWindow.java:332) at org.eclipse.jface.window.ApplicationWindow.configureShell(ApplicationWindow.java:320) at org.eclipse.jface.window.Window.createShell(Window.java:483) at org.eclipse.jface.window.Window.create(Window.java:417) at org.eclipse.jface.window.Window.open(Window.java:770) at MenuActionTest.main(MenuActionTest.java:76)
bundles/org.eclipse.jface/src/org/eclipse/jface/action/ActionContributionItem.java
if (ew != null) {
                            handleWidgetSelection(event, ((MenuItem) ew)
                                    .getSelection());
                        }
                        break;
                    }
                }
            };
        }
        return menuItemListener;
    }
    /**
     * Returns the presentation mode, which is the bitwise-or of the 
     * <code>MODE_*</code> constants.  The default mode setting is 0, meaning
     * that for menu items, both text and image are shown (if present), but for
     * tool items, the text is shown only if there is no image.
     * 
     * @return the presentation mode settings
     * 
     * @since 3.0
     */
    public int getMode() {
        return mode;
    }
    /**
     * Returns the listener for SWT tool item widget events.
     * 
     * @return a listener for tool item events
     */
    private Listener getToolItemListener() {