Buggy code:
public class ResourceListSelectionDialog extends SelectionDialog { Text pattern ; Table resourceNames ; Table folderNames ; String patternString ; IContainer container ; int typeMask ; static Collator collator = Collator . getInstance ( ) ; boolean gatherResourcesDynamically = true ; StringMatcher stringMatcher ; ResourceListSelectionDialog . UpdateFilterThread updateFilterThread ; ResourceListSelectionDialog . UpdateGatherThread updateGatherThread ; ResourceListSelectionDialog . ResourceDescriptor [ ] descriptors ; int descriptorsSize ; WorkbenchLabelProvider labelProvider = new WorkbenchLabelProvider ( ) ; static class ResourceDescriptor implements Comparable { String label ; ArrayList resources = new ArrayList ( ) ; boolean resourcesSorted = true ; public int compareTo ( Object o ) { } } class UpdateFilterThread extends Thread { boolean stop = false ; int firstMatch = 0 ; int lastMatch = ( descriptorsSize ) - 1 ; public void run ( ) { } } class UpdateGatherThread extends Thread { boolean stop = false ; int lastMatch = - 1 ; int firstMatch = 0 ; boolean refilter = false ; public void run ( ) { } } public ResourceListSelectionDialog ( Shell parentShell , IResource [ ] resources ) { } public ResourceListSelectionDialog ( Shell parentShell , IContainer container , int typeMask ) { } protected String adjustPattern ( ) { } protected void cancelPressed ( ) { } public boolean close ( ) { } public void create ( ) { } protected Control createDialogArea ( Composite parent ) { Composite dialogArea = ( ( Composite ) ( super . createDialogArea ( parent ) ) ) ; Label l = new Label ( dialogArea , SWT . NONE ) ; l . setText ( WorkbenchMessages . getString ( "ResourceSelectionDialog.label" ) ) ; GridData data = new GridData ( GridData . FILL_HORIZONTAL ) ; l . setLayoutData ( data ) ; l = new Label ( dialogArea , SWT . NONE ) ; l . setText ( WorkbenchMessages . getString ( "ResourceSelectionDialog.pattern" ) ) ; data = new GridData ( GridData . FILL_HORIZONTAL ) ; l . setLayoutData ( data ) ; pattern = new Text ( dialogArea , ( ( SWT . SINGLE ) | ( SWT . BORDER ) ) ) ; pattern . setLayoutData ( new GridData ( GridData . FILL_HORIZONTAL ) ) ; l = new Label ( dialogArea , SWT . NONE ) ; l . setText ( WorkbenchMessages . getString ( "ResourceSelectionDialog.matching" ) ) ; data = new GridData ( GridData . FILL_HORIZONTAL ) ; l . setLayoutData ( data ) ; resourceNames = new Table ( dialogArea , ( ( ( SWT . SINGLE ) | ( SWT . BORDER ) ) | ( SWT . V_SCROLL ) ) ) ; data = new GridData ( GridData . FILL_BOTH ) ; data . heightHint = 12 * ( resourceNames . getItemHeight ( ) ) ; resourceNames . setLayoutData ( data ) ; l = new Label ( dialogArea , SWT . NONE ) ; l . setText ( WorkbenchMessages . getString ( "ResourceSelectionDialog.folders" ) ) ; data = new GridData ( GridData . FILL_HORIZONTAL ) ; l . setLayoutData ( data ) ; folderNames = new Table ( dialogArea , ( ( ( ( SWT . SINGLE ) | ( SWT . BORDER ) ) | ( SWT . V_SCROLL ) ) | ( SWT . H_SCROLL ) ) ) ; data = new GridData ( GridData . FILL_BOTH ) ; data . widthHint = 300 ; data . heightHint = 4 * ( folderNames . getItemHeight ( ) ) ; folderNames . setLayoutData ( data ) ; if ( gatherResourcesDynamically ) { updateGatherThread = new ResourceListSelectionDialog . UpdateGatherThread ( ) ; } else { updateFilterThread = new ResourceListSelectionDialog . UpdateFilterThread ( ) ; } pattern . addKeyListener ( new KeyAdapter ( ) { <START_BUG> public void keyPressed ( KeyEvent e ) { <END_BUG> if ( ( e . keyCode ) == ( SWT . ARROW_DOWN ) ) resourceNames . setFocus ( ) ; else textChanged ( ) ; } } ) ; resourceNames . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { updateFolders ( ( ( ResourceListSelectionDialog . ResourceDescriptor ) ( e . item . getData ( ) ) ) ) ; } public void widgetDefaultSelected ( SelectionEvent e ) { okPressed ( ) ; } } ) ; folderNames . addSelectionListener ( new SelectionAdapter ( ) { public void widgetDefaultSelected ( SelectionEvent e ) { okPressed ( ) ; } } ) ; applyDialogFont ( dialogArea ) ; return dialogArea ; } private void filterResources ( ) { } private int getFirstMatch ( ) { } private void gatherResources ( ) { } private Image getImage ( ResourceListSelectionDialog . ResourceDescriptor desc ) { } private int getLastMatch ( ) { } private void getMatchingResources ( final ArrayList resources ) { } private Image getParentImage ( IResource resource ) { } private String getParentLabel ( IResource resource ) { } private void initDescriptors ( final IResource [ ] resources ) { } private boolean match ( String label ) { } protected void okPressed ( ) { } protected boolean select ( IResource resource ) { } private void textChanged ( ) { } private void updateFolders ( final ResourceListSelectionDialog . ResourceDescriptor desc ) { } private void updateItem ( int index , int itemPos , int itemCount ) { } }

Fix:
public void keyReleased ( KeyEvent e ) {