Program: 53775
Project: 53775
Buggy source:
/** 
 * Reload the open children after rendering new items in this node.
 * @param values the values being replaced
 * @param start the start index
 * @param savedViews the open nodes
 */
private void loadChildState(List<C> values,int start,Map<Object,CellTreeNodeView<?>> savedViews){
  int len=values.size();
  int end=start + len;
  int childCount=nodeView.getChildCount();
  ProvidesKey<C> keyProvider=nodeInfo.getProvidesKey();
  Element container=nodeView.ensureChildContainer();
  Element childElem=container.getChild(start).cast();
  CellTreeNodeView<?> keyboardSelected=nodeView.tree.getKeyboardSelectedNode();
  for (int i=start; i < end; i++) {
    C childValue=values.get(i - start);
    CellTreeNodeView<C> child=nodeView.createTreeNodeView(nodeInfo,childElem,childValue,null);
    CellTreeNodeView<?> savedChild=savedViews.remove(keyProvider.getKey(childValue));
    if (savedChild != null) {
      child.animationFrame=savedChild.animationFrame;
      child.contentContainer=savedChild.contentContainer;
      child.childContainer=savedChild.childContainer;
      child.children=savedChild.children;
      child.emptyMessageElem=savedChild.emptyMessageElem;
      child.nodeInfo=savedChild.nodeInfo;
      child.nodeInfoLoaded=savedChild.nodeInfoLoaded;
      child.open=savedChild.open;
      child.showMoreElem=savedChild.showMoreElem;
      child.treeNode=savedChild.treeNode;
      if (child.treeNode != null) {
        child.treeNode.nodeView=child;
      }
      child.listView=savedChild.listView;
      if (child.listView != null) {
        child.listView.nodeView=child;
      }
      if (child.children != null) {
        for (        CellTreeNodeView<?> grandchild : child.children) {
          grandchild.parentNode=child;
        }
      }
      if (keyboardSelected == savedChild) {
        keyboardSelected=child;
      }
      child.getElement().appendChild(savedChild.ensureAnimationFrame());
      savedChild.isDestroyed=true;
    }
    if (childCount > i) {
      nodeView.children.set(i,child);
    }
 else {
      nodeView.children.add(child);
    }
    childElem=childElem.getNextSiblingElement();
  }
  CellTreeNodeView<?> curNode=keyboardSelected;
  while (curNode != null) {
    if (curNode == nodeView) {
      nodeView.tree.keyboardSelect(keyboardSelected,false);
      break;
    }
    curNode=curNode.parentNode;
  }
}

Fixed version (ground truth):
/** 
 * Reload the open children after rendering new items in this node.
 * @param values the values being replaced
 * @param start the start index
 * @param savedViews the open nodes
 */
private void loadChildState(List<C> values,int start,Map<Object,CellTreeNodeView<?>> savedViews){
  int len=values.size();
  int end=start + len;
  int childCount=nodeView.getChildCount();
  ProvidesKey<C> keyProvider=nodeInfo.getProvidesKey();
  Element container=nodeView.ensureChildContainer();
  Element childElem=(values.size() == 0) ? null : Element.as(container.getChild(start));
  CellTreeNodeView<?> keyboardSelected=nodeView.tree.getKeyboardSelectedNode();
  for (int i=start; i < end; i++) {
    C childValue=values.get(i - start);
    CellTreeNodeView<C> child=nodeView.createTreeNodeView(nodeInfo,childElem,childValue,null);
    CellTreeNodeView<?> savedChild=savedViews.remove(keyProvider.getKey(childValue));
    if (savedChild != null) {
      child.animationFrame=savedChild.animationFrame;
      child.contentContainer=savedChild.contentContainer;
      child.childContainer=savedChild.childContainer;
      child.children=savedChild.children;
      child.emptyMessageElem=savedChild.emptyMessageElem;
      child.nodeInfo=savedChild.nodeInfo;
      child.nodeInfoLoaded=savedChild.nodeInfoLoaded;
      child.open=savedChild.open;
      child.showMoreElem=savedChild.showMoreElem;
      child.treeNode=savedChild.treeNode;
      if (child.treeNode != null) {
        child.treeNode.nodeView=child;
      }
      child.listView=savedChild.listView;
      if (child.listView != null) {
        child.listView.nodeView=child;
      }
      if (child.children != null) {
        for (        CellTreeNodeView<?> grandchild : child.children) {
          grandchild.parentNode=child;
        }
      }
      if (keyboardSelected == savedChild) {
        keyboardSelected=child;
      }
      child.getElement().appendChild(savedChild.ensureAnimationFrame());
      savedChild.isDestroyed=true;
    }
    if (childCount > i) {
      nodeView.children.set(i,child);
    }
 else {
      nodeView.children.add(child);
    }
    childElem=childElem.getNextSiblingElement();
  }
  CellTreeNodeView<?> curNode=keyboardSelected;
  while (curNode != null) {
    if (curNode == nodeView) {
      nodeView.tree.keyboardSelect(keyboardSelected,false);
      break;
    }
    curNode=curNode.parentNode;
  }
}