Program: 103692
Project: 103692
Buggy source:
/** 
 * Dispatches the given <tt>KeyEvent</tt>.
 * @param e the <tt>KeyEvent</tt> to dispatch
 * @return <tt>true</tt> if the KeyboardFocusManager should take nofurther action with regard to the KeyEvent; <tt>false</tt> otherwise
 */
public boolean dispatchKeyEvent(KeyEvent e){
  if (!isFocused() || (e.getID() != KeyEvent.KEY_PRESSED && e.getID() != KeyEvent.KEY_TYPED))   return false;
  TreeContactList contactList=getContactListPanel().getContactList();
  if (searchField.isFocusOwner() && (e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_DOWN || e.getKeyCode() == KeyEvent.VK_PAGE_UP || e.getKeyCode() == KeyEvent.VK_PAGE_DOWN)) {
    contactList.selectFirstContact();
    contactList.requestFocus();
    return false;
  }
  if (contactList.isFocusOwner() && e.getKeyCode() == KeyEvent.VK_ESCAPE) {
    contactList.removeSelectionRows(contactList.getSelectionRows());
    if (searchField.getText() != null) {
      searchField.requestFocus();
    }
    return false;
  }
  TreePath selectionPath=contactList.getSelectionPath();
  if (e.getKeyChar() == KeyEvent.CHAR_UNDEFINED || e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode() == KeyEvent.VK_DELETE || e.getKeyCode() == KeyEvent.VK_BACK_SPACE || e.getKeyCode() == KeyEvent.VK_TAB || e.getKeyCode() == KeyEvent.VK_SPACE || (selectionPath != null && selectionPath.getLastPathComponent() instanceof GroupNode && (e.getKeyChar() == '+' || e.getKeyChar() == '-'))) {
    return false;
  }
  if (!searchField.isFocusOwner() && keyManager.getFocusOwner().equals(keyManager.getPermanentFocusOwner())) {
    searchField.requestFocusInWindow();
    keyManager.redispatchEvent(searchField,e);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Dispatches the given <tt>KeyEvent</tt>.
 * @param e the <tt>KeyEvent</tt> to dispatch
 * @return <tt>true</tt> if the KeyboardFocusManager should take nofurther action with regard to the KeyEvent; <tt>false</tt> otherwise
 */
public boolean dispatchKeyEvent(KeyEvent e){
  if (!isFocused() || (e.getID() != KeyEvent.KEY_PRESSED && e.getID() != KeyEvent.KEY_TYPED))   return false;
  if (e.getKeyCode() == KeyEvent.VK_ENTER && (e.isControlDown() || e.isMetaDown())) {
    ctrlEnterKeyTyped();
    return false;
  }
 else   if (e.getKeyCode() == KeyEvent.VK_ENTER && keyManager.getFocusOwner().equals(keyManager.getPermanentFocusOwner())) {
    enterKeyTyped();
    return false;
  }
  TreeContactList contactList=getContactListPanel().getContactList();
  if (searchField.isFocusOwner() && (e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_DOWN || e.getKeyCode() == KeyEvent.VK_PAGE_UP || e.getKeyCode() == KeyEvent.VK_PAGE_DOWN)) {
    contactList.selectFirstContact();
    contactList.requestFocus();
    return false;
  }
  if (contactList.isFocusOwner() && e.getKeyCode() == KeyEvent.VK_ESCAPE) {
    contactList.removeSelectionRows(contactList.getSelectionRows());
    if (searchField.getText() != null) {
      searchField.requestFocus();
    }
    return false;
  }
  TreePath selectionPath=contactList.getSelectionPath();
  if (e.getKeyChar() == KeyEvent.CHAR_UNDEFINED || e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode() == KeyEvent.VK_DELETE || e.getKeyCode() == KeyEvent.VK_BACK_SPACE || e.getKeyCode() == KeyEvent.VK_TAB || e.getKeyCode() == KeyEvent.VK_SPACE || (selectionPath != null && selectionPath.getLastPathComponent() instanceof GroupNode && (e.getKeyChar() == '+' || e.getKeyChar() == '-'))) {
    return false;
  }
  if (!searchField.isFocusOwner() && keyManager.getFocusOwner().equals(keyManager.getPermanentFocusOwner())) {
    searchField.requestFocusInWindow();
    keyManager.redispatchEvent(searchField,e);
    return true;
  }
  return false;
}