Buggy code:
public class PlatformUIPreferenceListener implements IEclipsePreferences . IPreferenceChangeListener { private static PlatformUIPreferenceListener singleton ; public static IEclipsePreferences . IPreferenceChangeListener getSingleton ( ) { } public void preferenceChange ( IEclipsePreferences . PreferenceChangeEvent event ) { String propertyName = event . getKey ( ) ; if ( ENABLED_DECORATORS . equals ( propertyName ) ) { DecoratorManager manager = WorkbenchPlugin . getDefault ( ) . getDecoratorManager ( ) ; manager . applyDecoratorsPreference ( ) ; manager . clearCaches ( ) ; manager . updateForEnablementChange ( ) ; return ; } if ( SHOW_SYSTEM_JOBS . equals ( propertyName ) ) { boolean setting = PrefUtil . getAPIPreferenceStore ( ) . getBoolean ( SHOW_SYSTEM_JOBS ) ; ProgressManager . getInstance ( ) . setShowSystemJobs ( setting ) ; } if ( DEFAULT_PERSPECTIVE_ID . equals ( propertyName ) ) { IWorkbench workbench = PlatformUI . getWorkbench ( ) ; workbench . getPerspectiveRegistry ( ) . setDefaultPerspective ( PrefUtil . getAPIPreferenceStore ( ) . getString ( DEFAULT_PERSPECTIVE_ID ) ) ; return ; } if ( DOCK_PERSPECTIVE_BAR . equals ( propertyName ) ) { IPreferenceStore apiStore = PrefUtil . getAPIPreferenceStore ( ) ; IWorkbench workbench = PlatformUI . getWorkbench ( ) ; IWorkbenchWindow [ ] workbenchWindows = workbench . getWorkbenchWindows ( ) ; for ( int i = 0 ; i < ( workbenchWindows . length ) ; i ++ ) { IWorkbenchWindow window = workbenchWindows [ i ] ; if ( window instanceof WorkbenchWindow ) { ( ( WorkbenchWindow ) ( window ) ) . setPerspectiveBarLocation ( apiStore . getString ( DOCK_PERSPECTIVE_BAR ) ) ; } } return ; } if ( SHOW_TRADITIONAL_STYLE_TABS . equals ( propertyName ) ) { boolean newValue = PrefUtil . getAPIPreferenceStore ( ) . getBoolean ( SHOW_TRADITIONAL_STYLE_TABS ) ; IWorkbench workbench = PlatformUI . getWorkbench ( ) ; IWorkbenchWindow [ ] workbenchWindows = workbench . getWorkbenchWindows ( ) ; for ( int i = 0 ; i < ( workbenchWindows . length ) ; i ++ ) { IWorkbenchWindow window = workbenchWindows [ i ] ; if ( window instanceof WorkbenchWindow ) { ( ( WorkbenchWindow ) ( window ) ) . setBannerCurve ( newValue ) ; } } return ; } if ( RESOURCES . equals ( propertyName ) ) { IEditorRegistry registry = WorkbenchPlugin . getDefault ( ) . getEditorRegistry ( ) ; if ( registry instanceof EditorRegistry ) { EditorRegistry editorRegistry = ( ( EditorRegistry ) ( registry ) ) ; IPreferenceStore store = WorkbenchPlugin . getDefault ( ) . getPreferenceStore ( ) ; Reader reader = null ; try { String xmlString = store . getString ( RESOURCES ) ; if ( ( xmlString != null ) && ( ( xmlString . length ( ) ) > 0 ) ) { reader = new StringReader ( xmlString ) ; HashMap editorMap = new HashMap ( ) ; int i = 0 ; IEditorDescriptor [ ] descriptors = editorRegistry . getSortedEditorsFromPlugins ( ) ; for ( i = 0 ; i < ( descriptors . length ) ; i ++ ) { IEditorDescriptor descriptor = descriptors [ i ] ; editorMap . put ( descriptor . getId ( ) , descriptor ) ; } descriptors = editorRegistry . getSortedEditorsFromOS ( ) ; for ( i = 0 ; i < ( descriptors . length ) ; i ++ ) { IEditorDescriptor descriptor = descriptors [ i ] ; editorMap . put ( descriptor . getId ( ) , descriptor ) ; } IFileEditorMapping [ ] maps = editorRegistry . getFileEditorMappings ( ) ; for ( int j = 0 ; j < ( maps . length ) ; j ++ ) { IFileEditorMapping fileEditorMapping = maps [ j ] ; IEditorDescriptor descriptor = fileEditorMapping . getDefaultEditor ( ) ; <START_BUG> if ( ! ( editorMap . containsKey ( descriptor . getId ( ) ) ) ) { <END_BUG> editorMap . put ( descriptor . getId ( ) , descriptor ) ; } } editorRegistry . readResources ( editorMap , reader ) ; } } catch ( WorkbenchException e ) { e . printStackTrace ( ) ; } finally { if ( reader != null ) { try { reader . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } } } } } }

Fix:
if ( ( descriptor != null ) && ( ! ( editorMap . containsKey ( descriptor . getId ( ) ) ) ) ) {