Buggy code:
public int open ( ) { } protected boolean canHandleShellCloseEvent ( ) { } public boolean close ( ) { } protected boolean isClosing ( ) { } protected boolean isCoolBarLocked ( ) { } private void closeAllPages ( ) { } public void closeAllPages ( boolean save ) { } protected boolean closePage ( IWorkbenchPage in , boolean save ) { } private void showEmptyWindowMessage ( ) { } protected void configureShell ( Shell shell ) { } protected void createTrimWidgets ( Shell shell ) { } protected Composite createPageComposite ( Composite parent ) { } protected Control createContents ( Composite parent ) { } protected void createDefaultContents ( final Shell shell ) { } public void dockPerspectiveBar ( boolean dock ) { } private void createPerspectiveBar ( ) { } IContributionItem findPerspectiveShortcut ( IPerspectiveDescriptor perspective , WorkbenchPage page ) { } private void firePageActivated ( IWorkbenchPage page ) { } private void firePageClosed ( IWorkbenchPage page ) { } private void firePageOpened ( IWorkbenchPage page ) { } void firePerspectiveActivated ( IWorkbenchPage page , IPerspectiveDescriptor perspective ) { } void firePerspectiveChanged ( IWorkbenchPage page , IPerspectiveDescriptor perspective , String changeId ) { } void firePerspectiveClosed ( IWorkbenchPage page , IPerspectiveDescriptor perspective ) { } void firePerspectiveOpened ( IWorkbenchPage page , IPerspectiveDescriptor perspective ) { } 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 IPerspectiveService getPerspectiveService ( ) { } public ISelectionService getSelectionService ( ) { } public boolean getShellActivated ( ) { } public StatusLineManager getStatusLineManager ( ) { } public IWorkbench getWorkbench ( ) { } public String getToolbarLabel ( String actionSetId ) { } private boolean hardClose ( ) { } public boolean isApplicationMenu ( String menuID ) { } boolean isWorkbenchCoolItemId ( String id ) { } void lockCoolBar ( boolean lock ) { } 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 ) { } void removePerspectiveShortcut ( IPerspectiveDescriptor perspective , WorkbenchPage page ) { } 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 ) { } void selectPerspectiveShortcut ( IPerspectiveDescriptor perspective , WorkbenchPage page , boolean selected ) { } public void setActivePage ( final IWorkbenchPage in ) { } private void showPerspectiveBarPopup ( Point pt ) { final ToolBar toolBar = perspectiveBar . getControl ( ) ; ToolItem toolItem = toolBar . getItem ( toolBar . toControl ( pt ) ) ; if ( ( toolItem == null ) || ( ! ( ( toolItem . getData ( ) ) instanceof PerspectiveBarContributionItem ) ) ) { if ( ( perspectiveBarGenericMenu ) == null ) { Menu menu = new Menu ( toolBar ) ; final MenuItem dockMenuItem = new MenuItem ( menu , SWT . CHECK ) ; <START_BUG> dockMenuItem . setText ( WorkbenchMessages . getString ( "Dock<seq2seq4repair_space>&Left" ) ) ; <END_BUG> dockMenuItem . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { IPreferenceStore apiStore = PrefUtil . getAPIPreferenceStore ( ) ; apiStore . setValue ( DOCK_PERSPECTIVE_BAR , dockMenuItem . getSelection ( ) ) ; } } ) ; perspectiveBarGenericMenu = menu ; } perspectiveBarGenericMenu . getItem ( 0 ) . setSelection ( dockPerspectiveBar ) ; if ( ( perspectiveBarGenericMenu ) != null ) { perspectiveBarGenericMenu . setLocation ( pt . x , pt . y ) ; perspectiveBarGenericMenu . setVisible ( true ) ; } return ; } if ( ( perspectiveBarMenu ) == null ) { Menu menu = new Menu ( toolBar ) ; MenuItem menuItem = new MenuItem ( menu , SWT . NONE ) ; menuItem . setText ( WorkbenchMessages . getString ( "WorkbenchWindow.close" ) ) ; menuItem . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { ToolItem perspectiveToolItem = ( ( ToolItem ) ( perspectiveBarMenu . getData ( ) ) ) ; if ( ( perspectiveToolItem != null ) && ( ! ( perspectiveToolItem . isDisposed ( ) ) ) ) { PerspectiveBarContributionItem item = ( ( PerspectiveBarContributionItem ) ( perspectiveToolItem . getData ( ) ) ) ; item . getPage ( ) . closePerspective ( item . getPerspective ( ) , true ) ; toolBar . layout ( ) ; } } } ) ; menuItem = new MenuItem ( menu , SWT . NONE ) ; menuItem . setText ( WorkbenchMessages . getString ( "WorkbenchWindow.closeAll" ) ) ; menuItem . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { ToolItem perspectiveToolItem = ( ( ToolItem ) ( perspectiveBarMenu . getData ( ) ) ) ; if ( ( perspectiveToolItem != null ) && ( ! ( perspectiveToolItem . isDisposed ( ) ) ) ) { PerspectiveBarContributionItem item = ( ( PerspectiveBarContributionItem ) ( perspectiveToolItem . getData ( ) ) ) ; item . getPage ( ) . closeAllPerspectives ( ) ; toolBar . layout ( ) ; } }

Fix:
dockMenuItem . setText ( WorkbenchMessages . getString ( "PerspectiveBar.dockLeft" ) ) ;