Buggy code:
public class WorkbenchWindow extends ApplicationWindow implements IWorkbenchWindow { private WorkbenchWindowAdvisor windowAdvisor ; private ActionBarAdvisor actionBarAdvisor ; private int number ; private WorkbenchWindow . PageList pageList = new WorkbenchWindow . PageList ( ) ; private PageListenerList pageListeners = new PageListenerList ( ) ; private PerspectiveListenerList perspectiveListeners = new PerspectiveListenerList ( ) ; private WWinPartService partService = new WWinPartService ( this ) ; private ActionPresentation actionPresentation ; private WWinActionBars actionBars ; private boolean updateDisabled = true ; private boolean closing = false ; private boolean shellActivated = false ; private FastViewBar fastViewBar ; private PerspectiveSwitcher perspectiveSwitcher ; private TrimLayout defaultLayout ; ProgressRegion progressRegion ; private HeapStatus heapStatus ; private boolean emptyWindowContentsCreated = false ; private Control emptyWindowContents ; private Rectangle normalBounds ; private boolean asMaximizedState = false ; private CBanner topBar ; private Point lastShellSize = new Point ( 0 , 0 ) ; private Composite pageComposite ; private int submenus = 0 ; private WorkbenchWindowConfigurer windowConfigurer = null ; private ShellPool detachedWindowShells ; static final String GRP_PAGES = "pages" ; static final String GRP_PERSPECTIVES = "perspectives" ; static final String GRP_FAST_VIEWS = "fastViews" ; static final int VGAP = 0 ; static final int CLIENT_INSET = 3 ; static final int BAR_SIZE = 23 ; public static final int SHOW_VIEW_SUBMENU = 1 ; public static final int OPEN_PERSPECTIVE_SUBMENU = 2 ; public static final int NEW_WIZARD_SUBMENU = 4 ; public void addSubmenu ( int type ) { } public boolean containsSubmenu ( int type ) { } private static final int FILL_ALL_ACTION_BARS = ( ( ActionBarAdvisor . FILL_MENU_BAR ) | ( ActionBarAdvisor . FILL_COOL_BAR ) ) | ( ActionBarAdvisor . FILL_STATUS_LINE ) ; public WorkbenchWindow ( int number ) { } private IExtensionPoint getActionSetExtensionPoint ( ) { } protected int perspectiveBarStyle ( ) { } private TrimDropTarget trimDropTarget ; private boolean coolBarVisible = true ; private boolean perspectiveBarVisible = true ; private boolean statusLineVisible = true ; private Map actionSetHandlersByCommandId = new HashMap ( ) ; private Map globalActionHandlersByCommandId = new HashMap ( ) ; private List handlerActivations = new ArrayList ( ) ; private int largeUpdates = 0 ; private IExtensionTracker tracker ; private IExtensionChangeHandler actionSetHandler = new IExtensionChangeHandler ( ) { public void addExtension ( IExtensionTracker tracker , IExtension extension ) { } public void removeExtension ( IExtension extension , Object [ ] objects ) { } } ; void registerActionSets ( IActionSet [ ] actionSets ) { } void registerGlobalAction ( IAction globalAction ) { } void submitActionSetAndGlobalHandlers ( ) { } public void addPageListener ( IPageListener l ) { } public void addPerspectiveListener ( org . eclipse . ui . IPerspectiveListener l ) { } protected void addPerspectiveBar ( int style ) { } private boolean busyClose ( ) { boolean windowClosed = false ; closing = true ; updateDisabled = true ; try { Workbench workbench = getWorkbenchImpl ( ) ; int count = workbench . getWorkbenchWindowCount ( ) ; <START_BUG> if ( ( ( ! ( workbench . isStarting ( ) ) ) && ( ! ( workbench . isClosing ( ) ) ) ) && ( count <= 1 ) ) { <END_BUG> windowClosed = workbench . close ( ) ; } else { if ( okToClose ( ) ) { windowClosed = hardClose ( ) ; } } } finally { if ( ! windowClosed ) { closing = false ; updateDisabled = false ; } } if ( windowClosed && ( ( tracker ) != null ) ) tracker . close ( ) ; return windowClosed ; } protected IWorkbenchPage busyOpenPage ( String perspID , IAdaptable input ) throws WorkbenchException { } 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 showEmptyWindowContents ( ) { } private void hideEmptyWindowContents ( ) { } protected void configureShell ( Shell shell ) { } ShellPool getDetachedWindowPool ( ) { } protected void createTrimWidgets ( Shell shell ) { } protected Composite createPageComposite ( Composite parent ) { } protected Control createContents ( Composite parent ) { } public void setBannerCurve ( boolean square ) { } protected void createDefaultContents ( final Shell shell ) { } private boolean getShowHeapStatus ( ) { } private void createHeapStatus ( Composite parent ) { } public void setPerspectiveBarLocation ( String location ) { } private void fireWindowOpening ( ) { } void fireWindowRestored ( ) throws WorkbenchException { } private void fireWindowCreated ( ) { } private void fireWindowOpened ( ) { } private boolean fireWindowShellClosing ( ) { } private void fireWindowClosed ( ) { } private void firePageActivated ( IWorkbenchPage page ) { } private void firePageClosed ( IWorkbenchPage page ) { } private void firePageOpened ( IWorkbenchPage page ) { } void firePerspectiveActivated ( IWorkbenchPage page , IPerspectiveDescriptor perspective ) { } void firePerspectiveDeactivated ( IWorkbenchPage page , IPerspectiveDescriptor perspective ) { } 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 ( ) { }

Fix:
if ( ( ( ( ! ( workbench . isStarting ( ) ) ) && ( ! ( workbench . isClosing ( ) ) ) ) && ( count <= 1 ) ) && ( workbench . getWorkbenchConfigurer ( ) . getExitOnLastWindowClose ( ) ) ) {