Buggy code:
public class WorkingSetManager implements IWorkingSetManager { private static final String WORKING_SET_STATE_FILENAME = "workingsets.xml" ; private static final int MRU_SIZE = 5 ; private SortedSet workingSets = new TreeSet ( new WorkingSetComparator ( ) ) ; private List recentWorkingSets = new ArrayList ( ) ; private ListenerList propertyChangeListeners = new ListenerList ( ) ; public void addRecentWorkingSet ( IWorkingSet workingSet ) { } public void addWorkingSet ( IWorkingSet workingSet ) { } public void addPropertyChangeListener ( IPropertyChangeListener listener ) { } public IWorkingSet createWorkingSet ( String name , IAdaptable [ ] elements ) { } public IWorkingSetEditWizard createWorkingSetEditWizard ( IWorkingSet workingSet ) { } public IWorkingSetSelectionDialog createWorkingSetSelectionDialog ( Shell parent ) { } public IWorkingSetSelectionDialog createWorkingSetSelectionDialog ( Shell parent , boolean multi ) { } public boolean equals ( Object object ) { } private void firePropertyChange ( String changeId , Object oldValue , Object newValue ) { } public IWorkingSet [ ] getRecentWorkingSets ( ) { } public IWorkingSet getWorkingSet ( String name ) { } public int hashCode ( ) { } public IWorkingSet [ ] getWorkingSets ( ) { } private File getWorkingSetStateFile ( ) { } private void internalAddRecentWorkingSet ( IWorkingSet workingSet ) { } public void removePropertyChangeListener ( IPropertyChangeListener listener ) { } public void removeWorkingSet ( IWorkingSet workingSet ) { } private void restoreMruList ( IMemento memento ) { } public void restoreState ( ) { } private IWorkingSet restoreWorkingSet ( IMemento memento ) { String factoryID = memento . getString ( TAG_FACTORY_ID ) ; if ( factoryID == null ) { WorkbenchPlugin . log ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>restore<seq2seq4repair_space>working<seq2seq4repair_space>set<seq2seq4repair_space>-<seq2seq4repair_space>no<seq2seq4repair_space>factory<seq2seq4repair_space>ID." ) ; return null ; } <START_BUG> IElementFactory factory = WorkbenchPlugin . getDefault ( ) . getElementFactory ( factoryID ) ; <END_BUG> if ( factory == null ) { WorkbenchPlugin . log ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>restore<seq2seq4repair_space>working<seq2seq4repair_space>set<seq2seq4repair_space>-<seq2seq4repair_space>cannot<seq2seq4repair_space>instantiate<seq2seq4repair_space>factory:<seq2seq4repair_space>" + factoryID ) ) ; return null ; } IAdaptable adaptable = factory . createElement ( memento ) ; if ( adaptable == null ) { WorkbenchPlugin . log ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>restore<seq2seq4repair_space>working<seq2seq4repair_space>set<seq2seq4repair_space>-<seq2seq4repair_space>cannot<seq2seq4repair_space>instantiate<seq2seq4repair_space>working<seq2seq4repair_space>set:<seq2seq4repair_space>" + factoryID ) ) ; return null ; } if ( ( adaptable instanceof IWorkingSet ) == false ) { WorkbenchPlugin . log ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>restore<seq2seq4repair_space>working<seq2seq4repair_space>set<seq2seq4repair_space>-<seq2seq4repair_space>element<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>an<seq2seq4repair_space>IWorkingSet:<seq2seq4repair_space>" + factoryID ) ) ; return null ; } return ( ( IWorkingSet ) ( adaptable ) ) ; } private void restoreWorkingSetState ( IMemento memento ) { } private void saveState ( ) { } private void saveMruList ( IMemento memento ) { } private void saveWorkingSetState ( IMemento memento ) { } public void workingSetChanged ( IWorkingSet changedWorkingSet , String propertyChangeId ) { } }

Fix:
IElementFactory factory = PlatformUI . getWorkbench ( ) . getElementFactory ( factoryID ) ;