Program: 103055
Project: 103055
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;
  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 (isRightButtonMenuEnabled) {
    if (lastComponent instanceof ContactNode) {
      UIContact uiContact=((ContactNode)lastComponent).getContactDescriptor();
      if (((e.getModifiers() & InputEvent.BUTTON3_MASK) != 0 || (e.isControlDown() && !e.isMetaDown())) && !(((SourceContact)uiContact.getDescriptor()).getContactDetails(OperationSetMultiUserChat.class) != null)) {
        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);
}

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 (isRightButtonMenuEnabled) {
    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);
}