Buggy code:
void firePerspectiveChanged ( IWorkbenchPage page , IPerspectiveDescriptor perspective , String changeId ) { } void firePerspectiveChanged ( IWorkbenchPage page , IPerspectiveDescriptor perspective , IWorkbenchPartReference partRef , String changeId ) { } void firePerspectiveClosed ( IWorkbenchPage page , IPerspectiveDescriptor perspective ) { } void firePerspectiveOpened ( IWorkbenchPage page , IPerspectiveDescriptor perspective ) { } void firePerspectiveSavedAs ( IWorkbenchPage page , IPerspectiveDescriptor oldPerspective , IPerspectiveDescriptor newPerspective ) { } public WWinActionBars getActionBars ( ) { } public IWorkbenchPage getActivePage ( ) { } WorkbenchPage getActiveWorkbenchPage ( ) { } protected Composite getPageComposite ( ) { } public MenuManager getMenuManager ( ) { } public int getNumber ( ) { } public IWorkbenchPage [ ] getPages ( ) { } public IPartService getPartService ( ) { } protected Layout getLayout ( ) { } public ISelectionService getSelectionService ( ) { } public boolean getShellActivated ( ) { } public StatusLineManager getStatusLineManager ( ) { } private IWindowTrim getStatusLineTrim ( ) { } public IWorkbench getWorkbench ( ) { } public String getToolbarLabel ( String actionSetId ) { } private boolean hardClose ( ) { } public boolean isApplicationMenu ( String menuID ) { } boolean isWorkbenchCoolItemId ( String id ) { } void lockCoolBar ( boolean lock ) { } void makeVisible ( ) { } public boolean okToClose ( ) { } public IWorkbenchPage openPage ( final String perspId , final IAdaptable input ) throws WorkbenchException { } public IWorkbenchPage openPage ( IAdaptable input ) throws WorkbenchException { } public void removePageListener ( IPageListener l ) { } public void removePerspectiveListener ( org . eclipse . ui . IPerspectiveListener l ) { } private IStatus unableToRestorePage ( IMemento pageMem ) { } public IStatus restoreState ( IMemento memento , IPerspectiveDescriptor activeDescriptor ) { } private boolean restoreOldCoolBar ( IMemento coolbarMem ) { } private boolean readLayout ( IMemento memento , ArrayList itemIds , ArrayList wrapIndicies ) { } private IContributionItem findAlphabeticalOrder ( String startId , String itemId , IContributionManager mgr ) { } public void run ( boolean fork , boolean cancelable , IRunnableWithProgress runnable ) throws InterruptedException , InvocationTargetException { } private boolean saveAllPages ( boolean bConfirm ) { } public IStatus saveState ( IMemento memento ) { } private IStatus saveTrimState ( IMemento memento ) { } private IStatus restoreTrimState ( IMemento memento ) { } public void setActivePage ( final IWorkbenchPage in ) { } protected boolean toolBarChildrenExist ( ) { } private void trackShellActivation ( Shell shell ) { } private void trackShellResize ( Shell newShell ) { } public void updateActionBars ( ) { } private boolean updatesDeferred ( ) { } public final void largeUpdateStart ( ) { } public final void largeUpdateEnd ( ) { } public void updateActionSets ( ) { } private ListenerList actionSetListeners = null ; private final void fireActionSetsChanged ( ) { } final void addActionSetsListener ( final IActionSetsListener listener ) { } final void removeActionSetsListener ( final IActionSetsListener listener ) { } private void createProgressIndicator ( Shell shell ) { } class PageList { private List pagesInCreationOrder ; private List pageInActivationOrder ; private Object active ; public PageList ( ) { } public boolean add ( Object object ) { } public Iterator iterator ( ) { } public boolean contains ( Object object ) { } public boolean remove ( Object object ) { } public boolean isEmpty ( ) { } public IWorkbenchPage [ ] getPages ( ) { } public void setActive ( Object page ) { } public WorkbenchPage getActive ( ) { } public WorkbenchPage getNextActive ( ) { } } WorkbenchWindowConfigurer getWindowConfigurer ( ) { } private WorkbenchAdvisor getAdvisor ( ) { } private WorkbenchWindowAdvisor getWindowAdvisor ( ) { } private ActionBarAdvisor getActionBarAdvisor ( ) { } private Workbench getWorkbenchImpl ( ) { } public void fillActionBars ( int flags ) { Workbench workbench = getWorkbenchImpl ( ) ; workbench . largeUpdateStart ( ) ; try { getActionBarAdvisor ( ) . fillActionBars ( flags ) ; final IMenuService menuService = ( ( IMenuService ) ( serviceLocator . getService ( IMenuService . class ) ) ) ; <START_BUG> menuService . populateMenu ( ( ( ContributionManager ) ( getActionBars ( ) . getMenuManager ( ) ) ) , new MenuLocationURI ( "menu:////org.eclipse.ui.main.menu" ) ) ; <END_BUG> } finally { workbench . largeUpdateEnd ( ) ; } } public void fillActionBars ( IActionBarConfigurer2 proxyBars , int flags ) { } protected void initializeBounds ( ) { } protected void constrainShellSize ( ) { } protected Point getInitialLocation ( Point size ) { } protected Point getInitialSize ( ) { } public void setCoolBarVisible ( boolean visible ) { } public boolean getCoolBarVisible ( ) { } public void setPerspectiveBarVisible ( boolean visible ) { } public boolean getPerspectiveBarVisible ( ) { } public void setFastViewBarVisible ( boolean visible ) { } public boolean getFastViewBarVisible ( ) { } public void setStatusLineVisible ( boolean visible ) { } public boolean getStatusLineVisible ( ) { } private void updateLayoutDataForContents ( ) { } public boolean getShowFastViewBars ( ) { } private void setLayoutDataForContents ( ) { } public FastViewBar getFastViewBar ( ) { } public PerspectiveBarManager getPerspectiveBar ( ) { } public ActionPresentation getActionPresentation ( ) { } IActionBarPresentationFactory getActionBarPresentationFactory ( ) { } protected boolean showTopSeperator ( ) { } protected ICoolBarManager createCoolBarManager2 ( int style ) { } protected IToolBarManager createToolBarManager2 ( int style ) { } protected StatusLineManager createStatusLineManager ( ) { } protected void createStatusLine ( Shell shell ) { } public void updateFastViewBar ( ) { } public ProgressRegion getProgressRegion ( ) { } public void addToTrim ( IWindowTrim trim , int side ) { } public IExtensionTracker getExtensionTracker ( ) { } public CustomizePerspectiveDialog createCustomizePerspectiveDialog ( Perspective persp ) { } IAdaptable getDefaultPageInput ( ) { } public void addPerspectiveReorderListener ( IReorderListener listener ) { } public void showHeapStatus ( boolean selection ) { } public ITrimManager getTrimManager ( ) { } private final void initializeDefaultServices ( ) { }

Fix:
menuService . populateMenu ( ( ( ContributionManager ) ( getActionBars ( ) . getMenuManager ( ) ) ) , new MenuLocationURI ( "menu:org.eclipse.ui.main.menu" ) ) ;