Program: 15896
Project: 15896
Buggy source:
public void render(final Treeitem item,final Object data,final int index) throws Exception {
  final Tree tree=item.getTree();
  final Component parent=item.getParent();
  final Template tm=resolveTemplate(tree,parent,data,index,-1,"String_Node_Str");
  if (tm == null) {
    Treecell tc=new Treecell(Objects.toString(data));
    Treerow tr=null;
    item.setValue(data);
    if (item.getTreerow() == null) {
      tr=new Treerow();
      tr.setParent(item);
    }
 else {
      tr=item.getTreerow();
      tr.getChildren().clear();
    }
    tc.setParent(tr);
  }
 else {
    final ForEachStatus iterStatus=new AbstractForEachStatus(){
      private static final long serialVersionUID=1L;
      public int getIndex(){
        return index;
      }
      public Object getCurrent(){
        return data;
      }
      public Integer getEnd(){
        throw new UiException("String_Node_Str");
      }
    }
;
    final String var=(String)tm.getParameters().get(EACH_ATTR);
    final String varnm=var == null ? EACH_VAR : var;
    final String itervar=(String)tm.getParameters().get(STATUS_ATTR);
    final String itervarnm=itervar == null ? (var == null ? EACH_STATUS_VAR : varnm + STATUS_POST_VAR) : itervar;
    Object oldVar=parent.getAttribute(varnm);
    Object oldIter=parent.getAttribute(itervarnm);
    parent.setAttribute(varnm,data);
    parent.setAttribute(itervarnm,iterStatus);
    final Component[] items=filterOutShadows(parent,tm.create(parent,item,null,null));
    parent.setAttribute(varnm,oldVar);
    parent.setAttribute(itervarnm,oldIter);
    if (items.length != 1)     throw new UiException("String_Node_Str" + items.length);
    final Treeitem ti=(Treeitem)items[0];
    ti.setAttribute(BinderImpl.VAR,varnm);
    ti.setAttribute(varnm,data);
    ti.setAttribute(itervarnm,iterStatus);
    ti.setAttribute(TemplateResolver.TEMPLATE_OBJECT,parent.removeAttribute(TemplateResolver.TEMPLATE_OBJECT));
    addTemplateTracking(tree,ti,data,index,-1);
    if (ti.getValue() == null)     ti.setValue(data);
    item.setAttribute(Attributes.MODEL_RENDERAS,ti);
    item.detach();
  }
}

Fixed version (ground truth):
public void render(final Treeitem item,final Object data,final int index) throws Exception {
  final Tree tree=item.getTree();
  final Component parent=item.getParent();
  final Template tm=resolveTemplate(tree,parent,data,index,-1,"String_Node_Str");
  if (tm == null) {
    Treecell tc=new Treecell(Objects.toString(data));
    Treerow tr=null;
    item.setValue(data);
    if (item.getTreerow() == null) {
      tr=new Treerow();
      tr.setParent(item);
    }
 else {
      tr=item.getTreerow();
      tr.getChildren().clear();
    }
    tc.setParent(tr);
  }
 else {
    final ForEachStatus iterStatus=new AbstractForEachStatus(){
      private static final long serialVersionUID=1L;
      public int getIndex(){
        return index;
      }
      public Object getCurrent(){
        return data;
      }
      public Integer getEnd(){
        throw new UiException("String_Node_Str");
      }
    }
;
    final String var=(String)tm.getParameters().get(EACH_ATTR);
    final String varnm=var == null ? EACH_VAR : var;
    final String itervar=(String)tm.getParameters().get(STATUS_ATTR);
    final String itervarnm=itervar == null ? (var == null ? EACH_STATUS_VAR : varnm + STATUS_POST_VAR) : itervar;
    Object oldVar=parent.getAttribute(varnm);
    Object oldIter=parent.getAttribute(itervarnm);
    parent.setAttribute(varnm,data);
    parent.setAttribute(itervarnm,iterStatus);
    final Component[] items=filterOutShadows(parent,tm.create(parent,item,null,null));
    if (oldVar == null) {
      parent.removeAttribute(varnm);
    }
 else {
      parent.setAttribute(varnm,oldVar);
    }
    if (oldIter == null) {
      parent.removeAttribute(itervarnm);
    }
 else {
      parent.setAttribute(itervarnm,oldIter);
    }
    if (items.length != 1)     throw new UiException("String_Node_Str" + items.length);
    final Treeitem ti=(Treeitem)items[0];
    ti.setAttribute(BinderImpl.VAR,varnm);
    ti.setAttribute(varnm,data);
    ti.setAttribute(itervarnm,iterStatus);
    ti.setAttribute(TemplateResolver.TEMPLATE_OBJECT,parent.removeAttribute(TemplateResolver.TEMPLATE_OBJECT));
    addTemplateTracking(tree,ti,data,index,-1);
    if (ti.getValue() == null)     ti.setValue(data);
    item.setAttribute(Attributes.MODEL_RENDERAS,ti);
    item.detach();
  }
}