Buggy code:
public IEditorReference [ ] getEditorReferences ( ) { } public IViewReference [ ] getFastViews ( ) { } public IAdaptable getInput ( ) { } public String getLabel ( ) { } public IPerspectiveDescriptor getPerspective ( ) { } public ISelection getSelection ( ) { } public ISelection getSelection ( String partId ) { } public ArrayList getShowInPartIds ( ) { } public void performedShowIn ( String partId ) { } public void sortShowInPartIds ( ArrayList partIds ) { } public ViewFactory getViewFactory ( ) { } public IViewReference [ ] getViewReferences ( ) { } public IViewPart [ ] getViews ( ) { } IViewPart [ ] getViews ( Perspective persp , boolean restore ) { } public IWorkbenchWindow getWorkbenchWindow ( ) { } public IWorkingSet getWorkingSet ( ) { } public void hideActionSet ( String actionSetID ) { } public void hideView ( IViewReference ref ) { } void refreshActiveView ( ) { } public void hideView ( IViewPart view ) { } private void init ( WorkbenchWindow w , String layoutID , IAdaptable input , boolean openExtras ) throws WorkbenchException { } public void openPerspectiveExtras ( ) { } public boolean isPartVisible ( IWorkbenchPart part ) { } public boolean isEditorAreaVisible ( ) { } public boolean isFastView ( IViewReference ref ) { } public boolean isCloseable ( IViewReference ref ) { } public boolean isMoveable ( IViewReference ref ) { } public boolean isFixedLayout ( ) { } public IViewReference getActiveFastView ( ) { } protected boolean isSaveNeeded ( ) { } public boolean isPageZoomed ( ) { } public boolean isZoomed ( ) { } protected void onActivate ( ) { } protected void onDeactivate ( ) { } public void reuseEditor ( IReusableEditor editor , IEditorInput input ) { } public IEditorPart openEditor ( IEditorInput input , String editorID ) throws PartInitException { } public IEditorPart openEditor ( IEditorInput input , String editorID , boolean activate ) throws PartInitException { } public IEditorPart openEditor ( final IEditorInput input , final String editorID , final boolean activate , final int matchFlags ) throws PartInitException { } private IEditorPart busyOpenEditor ( IEditorInput input , String editorID , boolean activate , int matchFlags ) throws PartInitException { } private IEditorPart busyOpenEditorBatched ( IEditorInput input , String editorID , boolean activate , int matchFlags ) throws PartInitException { } private void showEditor ( boolean activate , IEditorPart editor ) { } public boolean isEditorPinned ( IEditorPart editor ) { } private boolean partChangeAffectsZoom ( IWorkbenchPartReference ref ) { } public void removeFastView ( IViewReference ref ) { } public void removePartListener ( IPartListener l ) { } public void removePartListener ( IPartListener2 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 , IPerspectiveDescriptor activeDescriptor ) { deferUpdates ( true ) ; try { String pageName = memento . getString ( TAG_LABEL ) ; String label = null ; if ( UIStats . isDebugging ( RESTORE_WORKBENCH ) ) { label = ( pageName == null ) ? "" : "::" + pageName ; } try { UIStats . start ( RESTORE_WORKBENCH , ( "WorkbenchPage" + label ) ) ; if ( pageName == null ) { pageName = "" ; } MultiStatus result = new MultiStatus ( PlatformUI . PLUGIN_ID , IStatus . OK , NLS . bind ( WorkbenchPage_unableToRestorePerspective , pageName ) , null ) ; String workingSetName = memento . getString ( TAG_WORKING_SET ) ; if ( workingSetName != null ) { <START_BUG> WorkingSetManager workingSetManager = ( ( WorkingSetManager ) ( getWorkbenchWindow ( ) . getWorkbench ( ) . getWorkingSetManager ( ) ) ) ; <END_BUG> setWorkingSet ( workingSetManager . getWorkingSet ( workingSetName ) ) ; } IMemento workingSetMem = memento . getChild ( TAG_WORKING_SETS ) ; if ( workingSetMem != null ) { IMemento [ ] workingSetChildren = workingSetMem . getChildren ( TAG_WORKING_SET ) ; List workingSetList = new ArrayList ( workingSetChildren . length ) ; for ( int i = 0 ; i < ( workingSetChildren . length ) ; i ++ ) { IWorkingSet set = getWorkbenchWindow ( ) . getWorkbench ( ) . getWorkingSetManager ( ) . getWorkingSet ( workingSetChildren [ i ] . getID ( ) ) ; if ( set != null ) { workingSetList . add ( set ) ; } } workingSets = ( ( IWorkingSet [ ] ) ( workingSetList . toArray ( new IWorkingSet [ workingSetList . size ( ) ] ) ) ) ; } aggregateWorkingSetId = memento . getString ( WorkbenchPage . ATT_AGGREGATE_WORKING_SET_ID ) ; IWorkingSet setWithId = window . getWorkbench ( ) . getWorkingSetManager ( ) . getWorkingSet ( aggregateWorkingSetId ) ; if ( setWithId instanceof AggregateWorkingSet ) { aggregateWorkingSet = ( ( AggregateWorkingSet ) ( setWithId ) ) ; } IMemento childMem = memento . getChild ( TAG_EDITORS ) ; result . merge ( getEditorManager ( ) . restoreState ( childMem ) ) ; childMem = memento . getChild ( TAG_VIEWS ) ; if ( childMem != null ) { result . merge ( getViewFactory ( ) . restoreState ( childMem ) ) ; } childMem = memento . getChild ( TAG_PERSPECTIVES ) ; String activePartID = childMem . getString ( TAG_ACTIVE_PART ) ; String activePartSecondaryID = null ; if ( activePartID != null ) { activePartSecondaryID = ViewFactory . extractSecondaryId ( activePartID ) ; if ( activePartSecondaryID != null ) { activePartID = ViewFactory . extractPrimaryId ( activePartID ) ; } } String activePerspectiveID = childMem . getString ( TAG_ACTIVE_PERSPECTIVE ) ; IMemento [ ] perspMems = childMem . getChildren ( TAG_PERSPECTIVE ) ; Perspective activePerspective = null ;

Fix:
AbstractWorkingSetManager workingSetManager = ( ( AbstractWorkingSetManager ) ( getWorkbenchWindow ( ) . getWorkbench ( ) . getWorkingSetManager ( ) ) ) ;