Buggy code:
public int getWorkbenchWindowCount ( ) { } public IWorkbenchWindow [ ] getWorkbenchWindows ( ) { } public IWorkingSetManager getWorkingSetManager ( ) { } public ILocalWorkingSetManager createLocalWorkingSetManager ( ) { } private boolean init ( Display display ) { } private int getDefaultOrientation ( String [ ] commandLineArgs ) { } private int checkCommandLineLocale ( ) { } private int getSystemPropertyOrientation ( ) { } private int getCommandLineOrientation ( String [ ] commandLineArgs ) { } private void initializeCommandResolver ( ) { } private void initializeApplicationColors ( ) { } private void initializeSingleClickOption ( ) { } private void initializeFonts ( ) { } private void initializeImages ( ) { } private void uninitializeImages ( ) { } private void initializeColors ( ) { } public boolean isClosing ( ) { } boolean isStarting ( ) { } private WorkbenchWindow newWorkbenchWindow ( ) { } private void forceOpenPerspective ( ) { } void openFirstTimeWindow ( ) { } IStatus restoreState ( ) { } public IWorkbenchWindow openWorkbenchWindow ( IAdaptable input ) throws WorkbenchException { } public IWorkbenchWindow openWorkbenchWindow ( final String perspID , final IAdaptable input ) throws WorkbenchException { } private XMLMemento recordWorkbenchState ( ) { } public boolean restart ( ) { } private IStatus restoreState ( IMemento memento ) { } public String [ ] getEarlyActivatedPlugins ( ) { } 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 { Assert . isNotNull ( perspectiveId ) ; boolean inputSameAsWindow = false ; WorkbenchWindow win = ( ( WorkbenchWindow ) ( window ) ) ; if ( win != null ) { WorkbenchPage page = win . getActiveWorkbenchPage ( ) ; if ( page != null ) { boolean inputSame = false ; if ( input == null ) inputSame = ( page . getInput ( ) ) == null ; else inputSame = input . equals ( page . getInput ( ) ) ; if ( inputSame ) { inputSameAsWindow = true ; IPerspectiveDescriptor [ ] perspectives = page . getOpenPerspectives ( ) ; for ( int i = 0 ; i < ( perspectives . length ) ; i ++ ) { IPerspectiveDescriptor persp = perspectives [ i ] ; if ( perspectiveId . equals ( persp . getId ( ) ) ) { win . getShell ( ) . open ( ) ; page . setPerspective ( persp ) ; return page ; } } } } } IWorkbenchWindow [ ] windows = getWorkbenchWindows ( ) ; for ( int i = 0 ; i < ( windows . length ) ; i ++ ) { win = ( ( WorkbenchWindow ) ( windows [ i ] ) ) ; if ( window != win ) { WorkbenchPage page = win . getActiveWorkbenchPage ( ) ; if ( page != null ) { boolean inputSame = false ; if ( input == null ) inputSame = ( page . getInput ( ) ) == null ; else inputSame = input . equals ( page . getInput ( ) ) ; if ( inputSame ) { Perspective persp = page . getActivePerspective ( ) ; if ( perspectiveId . equals ( persp . getDesc ( ) . getId ( ) ) ) { win . getShell ( ) . open ( ) ; return page ; } } } } } win = ( ( WorkbenchWindow ) ( window ) ) ; if ( inputSameAsWindow && ( win != null ) ) { IPreferenceStore store = WorkbenchPlugin . getDefault ( ) . getPreferenceStore ( ) ; int mode = store . getInt ( OPEN_PERSP_MODE ) ; if ( ( IPreferenceConstants . OPM_NEW_WINDOW ) != mode ) { IWorkbenchPage page = win . getActiveWorkbenchPage ( ) ; IPerspectiveDescriptor desc = getPerspectiveRegistry ( ) . findPerspectiveWithId ( perspectiveId ) ; if ( desc == null ) <START_BUG> throw new WorkbenchException ( WorkbenchMessages . getString ( "WorkbenchPage.ErrorRecreatingPerspective" ) ) ; <END_BUG> win . getShell ( ) . open ( ) ; if ( page == null ) page = win . openPage ( perspectiveId , input ) ; else page . setPerspective ( desc ) ; return page ; } } if ( win != null ) { IWorkbenchPage page = win . getActiveWorkbenchPage ( ) ; IPerspectiveDescriptor persp = null ; if ( page != null ) persp = page . getPerspective ( ) ; if ( persp == null ) { IPerspectiveDescriptor desc = getPerspectiveRegistry ( ) . findPerspectiveWithId ( perspectiveId ) ; if ( desc == null ) throw new WorkbenchException ( WorkbenchMessages . getString ( "WorkbenchPage.ErrorRecreatingPerspective" ) ) ; win . getShell ( ) . open ( ) ; if ( page == null ) page = win . openPage ( perspectiveId , input ) ; else page . setPerspective ( desc ) ; return page ; } } IWorkbenchWindow newWindow = openWorkbenchWindow ( perspectiveId , input ) ; return newWindow . getActivePage ( ) ; } private void shutdown ( ) { } 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 ; public IWorkbenchActivitySupport getActivitySupport ( ) { } public IWorkbenchCommandSupport getCommandSupport ( ) { }

Fix:
throw new WorkbenchException ( WorkbenchMessages . format ( "WorkbenchPage.ErrorCreatingPerspective" , new Object [ ] { perspectiveId } ) ) ;