Program: 15917
Project: 15917
Buggy source:
public void renderTabpanel(Tabpanel item,final Object data,final int index) throws Exception {
  final Tabbox tabbox=item.getTabbox();
  final Tabpanels tabpanels=tabbox.getTabpanels();
  final int size=tabbox.getModel().getSize();
  final String tmn="String_Node_Str";
  final Template tm=resolveTemplate(tabbox,item,data,index,size,tmn,"String_Node_Str");
  if (tm == null) {
    item.appendChild(new Label(Objects.toString(data)));
  }
 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(){
        return size;
      }
    }
;
    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=tabpanels.getAttribute(varnm);
    Object oldIter=tabpanels.getAttribute(itervarnm);
    tabpanels.setAttribute(varnm,data);
    tabpanels.setAttribute(itervarnm,iterStatus);
    final Component[] items=tm.create(tabpanels,item,null,null);
    tabpanels.setAttribute(varnm,oldVar);
    tabpanels.setAttribute(itervarnm,oldIter);
    if (items.length != 1)     throw new UiException("String_Node_Str" + items.length);
    final Tabpanel ntabpanel=(Tabpanel)items[0];
    ntabpanel.setAttribute(BinderCtrl.VAR,varnm);
    ntabpanel.setAttribute(AbstractRenderer.IS_TEMPLATE_MODEL_ENABLED_ATTR,true);
    ntabpanel.setAttribute(AbstractRenderer.CURRENT_INDEX_RESOLVER_ATTR,new IndirectBinding(){
      public Binder getBinder(){
        return BinderUtil.getBinder(ntabpanel,true);
      }
      @SuppressWarnings("String_Node_Str") public void setValue(      BindELContext ctx,      Object value){
        int idx=ntabpanel.getIndex() / items.length;
        ListModel<?> listmodel=tabbox.getModel();
        if (idx >= 0 && idx < listmodel.getSize()) {
          if (listmodel instanceof ListModelArray) {
            ((ListModelArray<Object>)listmodel).set(idx,value);
          }
 else           if (listmodel instanceof ListModelList<?>) {
            ((ListModelList<Object>)listmodel).set(idx,value);
          }
        }
 else {
        }
      }
      public Component getComponent(){
        return ntabpanel;
      }
      public Object getValue(      BindELContext ctx){
        return tabbox.getModel().getElementAt(ntabpanel.getIndex() / items.length);
      }
    }
);
    addItemReference(tabbox,ntabpanel,index,varnm);
    ntabpanel.setAttribute(itervarnm,iterStatus);
    ntabpanel.setAttribute(TemplateResolver.TEMPLATE_OBJECT,item.removeAttribute(TemplateResolver.TEMPLATE_OBJECT));
    addTemplateTracking(tabpanels,ntabpanel,data,index,size);
    item.setAttribute(Attributes.MODEL_RENDERAS,ntabpanel);
    item.detach();
  }
}

Fixed version (ground truth):
public void renderTabpanel(Tabpanel item,final Object data,final int index) throws Exception {
  final Tabbox tabbox=item.getTabbox();
  final Tabpanels tabpanels=tabbox.getTabpanels();
  final int size=tabbox.getModel().getSize();
  final String tmn="String_Node_Str";
  final Template tm=resolveTemplate(tabbox,item,data,index,size,tmn,"String_Node_Str");
  if (tm == null) {
    item.appendChild(new Label(Objects.toString(data)));
  }
 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(){
        return size;
      }
    }
;
    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=tabpanels.getAttribute(varnm);
    Object oldIter=tabpanels.getAttribute(itervarnm);
    tabpanels.setAttribute(varnm,data);
    tabpanels.setAttribute(itervarnm,iterStatus);
    final Component[] items=tm.create(tabpanels,item,null,null);
    tabpanels.setAttribute(varnm,oldVar);
    tabpanels.setAttribute(itervarnm,oldIter);
    if (items.length != 1)     throw new UiException("String_Node_Str" + items.length);
    final Tabpanel ntabpanel=(Tabpanel)items[0];
    ntabpanel.setAttribute(BinderCtrl.VAR,varnm);
    recordRenderedIndex(tabpanels,items.length);
    ntabpanel.setAttribute(AbstractRenderer.IS_TEMPLATE_MODEL_ENABLED_ATTR,true);
    ntabpanel.setAttribute(AbstractRenderer.CURRENT_INDEX_RESOLVER_ATTR,new IndirectBinding(){
      public Binder getBinder(){
        return BinderUtil.getBinder(ntabpanel,true);
      }
      @SuppressWarnings("String_Node_Str") public void setValue(      BindELContext ctx,      Object value){
        int idx=BindTabboxRenderer.this.getRenderedIndex(tabpanels,ntabpanel.getIndex());
        ListModel<?> listmodel=tabbox.getModel();
        if (idx >= 0 && idx < listmodel.getSize()) {
          if (listmodel instanceof ListModelArray) {
            ((ListModelArray<Object>)listmodel).set(idx,value);
          }
 else           if (listmodel instanceof ListModelList<?>) {
            ((ListModelList<Object>)listmodel).set(idx,value);
          }
        }
 else {
        }
      }
      public Component getComponent(){
        return ntabpanel;
      }
      public Object getValue(      BindELContext ctx){
        return tabbox.getModel().getElementAt(BindTabboxRenderer.this.getRenderedIndex(tabpanels,ntabpanel.getIndex()));
      }
    }
);
    addItemReference(tabbox,ntabpanel,index,varnm);
    ntabpanel.setAttribute(itervarnm,iterStatus);
    ntabpanel.setAttribute(TemplateResolver.TEMPLATE_OBJECT,item.removeAttribute(TemplateResolver.TEMPLATE_OBJECT));
    addTemplateTracking(tabpanels,ntabpanel,data,index,size);
    item.setAttribute(Attributes.MODEL_RENDERAS,ntabpanel);
    item.detach();
  }
}