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
|| actionToCheck.getDisabledImageDescriptor() != null;
    }
    /**
     * Returns whether the command corresponding to this action
     * is active.
     */
    private boolean isCommandActive() {
        IAction actionToCheck = getAction();
        if (actionToCheck != null) {
            String commandId = actionToCheck.getActionDefinitionId();
            ExternalActionManager.ICallback callback = ExternalActionManager
                    .getInstance().getCallback();
            if (callback != null)
                return callback.isActive(commandId);
        }
        return true;
    }
    /**
     * The action item implementation of this <code>IContributionItem</code>
     * method returns <code>true</code> for menu items and <code>false</code>
     * for everything else.
     */
    public boolean isDynamic() {
        if (widget instanceof MenuItem) {
             
            boolean itemIsCheck = (widget.getStyle() & SWT.CHECK) != 0;
            boolean actionIsCheck = getAction() != null
                    && getAction().getStyle() == IAction.AS_CHECK_BOX;
            boolean itemIsRadio = (widget.getStyle() & SWT.RADIO) != 0;
            boolean actionIsRadio = getAction() != null