Program: 53941
Project: 53941
Buggy source:
/** 
 * Set the open state of a tree node.
 * @param cellList the CellList that changed state.
 * @param value the value to open
 * @param open true to open, false to close
 * @param fireEvents true to fireEvents
 * @return the open {@link TreeNode}, or null if not opened
 */
private <C>TreeNode setChildState(BrowserCellList<C> cellList,C value,boolean open,boolean fireEvents,boolean redraw){
  Object newKey=cellList.getValueKey(value);
  if (open) {
    if (newKey == null) {
      return null;
    }
 else     if (newKey.equals(cellList.focusedKey)) {
      return cellList.isFocusedOpen ? treeNodes.get(cellList.level + 1) : null;
    }
    if (cellList.focusedKey != null) {
      setChildState(cellList,cellList.focusedValue,false,fireEvents,false);
    }
    cellList.focusedValue=value;
    cellList.focusedKey=cellList.getValueKey(value);
    NodeInfo<?> childNodeInfo=isLeaf(value) ? null : getNodeInfo(value);
    if (childNodeInfo != null) {
      cellList.isFocusedOpen=true;
      appendTreeNode(childNodeInfo,value);
    }
 else {
      cellList.isFocusedOpen=false;
    }
    if (redraw) {
      treeNodes.get(cellList.level).display.redraw();
    }
    if (cellList.isFocusedOpen) {
      TreeNodeImpl<?> node=treeNodes.get(cellList.level + 1);
      if (fireEvents) {
        OpenEvent.fire(this,node);
      }
      return node.isDestroyed() ? null : node;
    }
    return null;
  }
 else {
    if (cellList.focusedKey == null || !cellList.focusedKey.equals(newKey)) {
      return null;
    }
    TreeNode closedNode=cellList.isFocusedOpen ? treeNodes.get(cellList.level + 1) : null;
    trimToLevel(cellList.level);
    cellList.focusedKey=null;
    cellList.focusedValue=null;
    cellList.isFocusedOpen=false;
    if (redraw) {
      treeNodes.get(cellList.level).display.redraw();
    }
    if (fireEvents && closedNode != null) {
      CloseEvent.fire(this,closedNode);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Set the open state of a tree node.
 * @param cellList the CellList that changed state.
 * @param value the value to open
 * @param open true to open, false to close
 * @param fireEvents true to fireEvents
 * @return the open {@link TreeNode}, or null if not opened
 */
private <C>TreeNode setChildState(BrowserCellList<C> cellList,C value,boolean open,boolean fireEvents,boolean redraw){
  Object newKey=cellList.getValueKey(value);
  if (open) {
    if (newKey == null) {
      return null;
    }
 else     if (newKey.equals(cellList.focusedKey)) {
      return cellList.isFocusedOpen ? treeNodes.get(cellList.level + 1) : null;
    }
    if (cellList.focusedKey != null) {
      setChildState(cellList,cellList.focusedValue,false,fireEvents,false);
    }
    cellList.focusedValue=value;
    cellList.focusedKey=cellList.getValueKey(value);
    NodeInfo<?> childNodeInfo=isLeaf(value) ? null : getNodeInfo(value);
    if (childNodeInfo != null) {
      cellList.isFocusedOpen=true;
      appendTreeNode(childNodeInfo,value);
    }
 else {
      cellList.isFocusedOpen=false;
    }
    if (redraw) {
      treeNodes.get(cellList.level).display.redraw();
    }
    if (cellList.isFocusedOpen) {
      TreeNodeImpl<?> node=treeNodes.get(cellList.level + 1);
      if (fireEvents) {
        OpenEvent.fire(this,node);
      }
      return node.isDestroyed() ? null : node;
    }
    return null;
  }
 else {
    if (cellList.focusedKey == null || !cellList.focusedKey.equals(newKey)) {
      return null;
    }
    TreeNode closedNode=(cellList.isFocusedOpen && (treeNodes.size() > cellList.level + 1)) ? treeNodes.get(cellList.level + 1) : null;
    trimToLevel(cellList.level);
    if (redraw) {
      treeNodes.get(cellList.level).display.redraw();
    }
    if (fireEvents && closedNode != null) {
      CloseEvent.fire(this,closedNode);
    }
  }
  return null;
}