Buggy code:
public class EditorSelectionDialog extends Dialog implements Listener { private EditorDescriptor selectedEditor ; private Button externalButton ; private Table editorTable ; private Button browseExternalEditorsButton ; private Button internalButton ; private Button okButton ; private Button cancelButton ; private static final String EditorSelectionDialog = "FileSystemExportPage1.CreateDirectoriesForSelectedContainers" ; private static final String STORE_ID_INTERNAL_EXTERNAL = "EditorSelectionDialog.STORE_ID_INTERNAL_EXTERNAL" ; private String message = WorkbenchMessages . getString ( "EditorSelection.chooseAnEditor" ) ; private IEditorDescriptor [ ] externalEditors ; private IEditorDescriptor [ ] internalEditors ; private Image [ ] externalEditorImages ; private Image [ ] internalEditorImages ; private IEditorDescriptor [ ] editorsToFilter ; private static final String [ ] Executable_Filters ; private static final int TABLE_WIDTH = 200 ; public EditorSelectionDialog ( Shell parentShell ) { } protected void buttonPressed ( int buttonId ) { } public boolean close ( ) { } protected void configureShell ( Shell shell ) { } protected Control createDialogArea ( Composite parent ) { } protected void fillEditorTable ( ) { } protected IDialogSettings getDialogSettings ( ) { } protected IEditorDescriptor [ ] getExternalEditors ( ) { } protected IEditorDescriptor [ ] filterEditors ( IEditorDescriptor [ ] editors ) { } protected Image [ ] getImages ( IEditorDescriptor [ ] editors ) { } protected IEditorDescriptor [ ] getInternalEditors ( ) { } public IEditorDescriptor getSelectedEditor ( ) { } public void handleEvent ( Event event ) { } protected void promptForExternalEditor ( ) { <START_BUG> FileDialog dialog = new FileDialog ( getShell ( ) ) ; <END_BUG> dialog . setFilterExtensions ( org . eclipse . ui . internal . dialogs . EditorSelectionDialog . Executable_Filters ) ; String result = dialog . open ( ) ; if ( result != null ) { EditorDescriptor editor = new EditorDescriptor ( ) ; editor . setFileName ( result ) ; editor . setID ( result ) ; int start = result . lastIndexOf ( File . separator ) ; String name ; if ( start != ( - 1 ) ) { name = result . substring ( ( start + 1 ) ) ; } else { name = result ; } int end = name . lastIndexOf ( '.' ) ; if ( end != ( - 1 ) ) { name = name . substring ( 0 , end ) ; } editor . setName ( name ) ; ImageDescriptor imageDescriptor = new ProgramImageDescriptor ( result , 0 ) ; editor . setImageDescriptor ( imageDescriptor ) ; TableItem ti = new TableItem ( editorTable , SWT . NULL ) ; ti . setData ( editor ) ; ti . setText ( editor . getLabel ( ) ) ; Image image = editor . getImageDescriptor ( ) . createImage ( ) ; ti . setImage ( image ) ; editorTable . setSelection ( new TableItem [ ] { ti } ) ; editorTable . showSelection ( ) ; editorTable . setFocus ( ) ; selectedEditor = editor ; IEditorDescriptor [ ] newEditors = new IEditorDescriptor [ ( externalEditors . length ) + 1 ] ; System . arraycopy ( externalEditors , 0 , newEditors , 0 , externalEditors . length ) ; newEditors [ ( ( newEditors . length ) - 1 ) ] = editor ; externalEditors = newEditors ; Image [ ] newImages = new Image [ ( externalEditorImages . length ) + 1 ] ; System . arraycopy ( externalEditorImages , 0 , newImages , 0 , externalEditorImages . length ) ; newImages [ ( ( newImages . length ) - 1 ) ] = image ; externalEditorImages = newImages ; } } protected void handleDoubleClickEvent ( ) { } protected void restoreWidgetValues ( ) { } protected void saveWidgetValues ( ) { } public void setMessage ( String aMessage ) { } public void setEditorsToFilter ( IEditorDescriptor [ ] editors ) { } public void updateEnableState ( ) { } protected void createButtonsForButtonBar ( Composite parent ) { } protected void updateOkButton ( ) { } }

Fix:
FileDialog dialog = new FileDialog ( getShell ( ) , ( ( SWT . OPEN ) | ( SWT . PRIMARY_MODAL ) ) ) ;