Buggy code:
public ViewReference ( String id ) { } public ViewReference ( String id , String secondaryId ) { } public void dispose ( ) { } public IWorkbenchPage getPage ( ) { } public IWorkbenchPart getPart ( boolean restore ) { } public String getRegisteredName ( ) { } public String getSecondaryId ( ) { } public IViewPart getView ( boolean restore ) { } public boolean isFastView ( ) { } } private ReferenceCounter counter ; private HashMap mementoTable = new HashMap ( ) ; private WorkbenchPage page ; private IViewRegistry viewReg ; public ViewFactory ( WorkbenchPage page , IViewRegistry reg ) { } public IStatus busyRestoreView ( final IViewReference ref ) { if ( ( ref . getPart ( false ) ) != null ) return new Status ( IStatus . OK , PlatformUI . PLUGIN_ID , 0 , "" , null ) ; final String viewID = ref . getId ( ) ; final IMemento stateMem = ( ( IMemento ) ( mementoTable . get ( viewID ) ) ) ; mementoTable . remove ( viewID ) ; final boolean [ ] resetPart = new boolean [ ] { true } ; final IStatus [ ] result = new IStatus [ ] { new Status ( IStatus . OK , PlatformUI . PLUGIN_ID , 0 , "" , null ) } ; Platform . run ( new SafeRunnable ( ) { public void handleException ( Throwable e ) { if ( resetPart [ 0 ] ) { ( ( ViewFactory . ViewReference ) ( ref ) ) . setPart ( null ) ; page . hideView ( ref ) ; } result [ 0 ] = new Status ( IStatus . ERROR , PlatformUI . PLUGIN_ID , 0 , WorkbenchMessages . format ( "Perspective.exceptionRestoringView" , new String [ ] { viewID } ) , e ) ; } public void run ( ) { IViewDescriptor desc = viewReg . find ( viewID ) ; if ( desc == null ) { result [ 0 ] = new Status ( IStatus . ERROR , PlatformUI . PLUGIN_ID , 0 , WorkbenchMessages . format ( "ViewFactory.couldNotCreate" , new Object [ ] { viewID } ) , null ) ; return ; } IViewPart view = null ; String label = desc . getLabel ( ) ; try { try { UIStats . start ( CREATE_PART , label ) ; view = desc . createView ( ) ; } finally { UIStats . end ( CREATE_PART , label ) ; } ( ( ViewFactory . ViewReference ) ( ref ) ) . setPart ( view ) ; } catch ( CoreException e ) { PartPane pane = ( ( ViewFactory . ViewReference ) ( ref ) ) . getPane ( ) ; if ( pane != null ) { page . getPerspectivePresentation ( ) . removePart ( pane ) ; pane . dispose ( ) ; } result [ 0 ] = new Status ( IStatus . ERROR , PlatformUI . PLUGIN_ID , 0 , WorkbenchMessages . format ( "ViewFactory.initException" , new Object [ ] { desc . getID ( ) } ) , e ) ; return ; } ViewSite site = new ViewSite ( ref , view , page , desc ) ; try { try { UIStats . start ( INIT_PART , label ) ; view . init ( site , stateMem ) ; } finally { UIStats . end ( INIT_PART , label ) ; } } catch ( PartInitException e ) { releaseView ( ref ) ; result [ 0 ] = new Status ( IStatus . ERROR , PlatformUI . PLUGIN_ID , 0 , WorkbenchMessages . format ( "Perspective.exceptionRestoringView" , new String [ ] { viewID } ) , e ) ; return ; } if ( ( view . getSite ( ) ) != site ) { releaseView ( ref ) ; result [ 0 ] = new Status ( IStatus . ERROR , PlatformUI . PLUGIN_ID , 0 , WorkbenchMessages . format ( "ViewFactory.siteException" , new Object [ ] { desc . getID ( ) } ) , null ) ; return ; } PartPane pane = ( ( ViewFactory . ViewReference ) ( ref ) ) . getPane ( ) ; if ( pane == null ) { <START_BUG> pane = new ViewPane ( ref , page , page . getPerspective ( ) . getTheme ( ) ) ; <END_BUG> ( ( ViewFactory . ViewReference ) ( ref ) ) . setPane ( pane ) ; } site . setPane ( pane ) ; site . setActionBars ( new ViewActionBars ( page . getActionBars ( ) , ( ( ViewPane ) ( pane ) ) ) ) ; resetPart [ 0 ] = false ; site . getPane ( ) . createChildControl ( ) ; result [ 0 ] = new Status ( IStatus . OK , PlatformUI . PLUGIN_ID , 0 , "" , null ) ; } } ) ; return result [ 0 ] ; } public IViewReference createView ( final String id ) throws PartInitException { } public IViewReference createView ( String id , String secondaryId ) throws PartInitException { } private void destroyView ( IViewPart view ) { } private String getKey ( String id , String secondaryId ) { } public IViewReference getView ( String id ) { } public IViewReference getView ( String id , String secondaryId ) { } public IViewRegistry getViewRegistry ( ) { } public IViewReference [ ] getViews ( ) { } public WorkbenchPage getWorkbenchPage ( ) { } public boolean hasView ( String id ) { } public void releaseView ( IViewReference viewRef ) { } public IStatus restoreState ( IMemento memento ) { } public IStatus restoreView ( final IViewReference ref ) { } public IStatus saveState ( IMemento memento ) { } public IMemento saveViewState ( IMemento memento , IViewReference ref , MultiStatus res ) { } public void restoreViewState ( IMemento memento ) { } }

Fix:
pane = new ViewPane ( ref , page ) ;