Buggy code:
public void bundleChanged ( BundleEvent event ) { } } public static final String EARLY_STARTUP_FAMILY = "earlyStartup" ; static final String [ ] VERSION_STRING = new String [ ] { "0.046" , "2.0" } ; static final String DEFAULT_WORKBENCH_STATE_FILENAME = "workbench.xml" ; private static Workbench instance ; private static WorkbenchTestable testableObject ; private static boolean createSplash = true ; private static AbstractSplashHandler splash ; private Display display ; private WindowManager windowManager ; private WorkbenchWindow activatedWindow ; private EditorHistory editorHistory ; private boolean runEventLoop = true ; private boolean isStarting = true ; private boolean isClosing = false ; private int returnCode = PlatformUI . RETURN_UNSTARTABLE ; private WorkbenchAdvisor advisor ; private WorkbenchConfigurer workbenchConfigurer ; private ExtensionEventHandler extensionEventHandler ; private int largeUpdates = 0 ; private final ServiceLocator serviceLocator ; private int progressCount = - 1 ; private WorkbenchWindow [ ] createdWindows ; private ListenerList workbenchListeners = new ListenerList ( ListenerList . IDENTITY ) ; private ServiceRegistration workbenchService ; private Workbench ( Display display , WorkbenchAdvisor advisor ) { } public static final Workbench getInstance ( ) { } public static final int createAndRunWorkbench ( final Display display , final WorkbenchAdvisor advisor ) { } public static Display createDisplay ( ) { } private void createSplashWrapper ( ) { } private Image loadImage ( String splashLoc ) { } private static AbstractSplashHandler getSplash ( ) { } public static WorkbenchTestable getWorkbenchTestable ( ) { } public void addWorkbenchListener ( IWorkbenchListener listener ) { } public void removeWorkbenchListener ( IWorkbenchListener listener ) { } boolean firePreShutdown ( final boolean forced ) { } void firePostShutdown ( ) { } 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 ( final String perspID , final IAdaptable input ) throws WorkbenchException { } public boolean close ( ) { } boolean close ( int returnCode , final boolean force ) { } public IWorkbenchWindow getActiveWorkbenchWindow ( ) { } public EditorHistory getEditorHistory ( ) { } public IEditorRegistry getEditorRegistry ( ) { } private int getNewWindowNumber ( ) { } public IWorkbenchOperationSupport getOperationSupport ( ) { } 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 ( ) { } public ILocalWorkingSetManager createLocalWorkingSetManager ( ) { } private boolean init ( ) { } private void initializeWorkbenchImages ( ) { } private void initializeCommandResolver ( ) { } private void initializeApplicationColors ( ) { } private void initializeSingleClickOption ( ) { } private void initializeFonts ( ) { } private static void initializeImages ( ) { } private void uninitializeImages ( ) { } private void initializeColors ( ) { } public boolean isClosing ( ) { } private final void initializeDefaultServices ( ) { } public boolean isStarting ( ) { } private WorkbenchWindow newWorkbenchWindow ( ) { } private void forceOpenPerspective ( ) { } void openFirstTimeWindow ( ) { } private void runStartupWithProgress ( final int expectedProgressCount , final Runnable runnable ) { } private void doOpenFirstTimeWindow ( ) { } IStatus restoreState ( ) { } private boolean shouldReturnNoWindowError ( final IStatus result ) { final boolean [ ] shouldReturn = new boolean [ 1 ] ; shouldReturn [ 0 ] = ( result . isOK ( ) ) && ( ( windowManager . getWindows ( ) . length ) == 0 ) ; if ( shouldReturn [ 0 ] ) { display . syncExec ( new Runnable ( ) { public void run ( ) { <START_BUG> shouldReturn [ 0 ] = hasAppMenu ( ) ; <END_BUG> } } ) ; } return shouldReturn [ 0 ] ; } public IWorkbenchWindow openWorkbenchWindow ( IAdaptable input ) throws WorkbenchException { } public IWorkbenchWindow openWorkbenchWindow ( final String perspID , final IAdaptable input ) throws WorkbenchException { } IWorkbenchWindow restoreWorkbenchWindow ( IMemento memento ) throws WorkbenchException { } private XMLMemento recordWorkbenchState ( ) { } public boolean restart ( ) { } private IStatus restoreState ( final IMemento memento ) { } public ContributionInfo [ ] getEarlyActivatedPlugins ( ) { } public String [ ] getDisabledEarlyActivatedPlugins ( ) { } private void initializeSourcePriorities ( ) { } private void startSourceProviders ( ) { } private void startPlugins ( ) { } private int runUI ( ) { } private void runEventLoop ( Window . IExceptionHandler handler , Display display ) { } private IStatus saveState ( IMemento memento ) { } private boolean saveMementoToFile ( XMLMemento memento ) { } public IWorkbenchPage showPerspective ( String perspectiveId , IWorkbenchWindow window ) throws WorkbenchException { } public IWorkbenchPage showPerspective ( String perspectiveId , IWorkbenchWindow window , IAdaptable input ) throws WorkbenchException { } private void shutdown ( ) { } private void cancelEarlyStartup ( ) { } public IDecoratorManager getDecoratorManager ( ) { } private WorkbenchWindow getActivatedWindow ( ) { } void setActivatedWindow ( WorkbenchWindow window ) { } WorkbenchConfigurer getWorkbenchConfigurer ( ) { } WorkbenchAdvisor getAdvisor ( ) { } public Display getDisplay ( ) { } public String getDefaultPerspectiveId ( ) { } public IAdaptable getDefaultPageInput ( ) { } public String getMainPreferencePageId ( ) { } public IElementFactory getElementFactory ( String factoryId ) { } public IProgressService getProgressService ( ) { } private WorkbenchActivitySupport workbenchActivitySupport ; private WorkbenchCommandSupport workbenchCommandSupport ; private WorkbenchContextSupport workbenchContextSupport ; private BindingManager bindingManager ; private CommandManager commandManager ; private ContextManager contextManager ;

Fix:
shouldReturn [ 0 ] = ! ( hasAppMenu ( ) ) ;