Buggy code:
public class FileEditorsPreferencePage extends PreferencePage implements Listener , IWorkbenchPreferencePage { private static final String DATA_EDITOR = "editor" ; private static final String DATA_FROM_CONTENT_TYPE = "type" ; protected Table resourceTypeTable ; protected Button addResourceTypeButton ; protected Button removeResourceTypeButton ; protected Table editorTable ; protected Button addEditorButton ; protected Button removeEditorButton ; protected Button defaultEditorButton ; protected Label editorLabel ; protected IWorkbench workbench ; protected List imagesToDispose ; protected Map editorsToImages ; public void addResourceType ( String newName , String newExtension ) { } protected Control createContents ( Composite parent ) { } public void dispose ( ) { } protected IPreferenceStore doGetPreferenceStore ( ) { } protected void fillEditorTable ( ) { editorTable . removeAll ( ) ; FileEditorMapping resourceType = getSelectedResourceType ( ) ; if ( resourceType != null ) { IEditorDescriptor [ ] array = resourceType . getEditors ( ) ; for ( int i = 0 ; i < ( array . length ) ; i ++ ) { IEditorDescriptor editor = array [ i ] ; TableItem item = new TableItem ( editorTable , SWT . NULL ) ; item . setData ( FileEditorsPreferencePage . DATA_EDITOR , editor ) ; String defaultString = null ; FileEditorMapping ext = getSelectedResourceType ( ) ; if ( ext != null ) { IEditorDescriptor preferredEditor = ext . getDefaultEditor ( ) ; if ( preferredEditor == editor ) defaultString = WorkbenchMessages . FileEditorPreference_defaultLabel ; } if ( defaultString != null ) { item . setText ( ( ( ( editor . getLabel ( ) ) + "<seq2seq4repair_space>" ) + defaultString ) ) ; } else { item . setText ( editor . getLabel ( ) ) ; } item . setImage ( getImage ( editor ) ) ; } EditorRegistry registry = ( ( EditorRegistry ) ( WorkbenchPlugin . getDefault ( ) . getEditorRegistry ( ) ) ) ; IContentType [ ] contentTypes = Platform . getContentTypeManager ( ) . findContentTypesFor ( resourceType . getLabel ( ) ) ; for ( int i = 0 ; i < ( contentTypes . length ) ; i ++ ) { array = registry . getEditorsForContentType ( contentTypes [ i ] ) ; for ( int j = 0 ; j < ( array . length ) ; j ++ ) { <START_BUG> IEditorDescriptor editor = array [ i ] ; <END_BUG> TableItem [ ] items = editorTable . getItems ( ) ; TableItem foundItem = null ; for ( int k = 0 ; k < ( items . length ) ; k ++ ) { if ( items [ k ] . getData ( FileEditorsPreferencePage . DATA_EDITOR ) . equals ( editor ) ) { foundItem = items [ k ] ; break ; } } if ( foundItem == null ) { TableItem item = new TableItem ( editorTable , SWT . NULL ) ; item . setData ( FileEditorsPreferencePage . DATA_EDITOR , editor ) ; item . setData ( FileEditorsPreferencePage . DATA_FROM_CONTENT_TYPE , Boolean . TRUE ) ; item . setText ( ( ( ( editor . getLabel ( ) ) + "<seq2seq4repair_space>" ) + ( WorkbenchMessages . FileEditorPreference_isLocked ) ) ) ; item . setImage ( getImage ( editor ) ) ; } else { foundItem . setData ( FileEditorsPreferencePage . DATA_FROM_CONTENT_TYPE , Boolean . TRUE ) ; foundItem . setText ( ( ( ( foundItem . getText ( ) ) + "<seq2seq4repair_space>" ) + ( WorkbenchMessages . FileEditorPreference_isLocked ) ) ) ; } } } } } protected void fillResourceTypeTable ( ) { } protected Image getImage ( IEditorDescriptor editor ) { } protected FileEditorMapping getSelectedResourceType ( ) { } protected IEditorDescriptor [ ] getAssociatedEditors ( ) { } public void handleEvent ( Event event ) { } public void init ( IWorkbench aWorkbench ) { } protected TableItem newResourceTableItem ( IFileEditorMapping mapping , int index , boolean selected ) { } public boolean performOk ( ) { } public void promptForEditor ( ) { } public void promptForResourceType ( ) { } public void removeSelectedEditor ( ) { } public void removeSelectedResourceType ( ) { } public void setSelectedEditorAsDefault ( ) { } public void updateEnabledState ( ) { } private boolean isEditorRemovable ( ) { } private boolean isEditorRemovable ( TableItem item ) { } public void updateSelectedResourceType ( ) { } }

Fix:
IEditorDescriptor editor = array [ j ] ;