Buggy code:
public void addSelectionListener ( ISelectionListener listener ) { } public void addSelectionListener ( String partId , ISelectionListener listener ) { } public void addPostSelectionListener ( ISelectionListener listener ) { } public void addPostSelectionListener ( String partId , ISelectionListener listener ) { } public void bringToTop ( IWorkbenchPart part ) { } private void busyResetPerspective ( ) { } private void busySetPerspective ( IPerspectiveDescriptor desc ) { } private IViewPart busyShowView ( String viewID , boolean activate ) throws PartInitException { } private boolean certifyPart ( IWorkbenchPart part ) { } public boolean close ( ) { } public boolean closeAllSavedEditors ( ) { } public boolean closeAllEditors ( boolean save ) { } public boolean closeEditor ( IEditorReference editorRef , boolean save ) { } public boolean closeEditor ( IEditorPart editor , boolean save ) { } void closeAllPerspectives ( boolean save ) { } void closePerspective ( IPerspectiveDescriptor desc , boolean save ) { } void closePerspective ( Perspective persp , boolean save ) { } private void createClientComposite ( ) { } private Perspective createPerspective ( PerspectiveDescriptor desc ) { } public void openTracker ( ViewPane pane ) { } protected void addPart ( IWorkbenchPartReference ref ) { } protected void removePart ( IWorkbenchPartReference ref ) { } private void deactivateLastEditor ( ) { } private void deactivatePart ( IWorkbenchPart part ) { } private void disposePart ( final IWorkbenchPart part ) { } public void dispose ( ) { } private void disposePerspective ( Perspective persp ) { } public INavigationHistory getNavigationHistory ( ) { } public boolean editActionSets ( ) { } public Perspective findPerspective ( IPerspectiveDescriptor desc ) { } public IViewPart findView ( String id ) { } private void firePartActivated ( IWorkbenchPart part ) { } private void firePartBroughtToTop ( IWorkbenchPart part ) { } private void firePartClosed ( IWorkbenchPart part ) { } private void firePartDeactivated ( IWorkbenchPart part ) { } public void firePartOpened ( IWorkbenchPart part ) { } private void firePropertyChange ( String changeId , Object oldValue , Object newValue ) { } public IActionBars getActionBars ( ) { } public IActionSetDescriptor [ ] getActionSets ( ) { } public IEditorPart getActiveEditor ( ) { } public IWorkbenchPart getActivePart ( ) { } Perspective getActivePerspective ( ) { } public Composite getClientComposite ( ) { } private EditorManager getEditorManager ( ) { } public EditorPresentation getEditorPresentation ( ) { } public IEditorPart [ ] getEditors ( ) { } public IEditorPart [ ] getDirtyEditors ( ) { } public IEditorPart findEditor ( IEditorInput input ) { } public IEditorReference [ ] getEditorReferences ( ) { } public IViewPart [ ] getFastViews ( ) { } public IAdaptable getInput ( ) { } public String getLabel ( ) { } protected Listener getMouseDownListener ( ) { } public ArrayList getNewWizardActionIds ( ) { } public IPerspectiveDescriptor getPerspective ( ) { } public ArrayList getPerspectiveActionIds ( ) { } public ISelection getSelection ( ) { } public ISelection getSelection ( String partId ) { } public ArrayList getShowViewActionIds ( ) { } public CoolBarLayout getToolBarLayout ( ) { } protected WorkbenchWindow getUnprotectedWindow ( ) { } public ViewFactory getViewFactory ( ) { } public IViewReference [ ] getViewReferences ( ) { } public IViewPart [ ] getViews ( ) { } public IWorkbenchWindow getWorkbenchWindow ( ) { } public IWorkingSet getWorkingSet ( ) { } public void hideActionSet ( String actionSetID ) { } public void hideView ( IViewPart view ) { } private void lastPartClosePerspective ( ) { Perspective persp = getActivePerspective ( ) ; if ( ( persp != null ) && ( ( getActivePart ( ) ) == null ) ) <START_BUG> if ( ( ( persp . getViewReferences ( ) . length ) == 0 ) || ( ( getEditorReferences ( ) . length ) == 0 ) ) <END_BUG> closePerspective ( persp , false ) ; } private void init ( WorkbenchWindow w , String layoutID , IAdaptable input ) throws WorkbenchException { } public boolean isEditorAreaVisible ( ) { } public boolean isFastView ( IViewPart part ) { } public IViewPart getActiveFastView ( ) { } protected boolean isSaveNeeded ( ) { } public boolean isZoomed ( ) { } private boolean needToZoomOut ( IWorkbenchPart part ) { } protected void onActivate ( ) { } protected void onDeactivate ( ) { } public IEditorPart openEditor ( IFile file ) throws PartInitException { } public IEditorPart openEditor ( IFile file , String editorID ) throws PartInitException { } public IEditorPart openEditor ( IFile file , String editorID , boolean activate ) throws PartInitException { } public IEditorPart openEditor ( IMarker marker ) throws PartInitException { } public IEditorPart openEditor ( IMarker marker , boolean activate ) throws PartInitException { } public IEditorPart openEditor ( IEditorInput input , String editorID ) throws PartInitException { } public IEditorPart openEditor ( IEditorInput input , String editorID , boolean activate ) throws PartInitException { } private IEditorPart openEditor ( IEditorInput input , String editorID , boolean activate , boolean useEditorID , IFile file ) throws PartInitException { } private void showEditor ( boolean activate , IEditorPart editor ) { } public boolean isEditorPinned ( IEditorPart editor ) { } public void openSystemEditor ( IFile input ) throws PartInitException { } private boolean partChangeAffectsZoom ( IWorkbenchPart part ) { } public void removeFastView ( IViewPart view ) { } public void removePartListener ( IPartListener l ) { } public void removePropertyChangeListener ( IPropertyChangeListener listener ) { } public void removeSelectionListener ( ISelectionListener listener ) { } public void removeSelectionListener ( String partId , ISelectionListener listener ) { } public void removePostSelectionListener ( ISelectionListener listener ) { } public void removePostSelectionListener ( String partId , ISelectionListener listener ) { } public void requestActivation ( IWorkbenchPart part ) { } public void resetPerspective ( ) { } public IStatus restoreState ( IMemento memento ) { } public boolean saveAllEditors ( boolean confirm ) { }

Fix:
if ( ( ( persp . getViewReferences ( ) . length ) == 0 ) && ( ( getEditorReferences ( ) . length ) == 0 ) )