Buggy code:
} else { newItem = new Separator ( ) ; } } else if ( ( id != null ) && ( type . equals ( TAG_TYPE_GROUPMARKER ) ) ) { newItem = new GroupMarker ( id ) ; } else if ( ( id != null ) && ( type . equals ( TAG_TYPE_TOOLBARCONTRIBUTION ) ) ) { Integer width = contributionMem . getInteger ( TAG_ITEM_X ) ; Integer height = contributionMem . getInteger ( TAG_ITEM_Y ) ; IContributionItem oldItem = coolBarMgr . find ( id ) ; if ( oldItem instanceof ToolBarContributionItem ) { newItem = ( ( ToolBarContributionItem ) ( oldItem ) ) ; } else { newItem = new ToolBarContributionItem ( new ToolBarManager ( coolBarMgr . getStyle ( ) ) , id ) ; newItem . setVisible ( false ) ; IContributionItem refItem = findAlphabeticalOrder ( MB_ADDITIONS , id , coolBarMgr ) ; coolBarMgr . insertAfter ( refItem . getId ( ) , newItem ) ; } if ( width != null ) { ( ( ToolBarContributionItem ) ( newItem ) ) . setCurrentWidth ( width . intValue ( ) ) ; } if ( height != null ) { ( ( ToolBarContributionItem ) ( newItem ) ) . setCurrentHeight ( height . intValue ( ) ) ; } } if ( newItem != null ) { layout . add ( newItem ) ; newItem . setParent ( coolBarMgr ) ; coolBarMgr . markDirty ( ) ; } } coolBarMgr . setLayout ( layout ) ; } else { coolBarMem = memento . getChild ( TAG_TOOLBAR_LAYOUT ) ; if ( coolBarMem != null ) { restoreOldCoolBar ( coolBarMem ) ; } } } IWorkbenchPage newActivePage = null ; IMemento [ ] pageArray = memento . getChildren ( TAG_PAGE ) ; for ( int i = 0 ; i < ( pageArray . length ) ; i ++ ) { IMemento pageMem = pageArray [ i ] ; String strFocus = pageMem . getString ( TAG_FOCUS ) ; if ( ( strFocus == null ) || ( ( strFocus . length ( ) ) == 0 ) ) continue ; IAdaptable input = null ; IMemento inputMem = pageMem . getChild ( TAG_INPUT ) ; if ( inputMem != null ) { String factoryID = inputMem . getString ( TAG_FACTORY_ID ) ; if ( factoryID == null ) { WorkbenchPlugin . log ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>restore<seq2seq4repair_space>page<seq2seq4repair_space>-<seq2seq4repair_space>no<seq2seq4repair_space>input<seq2seq4repair_space>factory<seq2seq4repair_space>ID." ) ; result . add ( unableToRestorePage ( pageMem ) ) ; continue ; } try { UIStats . start ( RESTORE_WORKBENCH , "WorkbenchPageFactory" ) ; IElementFactory factory = PlatformUI . getWorkbench ( ) . getElementFactory ( factoryID ) ; if ( factory == null ) { WorkbenchPlugin . log ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>restore<seq2seq4repair_space>page<seq2seq4repair_space>-<seq2seq4repair_space>cannot<seq2seq4repair_space>instantiate<seq2seq4repair_space>input<seq2seq4repair_space>factory:<seq2seq4repair_space>" + factoryID ) ) ; result . add ( unableToRestorePage ( pageMem ) ) ; continue ; } input = factory . createElement ( inputMem ) ; if ( input == null ) { WorkbenchPlugin . log ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>restore<seq2seq4repair_space>page<seq2seq4repair_space>-<seq2seq4repair_space>cannot<seq2seq4repair_space>instantiate<seq2seq4repair_space>input<seq2seq4repair_space>element:<seq2seq4repair_space>" + factoryID ) ) ; result . add ( unableToRestorePage ( pageMem ) ) ; continue ; } } finally { UIStats . end ( RESTORE_WORKBENCH , "WorkbenchPageFactory" ) ; } } WorkbenchPage newPage = null ; try { newPage = new WorkbenchPage ( this , input ) ; result . add ( newPage . restoreState ( pageMem , activeDescriptor ) ) ; pageList . add ( newPage ) ; firePageOpened ( newPage ) ; } catch ( WorkbenchException e ) { WorkbenchPlugin . log ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>restore<seq2seq4repair_space>perspective<seq2seq4repair_space>-<seq2seq4repair_space>constructor<seq2seq4repair_space>failed." ) ; result . add ( e . getStatus ( ) ) ; continue ; } if ( ( strFocus != null ) && ( ( strFocus . length ( ) ) > 0 ) ) newActivePage = newPage ; } if ( pageList . isEmpty ( ) ) { try { String defPerspID = getWorkbenchImpl ( ) . getPerspectiveRegistry ( ) . getDefaultPerspective ( ) ; <START_BUG> WorkbenchPage newPage = new WorkbenchPage ( this , defPerspID , getAdvisor ( ) . getDefaultWindowInput ( ) ) ; <END_BUG> pageList . add ( newPage ) ; firePageOpened ( newPage ) ; } catch ( WorkbenchException e ) { WorkbenchPlugin . log ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>default<seq2seq4repair_space>perspective<seq2seq4repair_space>-<seq2seq4repair_space>constructor<seq2seq4repair_space>failed." ) ; result . add ( e . getStatus ( ) ) ; String productName = WorkbenchPlugin . getDefault ( ) . getProductName ( ) ; if ( productName == null ) { productName = "" ; } getShell ( ) . setText ( productName ) ; } } if ( newActivePage == null ) newActivePage = ( ( IWorkbenchPage ) ( pageList . getNextActive ( ) ) ) ; setActivePage ( newActivePage ) ; return result ; } private boolean restoreOldCoolBar ( IMemento coolbarMem ) { } private boolean readLayout ( IMemento memento , ArrayList itemIds , ArrayList wrapIndicies ) { } private IContributionItem findAlphabeticalOrder ( String startId , String itemId , IContributionManager mgr ) { } public void run ( boolean fork , boolean cancelable , IRunnableWithProgress runnable ) throws InterruptedException , InvocationTargetException { } private boolean saveAllPages ( boolean bConfirm ) { } public IStatus saveState ( IMemento memento ) { } void selectPerspectiveShortcut ( IPerspectiveDescriptor perspective , WorkbenchPage page , boolean selected ) { } public void setActivePage ( final IWorkbenchPage in ) { } private void showShortcutBarPopup ( Point pt ) { } private void trackShellActivation ( Shell shell ) { } private void trackShellResize ( Shell newShell ) { } public void updateActionBars ( ) { } public void updateActionSets ( ) { } void updatePerspectiveShortcut ( IPerspectiveDescriptor oldDesc , IPerspectiveDescriptor newDesc , WorkbenchPage page ) { } private boolean showProgressIndicator ( ) { } private void createProgressIndicator ( Shell shell ) { } class PageList { private List pageList ; private List pageStack ; private Object active ; public PageList ( ) { } public boolean add ( Object object ) { } public Iterator iterator ( ) { } public boolean contains ( Object object ) { }

Fix:
WorkbenchPage newPage = new WorkbenchPage ( this , defPerspID , getAdvisor ( ) . getDefaultPageInput ( ) ) ;