Buggy code:
public class EditorManager { private EditorPresentation editorPresentation ; private WorkbenchWindow window ; private WorkbenchPage page ; private Map actionCache = new HashMap ( ) ; 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 , EditorPresentation 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 openEditorFromInput ( IEditorReference ref , IEditorInput editorInput , boolean setVisible , boolean forceInternal ) throws PartInitException { } private IEditorReference findReusableEditor ( EditorDescriptor desc ) { } public IEditorReference openEditor ( String editorId , IEditorInput input , boolean setVisible , boolean forceInternal ) throws PartInitException { } private IEditorReference openEditorFromDescriptor ( IEditorReference ref , EditorDescriptor desc , IEditorInput input , boolean forceInternal ) throws PartInitException { } private void openExternalEditor ( final EditorDescriptor desc , final Object 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 IEditorPart part , final EditorDescriptor desc , final IEditorInput input ) throws PartInitException { } private IEditorReference reuseInternalEditor ( EditorDescriptor desc , IEditorInput input ) throws PartInitException { IEditorReference reusableEditorRef = findReusableEditor ( desc ) ; if ( reusableEditorRef != null ) { IEditorPart reusableEditor = reusableEditorRef . getEditor ( false ) ; if ( reusableEditor == null ) { IEditorReference result = new EditorManager . Editor ( ) ; openInternalEditor ( result , desc , input , true ) ; page . closeEditor ( reusableEditorRef , false ) ; return result ; } EditorSite site = ( ( EditorSite ) ( reusableEditor . getEditorSite ( ) ) ) ; EditorDescriptor oldDesc = site . getEditorDescriptor ( ) ; if ( oldDesc == null ) oldDesc = ( ( EditorDescriptor ) ( getEditorRegistry ( ) . getDefaultEditor ( ) ) ) ; if ( ( desc . getId ( ) . equals ( oldDesc . getId ( ) ) ) && ( reusableEditor instanceof IReusableEditor ) ) { Workbench wb = ( ( Workbench ) ( window . getWorkbench ( ) ) ) ; editorPresentation . moveEditor ( reusableEditor , ( - 1 ) ) ; wb . getEditorHistory ( ) . add ( reusableEditor . getEditorInput ( ) , site . getEditorDescriptor ( ) ) ; <START_BUG> ( ( IReusableEditor ) ( reusableEditor ) ) . setInput ( input ) ; <END_BUG> return reusableEditorRef ; } else { IEditorReference ref = new EditorManager . Editor ( ) ; openInternalEditor ( ref , desc , input , true ) ; reusableEditor . getEditorSite ( ) . getPage ( ) . closeEditor ( reusableEditor , false ) ; return ref ; } } return null ; } private void openInternalEditor ( IEditorReference ref , final EditorDescriptor desc , IEditorInput input , boolean setVisible ) throws PartInitException { } private IEditorPart createPart ( final EditorDescriptor desc ) throws PartInitException { } public void openSystemEditor ( final IFile input ) throws PartInitException { } private ImageDescriptor findImage ( EditorDescriptor desc , IFile file ) { } public IStatus restoreState ( IMemento memento ) { } public IStatus restoreEditor ( final EditorManager . Editor ref , final IMemento editorMem ) { } public IStatus busyRestoreEditor ( final EditorManager . Editor ref , final IMemento editorMem ) { } private IStatus unableToCreateEditor ( IMemento editorMem , 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 saveEditor ( final IEditorPart part , boolean confirm ) { } public IStatus saveState ( final IMemento memento ) { } public boolean setVisibleEditor ( IEditorReference newEd , boolean setFocus ) { } private boolean testForSystemEditor ( IFile input ) { } private class Editor extends WorkbenchPartReference implements IEditorReference { private IMemento editorMemento ; private String name ; private String factoryId ; private boolean pinned = false ; Editor ( String id , IMemento memento , String name , String title , String tooltip , ImageDescriptor desc , String factoryId , boolean pinned ) { } Editor ( ) { } public String getFactoryId ( ) { } public String getName ( ) { } public String getRegisteredName ( ) { } public IWorkbenchPart getPart ( boolean restore ) { } public IEditorPart getEditor ( boolean restore ) { } public void releaseReferences ( ) { } public void setPart ( IWorkbenchPart part ) { } public IMemento getMemento ( ) { } public boolean isDirty ( ) { } public boolean isPinned ( ) { } public void setPinned ( boolean pinned ) { } public IWorkbenchPage getPage ( ) { } } }

Fix:
page . reuseEditor ( ( ( IReusableEditor ) ( reusableEditor ) ) , input ) ;