Buggy code:
public class EditorManager { private EditorAreaHelper editorPresentation ; private WorkbenchWindow window ; private WorkbenchPage page ; private Map actionCache = new HashMap ( ) ; private MultiStatus closingEditorStatus = null ; private static final String RESOURCES_TO_SAVE_MESSAGE = WorkbenchMessages . getString ( "EditorManager.saveResourcesMessage" ) ; private static final String SAVE_RESOURCES_TITLE = WorkbenchMessages . getString ( "EditorManager.saveResourcesTitle" ) ; public EditorManager ( WorkbenchWindow window , WorkbenchPage workbenchPage , EditorAreaHelper pres ) { } public void closeAll ( ) { } public void closeEditor ( IEditorReference ref ) { } private List collectDirtyEditors ( ) { } public boolean containsEditor ( IEditorReference ref ) { } private EditorActionBars createEditorActionBars ( EditorDescriptor desc ) { } private EditorActionBars createEmptyEditorActionBars ( ) { } private void disposeEditorActionBars ( EditorActionBars actionBars ) { } public IEditorPart findEditor ( IEditorInput input ) { } private Display getDisplay ( ) { } public int getEditorCount ( ) { } private IEditorRegistry getEditorRegistry ( ) { } public IEditorPart [ ] getDirtyEditors ( ) { } public IEditorReference [ ] getEditors ( ) { } public IEditorPart getVisibleEditor ( ) { } public boolean isSaveAllNeeded ( ) { } private IEditorReference findReusableEditor ( EditorDescriptor desc ) { } public IEditorReference openEditor ( String editorId , IEditorInput input , boolean setVisible ) throws PartInitException { } private IEditorReference openEditorFromDescriptor ( IEditorReference ref , EditorDescriptor desc , IEditorInput input ) throws PartInitException { IEditorReference result = ref ; if ( desc . isInternal ( ) ) { result = reuseInternalEditor ( desc , input ) ; if ( result == null ) { result = ref ; openInternalEditor ( ref , desc , input , true ) ; } } else if ( desc . getId ( ) . equals ( SYSTEM_INPLACE_EDITOR_ID ) ) { result = openSystemInPlaceEditor ( ref , desc , input ) ; } else if ( desc . getId ( ) . equals ( SYSTEM_EXTERNAL_EDITOR_ID ) ) { IPathEditorInput pathInput = getPathEditorInput ( input ) ; if ( pathInput != null ) { result = openSystemExternalEditor ( pathInput . getPath ( ) ) ; } else { throw new PartInitException ( WorkbenchMessages . getString ( "EditorManager.systemEditorError" ) ) ; } } else if ( desc . isOpenExternal ( ) ) { result = openExternalEditor ( desc , input ) ; } else { <START_BUG> throw new IllegalStateException ( ) ; <END_BUG> } Workbench wb = ( ( Workbench ) ( window . getWorkbench ( ) ) ) ; wb . getEditorHistory ( ) . add ( input , desc ) ; return result ; } private IEditorReference openExternalEditor ( final EditorDescriptor desc , IEditorInput input ) throws PartInitException { } private IEditorReference [ ] openMultiEditor ( final IEditorReference ref , final MultiEditor part , final EditorDescriptor desc , final MultiEditorInput input , final boolean setVisible ) throws PartInitException { } private void createEditorTab ( final IEditorReference ref , final EditorDescriptor desc , final IEditorInput input , final boolean setVisible ) throws PartInitException { } private void createSite ( final IEditorReference ref , final IEditorPart part , final EditorDescriptor desc , final IEditorInput input ) throws PartInitException { } private IEditorReference reuseInternalEditor ( EditorDescriptor desc , IEditorInput input ) throws PartInitException { } private void openInternalEditor ( IEditorReference ref , EditorDescriptor desc , IEditorInput input , boolean setVisible ) throws PartInitException { } private IEditorPart createPart ( final EditorDescriptor desc ) throws PartInitException { } private IEditorReference openSystemExternalEditor ( final IPath location ) throws PartInitException { } private IEditorReference openSystemInPlaceEditor ( IEditorReference ref , EditorDescriptor desc , IEditorInput input ) throws PartInitException { } private ImageDescriptor findImage ( EditorDescriptor desc , IPath path ) { } public IStatus restoreState ( IMemento memento ) { } public IStatus restoreEditor ( final EditorManager . Editor ref ) { } public IStatus busyRestoreEditor ( final EditorManager . Editor ref ) { } private IStatus unableToCreateEditor ( EditorManager . Editor ref , Throwable t ) { } private static boolean runProgressMonitorOperation ( String opName , final IRunnableWithProgress progressOp , IWorkbenchWindow window ) { } public boolean saveAll ( boolean confirm , boolean closing ) { } public static boolean saveAll ( List dirtyEditors , boolean confirm , final IWorkbenchWindow window ) { } public boolean savePart ( final ISaveablePart saveable , IWorkbenchPart part , boolean confirm ) { } public boolean saveEditor ( IEditorPart part , boolean confirm ) { } public IStatus saveState ( final IMemento memento ) { } public boolean setVisibleEditor ( IEditorReference newEd , boolean setFocus ) { } private IPathEditorInput getPathEditorInput ( IEditorInput input ) { } private class Editor extends WorkbenchPartReference implements IEditorReference { private IMemento editorMemento ; private String name ; private String factoryId ; private boolean pinned = false ; private IEditorInput restoredInput ; Editor ( ) { } Editor ( IMemento memento ) { } public String getFactoryId ( ) { } public String getName ( ) { } public String getRegisteredName ( ) { } public IWorkbenchPart getPart ( boolean restore ) { } public IEditorPart getEditor ( boolean restore ) { } public void releaseReferences ( ) { } void setName ( String name ) { } public void setPart ( IWorkbenchPart part ) { } public IMemento getMemento ( ) { } public boolean isDirty ( ) { } public boolean isPinned ( ) { } public void setPinned ( boolean pinned ) { } public IWorkbenchPage getPage ( ) { } public void dispose ( ) { } public IEditorInput getRestoredInput ( ) { } } protected void restoreEditorState ( IMemento editorMem , ArrayList visibleEditors , IEditorPart [ ] activeEditor , ArrayList errorWorkbooks , MultiStatus result ) { } protected void saveEditorState ( IMemento mem , IEditorPart ed , MultiStatus res ) { } public IMemento getMemento ( IEditorReference e ) { } }

Fix:
throw new PartInitException ( WorkbenchMessages . format ( "EditorManager.invalidDescriptor" , new String [ ] { desc . getId ( ) } ) ) ;