Program: 103422
Project: 103422
Buggy source:
/** 
 * When the right mouse button is clicked on a contact cell, the cell is selected and the <tt>ContactRightButtonMenu</tt> is opened. When the right mouse button is clicked on a group cell, the cell is selected and the <tt>GroupRightButtonMenu</tt> is opened. When the middle mouse button is clicked on a cell, the cell is selected.
 * @param e the <tt>MouseEvent</tt> that notified us of the press
 */
public void mousePressed(MouseEvent e){
  if (!isGroupClickConsumed) {
    for (    MouseListener listener : originalMouseListeners)     listener.mousePressed(e);
  }
  TreePath path=this.getPathForLocation(e.getX(),e.getY());
  if (path == null)   return;
  Object lastComponent=path.getLastPathComponent();
  if (!(lastComponent instanceof TreeNode))   return;
  if (!path.equals(getSelectionPath()) && (e.getModifiers() & InputEvent.BUTTON2_MASK) != 0 || (e.getModifiers() & InputEvent.BUTTON3_MASK) != 0 || (e.isControlDown() && !e.isMetaDown())) {
    this.setSelectionPath(path);
  }
  if (lastComponent instanceof ContactNode) {
    UIContact uiContact=((ContactNode)lastComponent).getContactDescriptor();
    if ((e.getModifiers() & InputEvent.BUTTON3_MASK) != 0 || (e.isControlDown() && !e.isMetaDown())) {
      rightButtonMenu=uiContact.getRightButtonMenu();
      openRightButtonMenu(e.getPoint());
    }
  }
 else   if (lastComponent instanceof GroupNode) {
    UIGroup uiGroup=((GroupNode)lastComponent).getGroupDescriptor();
    if ((e.getModifiers() & InputEvent.BUTTON3_MASK) != 0 || (e.isControlDown() && !e.isMetaDown())) {
      rightButtonMenu=uiGroup.getRightButtonMenu();
      openRightButtonMenu(e.getPoint());
    }
  }
  dispatchEventToButtons(e);
}

Fixed version (ground truth):
/** 
 * When the right mouse button is clicked on a contact cell, the cell is selected and the <tt>ContactRightButtonMenu</tt> is opened. When the right mouse button is clicked on a group cell, the cell is selected and the <tt>GroupRightButtonMenu</tt> is opened. When the middle mouse button is clicked on a cell, the cell is selected.
 * @param e the <tt>MouseEvent</tt> that notified us of the press
 */
public void mousePressed(MouseEvent e){
  if (!isGroupClickConsumed) {
    for (    MouseListener listener : originalMouseListeners)     listener.mousePressed(e);
  }
  TreePath path=this.getPathForLocation(e.getX(),e.getY());
  if (path == null)   return;
  Object lastComponent=path.getLastPathComponent();
  if (!(lastComponent instanceof TreeNode))   return;
  boolean isSelected=path.equals(getSelectionPath());
  if (!isSelected && (e.getModifiers() & InputEvent.BUTTON2_MASK) != 0 || (e.getModifiers() & InputEvent.BUTTON3_MASK) != 0 || (e.isControlDown() && !e.isMetaDown())) {
    this.setSelectionPath(path);
  }
  if (lastComponent instanceof ContactNode) {
    UIContact uiContact=((ContactNode)lastComponent).getContactDescriptor();
    if ((e.getModifiers() & InputEvent.BUTTON3_MASK) != 0 || (e.isControlDown() && !e.isMetaDown())) {
      rightButtonMenu=uiContact.getRightButtonMenu();
      openRightButtonMenu(e.getPoint());
    }
  }
 else   if (lastComponent instanceof GroupNode) {
    UIGroup uiGroup=((GroupNode)lastComponent).getGroupDescriptor();
    if ((e.getModifiers() & InputEvent.BUTTON3_MASK) != 0 || (e.isControlDown() && !e.isMetaDown())) {
      rightButtonMenu=uiGroup.getRightButtonMenu();
      openRightButtonMenu(e.getPoint());
    }
  }
  if (isSelected && e.getClickCount() < 2)   dispatchEventToButtons(e);
}