Buggy code:
public final class EditorSelectionDialog extends Dialog { private EditorDescriptor selectedEditor ; private Button externalButton ; private Table editorTable ; private Button browseExternalEditorsButton ; private Button internalButton ; private Button okButton ; private static final String STORE_ID_INTERNAL_EXTERNAL = "EditorSelectionDialog.STORE_ID_INTERNAL_EXTERNAL" ; private String message = WorkbenchMessages . EditorSelection_chooseAnEditor ; private IEditorDescriptor [ ] externalEditors ; private IEditorDescriptor [ ] internalEditors ; private Image [ ] externalEditorImages ; private Image [ ] internalEditorImages ; private IEditorDescriptor [ ] editorsToFilter ; private EditorSelectionDialog . DialogListener listener = new EditorSelectionDialog . DialogListener ( ) ; 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 ( ) { } protected void promptForExternalEditor ( ) { <START_BUG> FileDialog dialog = new FileDialog ( getShell ( ) , ( ( SWT . OPEN ) | ( SWT . PRIMARY_MODAL ) ) ) ; <END_BUG> dialog . setFilterExtensions ( EditorSelectionDialog . Executable_Filters ) ; String result = dialog . open ( ) ; if ( result != null ) { EditorDescriptor editor = EditorDescriptor . createForProgram ( result ) ; 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 ) { } protected void updateEnableState ( ) { } protected void createButtonsForButtonBar ( Composite parent ) { } protected void updateOkButton ( ) { } private class DialogListener implements Listener { public void handleEvent ( Event event ) { } } protected boolean isResizable ( ) { } }

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