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
}
            } else if ((style & SWT.RADIO) != 0) {
                if (action.getStyle() == IAction.AS_RADIO_BUTTON) {
                    action.setChecked(selection);
                }
            } else if ((style & SWT.DROP_DOWN) != 0) {
                if (e.detail == 4) { 
                    if (action.getStyle() == IAction.AS_DROP_DOWN_MENU) {
                        IMenuCreator mc = action.getMenuCreator();
                        ToolItem ti = (ToolItem) item;
                        
                        
                        
                        
                        
                        
                        if (mc != null) {
                            Menu m = mc.getMenu(ti.getParent());
                            if (m != null) {
                                
                                Rectangle b = ti.getBounds();
                                Point p = ti.getParent().toDisplay(
                                        new Point(b.x, b.y + b.height));
                                m.setLocation(p.x, p.y); 
                                m.setVisible(true);
                                return; 
                            }
                        }
                    }
                }