Buggy code:
public void inputChanged ( Viewer viewer , Object oldInput , Object newInput ) { } public Object [ ] getElements ( Object inputElement ) { } private Object [ ] createSpecs ( String [ ] userextfileSpecs , String [ ] usernamefileSpecs , String [ ] preextfileSpecs , String [ ] prenamefileSpecs ) { } } private class ContentTypesLabelProvider extends LabelProvider { public String getText ( Object element ) { } } private class ContentTypesContentProvider implements ITreeContentProvider { private IContentTypeManager manager ; public Object [ ] getChildren ( Object parentElement ) { } public Object getParent ( Object element ) { } public boolean hasChildren ( Object element ) { } public Object [ ] getElements ( Object inputElement ) { } public void dispose ( ) { } public void inputChanged ( Viewer viewer , Object oldInput , Object newInput ) { } } protected Control createContents ( Composite parent ) { } private void createCharset ( final Composite parent ) { } private void createFileAssociations ( final Composite composite ) { { Label label = new Label ( composite , SWT . NONE ) ; label . setFont ( composite . getFont ( ) ) ; label . setText ( ContentTypes_fileAssociationsLabel ) ; GridData data = new GridData ( ) ; data . horizontalSpan = 2 ; label . setLayoutData ( data ) ; } { fileAssociationViewer = new ListViewer ( composite ) ; fileAssociationViewer . setComparator ( new ContentTypesPreferencePage . FileSpecComparator ( ) ) ; fileAssociationViewer . getControl ( ) . setFont ( composite . getFont ( ) ) ; fileAssociationViewer . setContentProvider ( new ContentTypesPreferencePage . FileSpecContentProvider ( ) ) ; fileAssociationViewer . setLabelProvider ( new ContentTypesPreferencePage . FileSpecLabelProvider ( ) ) ; GridData data = new GridData ( GridData . FILL_BOTH ) ; data . horizontalSpan = 1 ; fileAssociationViewer . getControl ( ) . setLayoutData ( data ) ; fileAssociationViewer . addSelectionChangedListener ( new ISelectionChangedListener ( ) { public void selectionChanged ( SelectionChangedEvent event ) { IStructuredSelection selection = ( ( IStructuredSelection ) ( event . getSelection ( ) ) ) ; if ( selection . isEmpty ( ) ) { removeButton . setEnabled ( false ) ; return ; } boolean enabled = true ; List elements = selection . toList ( ) ; for ( Iterator i = elements . iterator ( ) ; i . hasNext ( ) ; ) { ContentTypesPreferencePage . Spec spec = ( ( ContentTypesPreferencePage . Spec ) ( i . next ( ) ) ) ; if ( spec . isPredefined ) { enabled = false ; } } removeButton . setEnabled ( enabled ) ; } } ) ; } { Composite buttonArea = new Composite ( composite , SWT . NONE ) ; GridLayout layout = new GridLayout ( 1 , false ) ; layout . marginHeight = layout . marginWidth = 0 ; buttonArea . setLayout ( layout ) ; GridData data = new GridData ( GridData . VERTICAL_ALIGN_BEGINNING ) ; buttonArea . setLayoutData ( data ) ; addButton = new Button ( buttonArea , SWT . PUSH ) ; addButton . setFont ( composite . getFont ( ) ) ; setButtonLayoutData ( addButton ) ; addButton . setText ( ContentTypes_fileAssociationsAddLabel ) ; addButton . setEnabled ( false ) ; addButton . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { Shell shell = composite . getShell ( ) ; IContentType selectedContentType = getSelectedContentType ( ) ; FileExtensionDialog dialog = new FileExtensionDialog ( shell ) ; if ( ( dialog . open ( ) ) == ( Window . OK ) ) { String name = dialog . getName ( ) ; String extension = dialog . getExtension ( ) ; try { if ( name . equals ( "*" ) ) { selectedContentType . addFileSpec ( extension , IContentType . FILE_EXTENSION_SPEC ) ; } else { selectedContentType . addFileSpec ( ( name + ( ( extension . length ( ) ) > 0 ? '.' + extension : "" ) ) , IContentType . FILE_NAME_SPEC ) ; } } catch ( CoreException ex ) { ErrorDialog . openError ( shell , null , null , ex . getStatus ( ) ) ; <START_BUG> WorkbenchPlugin . log ( ex . getStatus ( ) ) ; <END_BUG> } finally { fileAssociationViewer . setInput ( selectedContentType ) ; } } } } ) ; removeButton = new Button ( buttonArea , SWT . PUSH ) ; removeButton . setFont ( composite . getFont ( ) ) ; setButtonLayoutData ( removeButton ) ; removeButton . setEnabled ( false ) ; removeButton . setText ( ContentTypes_fileAssociationsRemoveLabel ) ; removeButton . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent event ) { IContentType contentType = getSelectedContentType ( ) ; ContentTypesPreferencePage . Spec [ ] specs = getSelectedSpecs ( ) ; MultiStatus result = new MultiStatus ( PlatformUI . PLUGIN_ID , 0 , new IStatus [ 0 ] , WorkbenchMessages . ContentTypes_errorDialogMessage , null ) ; for ( int i = 0 ; i < ( specs . length ) ; i ++ ) { ContentTypesPreferencePage . Spec spec = specs [ i ] ; try { if ( ( spec . name ) != null ) { contentType . removeFileSpec ( spec . name , IContentType . FILE_NAME_SPEC ) ; } else if ( ( spec . ext ) != null ) { contentType . removeFileSpec ( spec . ext , IContentType . FILE_EXTENSION_SPEC ) ; } } catch ( CoreException e ) { result . add ( e . getStatus ( ) ) ; } } if ( ! ( result . isOK ( ) ) ) { ErrorDialog . openError ( composite . getShell ( ) , null , null , result ) ; } fileAssociationViewer . setInput ( contentType ) ; } } ) ; } } protected ContentTypesPreferencePage . Spec [ ] getSelectedSpecs ( ) { }

Fix:
WorkbenchPlugin . log ( ex ) ;