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
boolean textChanged = propertyName == null
                    || propertyName.equals(IAction.TEXT);
            boolean imageChanged = propertyName == null
                    || propertyName.equals(IAction.IMAGE);
            boolean tooltipTextChanged = propertyName == null
                    || propertyName.equals(IAction.TOOL_TIP_TEXT);
            boolean enableStateChanged = propertyName == null
                    || propertyName.equals(IAction.ENABLED)
                    || propertyName
                            .equals(IContributionManagerOverrides.P_ENABLED);
            boolean checkChanged = (action.getStyle() == IAction.AS_CHECK_BOX || action
                    .getStyle() == IAction.AS_RADIO_BUTTON)
                    && (propertyName == null || propertyName
                            .equals(IAction.CHECKED));
            if (widget instanceof ToolItem) {
                ToolItem ti = (ToolItem) widget;
                String text = action.getText();
                
                boolean showText = text != null
                        && ((getMode() & MODE_FORCE_TEXT) != 0 || !hasImages(action));
                
                if (showText && text != null) {
                    text = Action.removeAcceleratorText(text);
                    text = Action.removeMnemonics(text);
                }
                if (textChanged) {
                    String textToSet = showText ? text : ""; 
                    boolean rightStyle = (ti.getParent().getStyle() & SWT.RIGHT) != 0;
                    if (rightStyle || !ti.getText().equals(textToSet)) {