Program: 102972
Project: 102972
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 (!contactListContainer.isFocused())   return false;
  int id=e.getID();
  if (id != KeyEvent.KEY_PRESSED && id != KeyEvent.KEY_TYPED)   return false;
  SingleWindowContainer singleWindowContainer=GuiActivator.getUIService().getSingleWindowContainer();
  if ((singleWindowContainer != null) && singleWindowContainer.containsFocusOwner())   return false;
  Component focusOwner=keyManager.getFocusOwner();
  if (focusOwner != null && !searchField.isFocusOwner() && focusOwner instanceof JTextComponent)   return false;
  if (contactListContainer.isMenuSelected())   return false;
  int keyCode=e.getKeyCode();
  if (keyCode == KeyEvent.VK_ENTER && (e.isControlDown() || e.isMetaDown())) {
    contactListContainer.ctrlEnterKeyTyped();
    return false;
  }
 else   if (keyCode == KeyEvent.VK_ENTER && focusOwner.equals(keyManager.getPermanentFocusOwner())) {
    contactListContainer.enterKeyTyped();
    return false;
  }
  if (searchField.isFocusOwner() && (keyCode == KeyEvent.VK_UP || keyCode == KeyEvent.VK_DOWN || keyCode == KeyEvent.VK_PAGE_UP || keyCode == KeyEvent.VK_PAGE_DOWN)) {
    contactList.selectFirstContact();
    contactList.getComponent().requestFocus();
    return false;
  }
  if (contactList.getComponent().isFocusOwner() && keyCode == KeyEvent.VK_ESCAPE) {
    contactList.removeSelection();
    if (searchField.getText() != null)     searchField.requestFocus();
    return false;
  }
  char keyChar=e.getKeyChar();
  UIGroup selectedGroup=contactList.getSelectedGroup();
  if (keyChar == KeyEvent.CHAR_UNDEFINED || keyCode == KeyEvent.VK_ENTER || keyCode == KeyEvent.VK_DELETE || keyCode == KeyEvent.VK_BACK_SPACE || keyCode == KeyEvent.VK_TAB || e.getKeyChar() == '\t' || keyCode == KeyEvent.VK_SPACE || (selectedGroup != null && (keyChar == '+' || keyChar == '-'))) {
    return false;
  }
  boolean singleWindowRule=singleWindowContainer == null || contactList.getComponent().isFocusOwner();
  if (!searchField.isFocusOwner() && focusOwner != null && singleWindowRule && focusOwner.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 (!contactListContainer.isFocused())   return false;
  int id=e.getID();
  if (id != KeyEvent.KEY_PRESSED && id != KeyEvent.KEY_TYPED)   return false;
  SingleWindowContainer singleWindowContainer=GuiActivator.getUIService().getSingleWindowContainer();
  if ((singleWindowContainer != null) && singleWindowContainer.containsFocusOwner())   return false;
  Component focusOwner=keyManager.getFocusOwner();
  if (focusOwner != null && !searchField.isFocusOwner() && focusOwner instanceof JTextComponent)   return false;
  if (contactListContainer.isMenuSelected())   return false;
  int keyCode=e.getKeyCode();
  if (keyCode == KeyEvent.VK_ENTER && (e.isControlDown() || e.isMetaDown())) {
    contactListContainer.ctrlEnterKeyTyped();
    return false;
  }
 else   if (keyCode == KeyEvent.VK_ENTER && focusOwner.equals(keyManager.getPermanentFocusOwner())) {
    contactListContainer.enterKeyTyped();
    return false;
  }
  if (searchField.isFocusOwner() && (keyCode == KeyEvent.VK_UP || keyCode == KeyEvent.VK_DOWN || keyCode == KeyEvent.VK_PAGE_UP || keyCode == KeyEvent.VK_PAGE_DOWN)) {
    contactList.selectFirstContact();
    if (contactList instanceof TreeContactList) {
      ((TreeContactList)contactList).setAutoSectionAllowed(false);
    }
    contactList.getComponent().requestFocus();
    return false;
  }
  if (contactList.getComponent().isFocusOwner() && keyCode == KeyEvent.VK_ESCAPE) {
    contactList.removeSelection();
    if (contactList instanceof TreeContactList) {
      ((TreeContactList)contactList).setAutoSectionAllowed(false);
    }
    if (searchField.getText() != null)     searchField.requestFocus();
    return false;
  }
  char keyChar=e.getKeyChar();
  UIGroup selectedGroup=contactList.getSelectedGroup();
  if (keyChar == KeyEvent.CHAR_UNDEFINED || keyCode == KeyEvent.VK_ENTER || keyCode == KeyEvent.VK_DELETE || keyCode == KeyEvent.VK_BACK_SPACE || keyCode == KeyEvent.VK_TAB || e.getKeyChar() == '\t' || keyCode == KeyEvent.VK_SPACE || (selectedGroup != null && (keyChar == '+' || keyChar == '-'))) {
    return false;
  }
  boolean singleWindowRule=singleWindowContainer == null || contactList.getComponent().isFocusOwner();
  if (!searchField.isFocusOwner() && focusOwner != null && singleWindowRule && focusOwner.equals(keyManager.getPermanentFocusOwner())) {
    searchField.requestFocusInWindow();
    keyManager.redispatchEvent(searchField,e);
    return true;
  }
  return false;
}