Buggy code:
private ListenerList windowListeners = new ListenerList ( ) ; private WorkbenchAdvisor advisor ; private WorkbenchConfigurer workbenchConfigurer ; private ExtensionEventHandler extensionEventHandler ; private Workbench ( Display display , WorkbenchAdvisor advisor ) { } public static final Workbench getInstance ( ) { } public static final int createAndRunWorkbench ( Display display , WorkbenchAdvisor advisor ) { } public static Display createDisplay ( ) { } public static WorkbenchTestable getWorkbenchTestable ( ) { } public void addWindowListener ( IWindowListener l ) { } public void removeWindowListener ( IWindowListener l ) { } protected void fireWindowOpened ( final IWorkbenchWindow window ) { } protected void fireWindowClosed ( final IWorkbenchWindow window ) { } protected void fireWindowActivated ( final IWorkbenchWindow window ) { } protected void fireWindowDeactivated ( final IWorkbenchWindow window ) { } private boolean busyClose ( final boolean force ) { } public boolean saveAllEditors ( boolean confirm ) { } private IWorkbenchWindow busyOpenWorkbenchWindow ( String perspID , IAdaptable input ) throws WorkbenchException { } public boolean close ( ) { } boolean close ( int returnCode , final boolean force ) { } public IWorkbenchWindow getActiveWorkbenchWindow ( ) { } protected EditorHistory getEditorHistory ( ) { } public IEditorRegistry getEditorRegistry ( ) { } private int getNewWindowNumber ( ) { } public IPerspectiveRegistry getPerspectiveRegistry ( ) { } public PreferenceManager getPreferenceManager ( ) { } public IPreferenceStore getPreferenceStore ( ) { } public ISharedImages getSharedImages ( ) { } WindowManager getWindowManager ( ) { } private File getWorkbenchStateFile ( ) { } public int getWorkbenchWindowCount ( ) { } public IWorkbenchWindow [ ] getWorkbenchWindows ( ) { } public IWorkingSetManager getWorkingSetManager ( ) { } private boolean init ( ImageDescriptor windowImage , Display display ) { if ( WorkbenchPlugin . getDefault ( ) . isDebugging ( ) ) { WorkbenchPlugin . DEBUG = true ; ModalContext . setDebugMode ( true ) ; } windowManager = new WindowManager ( ) ; IIntroRegistry introRegistry = getIntroRegistry ( ) ; if ( ( introRegistry . getIntroCount ( ) ) > 0 ) { introDescriptor = ( ( IntroDescriptor ) ( introRegistry . getIntros ( ) [ 0 ] ) ) ; } workbenchActivitySupport = new WorkbenchActivitySupport ( ) ; workbenchCommandSupport = new WorkbenchCommandSupport ( this ) ; workbenchContextSupport = new WorkbenchContextSupport ( ) ; workbenchCommandSupport . getCommandManager ( ) . addCommandManagerListener ( workbenchCommandsAndContexts . commandManagerListener ) ; workbenchContextSupport . getContextManager ( ) . addContextManagerListener ( workbenchCommandsAndContexts . contextManagerListener ) ; CommandResolver . getInstance ( ) . setCommandResolver ( new CommandResolver . ICallback ( ) { public Integer getAccelerator ( String commandId ) { Integer accelerator = null ; ICommand command = workbenchCommandSupport . getCommandManager ( ) . getCommand ( commandId ) ; if ( command . isDefined ( ) ) { List keySequenceBindings = command . getKeySequenceBindings ( ) ; if ( ! ( keySequenceBindings . isEmpty ( ) ) ) { IKeySequenceBinding keySequenceBinding = ( ( IKeySequenceBinding ) ( keySequenceBindings . get ( 0 ) ) ) ; KeySequence keySequence = keySequenceBinding . getKeySequence ( ) ; List keyStrokes = keySequence . getKeyStrokes ( ) ; if ( ( keyStrokes . size ( ) ) == 1 ) { KeyStroke keyStroke = ( ( KeyStroke ) ( keyStrokes . get ( 0 ) ) ) ; accelerator = new Integer ( SWTKeySupport . convertKeyStrokeToAccelerator ( keyStroke ) ) ; } } } return accelerator ; } public String getAcceleratorText ( String commandId ) { String acceleratorText = null ; ICommand command = workbenchCommandSupport . getCommandManager ( ) . getCommand ( commandId ) ; if ( command . isDefined ( ) ) { List keySequenceBindings = command . getKeySequenceBindings ( ) ; if ( ! ( keySequenceBindings . isEmpty ( ) ) ) { IKeySequenceBinding keySequenceBinding = ( ( IKeySequenceBinding ) ( keySequenceBindings . get ( 0 ) ) ) ; acceleratorText = keySequenceBinding . getKeySequence ( ) . format ( ) ; } } return acceleratorText ; } public boolean isAcceleratorInUse ( int accelerator ) { KeySequence keySequence = KeySequence . getInstance ( SWTKeySupport . convertAcceleratorToKeyStroke ( accelerator ) ) ; return ( workbenchCommandSupport . getCommandManager ( ) . isPerfectMatch ( keySequence ) ) || ( workbenchCommandSupport . getCommandManager ( ) . isPartialMatch ( keySequence ) ) ; } public final boolean isActive ( final String commandId ) { if ( commandId != null ) { final ICommand command = workbenchCommandSupport . getCommandManager ( ) . getCommand ( commandId ) ; if ( command != null ) <START_BUG> return ( command . isDefined ( ) ) && ( command . isActive ( ) ) ; <END_BUG> } return true ; } } ) ; addWindowListener ( workbenchCommandsAndContexts . windowListener ) ; workbenchCommandsAndContexts . commandHandlerServiceChanged ( ) ; workbenchCommandsAndContexts . contextActivationServiceChanged ( ) ; getWorkbenchConfigurer ( ) . init ( ) ; initializeImages ( windowImage ) ; initializeFonts ( ) ; initializeColors ( ) ; initializeApplicationColors ( ) ; advisor . initialize ( getWorkbenchConfigurer ( ) ) ; boolean useColorIcons = getPreferenceStore ( ) . getBoolean ( COLOR_ICONS ) ; ActionContributionItem . setUseColorIconsInToolbars ( useColorIcons ) ; initializeSingleClickOption ( ) ; boolean avoidDeadlock = true ; String [ ] commandLineArgs = Platform . getCommandLineArgs ( ) ; for ( int i = 0 ; i < ( commandLineArgs . length ) ; i ++ ) { if ( commandLineArgs [ i ] . equalsIgnoreCase ( "-allowDeadlock" ) ) avoidDeadlock = false ; } if ( avoidDeadlock ) { UILockListener uiLockListener = new UILockListener ( display ) ; Platform . getJobManager ( ) . setLockListener ( uiLockListener ) ; display . setSynchronizer ( new UISynchronizer ( display , uiLockListener ) ) ; } activityHelper = ActivityPersistanceHelper . getInstance ( ) ; try { UIStats . start ( RESTORE_WORKBENCH , "Workbench" ) ; advisor . preStartup ( ) ; int restoreCode = openPreviousWorkbenchState ( ) ; if ( restoreCode == ( Workbench . RESTORE_CODE_EXIT ) ) { return false ; } if ( restoreCode == ( Workbench . RESTORE_CODE_RESET ) ) { openFirstTimeWindow ( ) ; }

Fix:
return ( command . isDefined ( ) ) && ( workbenchActivitySupport . getActivityManager ( ) . getIdentifier ( command . getId ( ) ) . isEnabled ( ) ) ;