Program: 15990
Project: 15990
Buggy source:
public void render(final Component owner,final Object data,final int index,final int size,final boolean isListModel){
  final Template tm=resolveTemplate(owner,owner,data,index,size,"String_Node_Str");
  if (tm == null) {
    Label l=new Label(data == null ? "String_Node_Str" : data.toString());
    l.setParent(owner);
    return;
  }
  final ForEachStatus iterStatus=new ChildrenBindingForEachStatus(index,data,size);
  final String var=(String)tm.getParameters().get("String_Node_Str");
  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=owner.getAttribute(varnm);
  Object oldIter=owner.getAttribute(itervarnm);
  owner.setAttribute(varnm,data);
  owner.setAttribute(itervarnm,iterStatus);
  final Component[] items=ShadowElementsCtrl.filterOutShadows(tm.create(owner,null,null,null));
  final ForEachStatus bindChildIterStatus=new AbstractForEachStatus(){
    private static final long serialVersionUID=1L;
    public int getIndex(){
      return index;
    }
    public Object getCurrent(){
      return data;
    }
    public Integer getEnd(){
      return size;
    }
    public Integer getCurrentIndex(    Component comp){
      return comp.getParent().getChildren().indexOf(comp) / items.length;
    }
  }
;
  owner.setAttribute(varnm,oldVar);
  owner.setAttribute(itervarnm,oldIter);
  boolean templateTracked=false;
  if (isListModel) {
    List<Component[]> cbrCompsList=(List<Component[]>)owner.getAttribute(BinderCtrl.CHILDREN_BINDING_RENDERED_COMPONENTS);
    if (cbrCompsList == null)     cbrCompsList=new LinkedList<Component[]>();
    cbrCompsList.add(items);
    owner.setAttribute(BinderCtrl.CHILDREN_BINDING_RENDERED_COMPONENTS,cbrCompsList);
  }
  for (  Component comp : items) {
    comp.setAttribute(BinderImpl.VAR,varnm);
    comp.setAttribute(AbstractRenderer.IS_TEMPLATE_MODEL_ENABLED_ATTR,true);
    comp.setAttribute(AbstractRenderer.CURRENT_INDEX_RESOLVER_ATTR,bindChildIterStatus);
    addItemReference(owner,comp,index,varnm);
    comp.setAttribute(itervarnm,iterStatus);
    if (!templateTracked) {
      comp.setAttribute(TemplateResolver.TEMPLATE_OBJECT,owner.removeAttribute(TemplateResolver.TEMPLATE_OBJECT));
      addTemplateTracking(owner,comp,data,index,size);
      templateTracked=true;
    }
    Events.sendEvent(new Event(BinderImpl.ON_BIND_INIT,comp));
  }
}

Fixed version (ground truth):
public void render(final Component owner,final Object data,final int index,final int size,final boolean isListModel){
  final Template tm=resolveTemplate(owner,owner,data,index,size,"String_Node_Str");
  if (tm == null) {
    Label l=new Label(data == null ? "String_Node_Str" : data.toString());
    l.setParent(owner);
    return;
  }
  final ForEachStatus iterStatus=new ChildrenBindingForEachStatus(index,data,size);
  final String var=(String)tm.getParameters().get("String_Node_Str");
  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=owner.getAttribute(varnm);
  Object oldIter=owner.getAttribute(itervarnm);
  owner.setAttribute(varnm,data);
  owner.setAttribute(itervarnm,iterStatus);
  Component insertBefore=null;
  List<Component[]> cbrCompsList=(List<Component[]>)owner.getAttribute(BinderCtrl.CHILDREN_BINDING_RENDERED_COMPONENTS);
  if (cbrCompsList != null) {
    int newIndex=0;
    int steps=0;
    for (    Component[] cmps : cbrCompsList) {
      if (steps++ >= index)       break;
      newIndex+=cmps.length;
    }
    if (owner.getChildren().size() > newIndex) {
      insertBefore=owner.getChildren().get(newIndex);
    }
  }
  final Component[] items=ShadowElementsCtrl.filterOutShadows(tm.create(owner,insertBefore,null,null));
  final ForEachStatus bindChildIterStatus=new AbstractForEachStatus(){
    private static final long serialVersionUID=1L;
    public int getIndex(){
      return index;
    }
    public Object getCurrent(){
      return data;
    }
    public Integer getEnd(){
      return size;
    }
    public int getCurrentIndex(    Component comp,    int index){
      int result=-1;
      if (comp instanceof Listitem) {
        result=((Listitem)comp).getIndex();
      }
 else       if (comp instanceof Row) {
        result=((Row)comp).getIndex();
      }
 else       if (comp instanceof Treeitem) {
        result=((Treeitem)comp).getIndex();
      }
 else       result=comp.getParent().getChildren().indexOf(comp);
      result=result / items.length;
      return result;
    }
  }
;
  owner.setAttribute(varnm,oldVar);
  owner.setAttribute(itervarnm,oldIter);
  boolean templateTracked=false;
  if (isListModel) {
    cbrCompsList=(List<Component[]>)owner.getAttribute(BinderCtrl.CHILDREN_BINDING_RENDERED_COMPONENTS);
    if (cbrCompsList == null)     cbrCompsList=new LinkedList<Component[]>();
    cbrCompsList.add(items);
    owner.setAttribute(BinderCtrl.CHILDREN_BINDING_RENDERED_COMPONENTS,cbrCompsList);
  }
  for (  Component comp : items) {
    comp.setAttribute(BinderImpl.VAR,varnm);
    comp.setAttribute(AbstractRenderer.IS_TEMPLATE_MODEL_ENABLED_ATTR,true);
    comp.setAttribute(AbstractRenderer.CURRENT_INDEX_RESOLVER_ATTR,bindChildIterStatus);
    addItemReference(owner,comp,index,varnm);
    comp.setAttribute(itervarnm,iterStatus);
    if (!templateTracked) {
      comp.setAttribute(TemplateResolver.TEMPLATE_OBJECT,owner.removeAttribute(TemplateResolver.TEMPLATE_OBJECT));
      addTemplateTracking(owner,comp,data,index,size);
      templateTracked=true;
    }
    Events.sendEvent(new Event(BinderImpl.ON_BIND_INIT,comp));
  }
}