Program: 143547
Project: 143547
Buggy source:
private void setUpItem(final ListItem<IRecordInternal> listItem,boolean createComponents){
  if (!createComponents) {
    List<IBehavior> allBehaviors=listItem.getBehaviors();
    for (int i=0; i < allBehaviors.size(); i++) {
      listItem.remove(allBehaviors.get(i));
    }
  }
  final IRecordInternal rec=listItem.getModelObject();
  boolean selected=isRecordSelected(rec);
  Object color=null, fgColor=null, styleFont=null, styleBorder=null;
  if (!isListViewMode()) {
    color=WebCellBasedView.this.getListItemBgColor(listItem,selected,false);
    if (color instanceof Undefined)     color=null;
    fgColor=WebCellBasedView.this.getListItemFgColor(listItem,selected,false);
    if (fgColor instanceof Undefined)     fgColor=null;
    styleFont=WebCellBasedView.this.getListItemFont(listItem,selected);
    if (styleFont instanceof Undefined)     styleFont=null;
    styleBorder=WebCellBasedView.this.getListItemBorder(listItem,selected);
  }
  if (color == null && fgColor == null && styleFont == null && styleBorder == null) {
    listItem.add(new AttributeModifier("String_Node_Str",new Model<String>((listItem.getIndex() % 2) == 0 ? "String_Node_Str" : "String_Node_Str")));
  }
  final int visibleRowIndex=listItem.getIndex() % getRowsPerPage();
  final WebMarkupContainer listItemContainer=listItem instanceof WebCellBasedViewListItem ? ((WebCellBasedViewListItem)listItem).getListContainer() : listItem;
  if (createComponents) {
    final Object compColor=color;
    final Object compFgColor=fgColor;
    final Object compFont=styleFont;
    final Object compBorder=styleBorder;
    createComponents(application,form,listCellview,dataProviderLookup,el,listStartY,listEndY,new ItemAdd(){
      public void add(      IPersist element,      final Component comp){
        Component listItemChild=comp;
        if (!isListViewMode()) {
          Component component=elementToColumnIdentifierComponent.values().iterator().next();
          if (component instanceof IComponent && comp instanceof IScriptableProvider) {
            IScriptable so=((IScriptableProvider)comp).getScriptObject();
            if (so instanceof IRuntimeComponent) {
              IRuntimeComponent ic=(IRuntimeComponent)so;
              ic.setSize(ic.getWidth(),((IComponent)component).getSize().height);
              ic.setLocation(ic.getLocationX(),visibleRowIndex * ic.getHeight());
            }
          }
          if (element instanceof ISupportName) {
            String elementName=((ISupportName)element).getName();
            if ((elementName != null) && (elementName.trim().length() > 0) || WebCellBasedView.this.addHeaders) {
              listItemChild=new CellContainer(comp);
              listItemChild.setOutputMarkupPlaceholderTag(true);
              ((MarkupContainer)listItemChild).add(comp);
            }
          }
        }
 else {
          if (!(cellview instanceof Portal) && useAnchors && (((element instanceof Field) && WebAnchoringHelper.needsWrapperDivForAnchoring((Field)element)) || (element instanceof Bean) || ((element instanceof GraphicalComponent) && ComponentFactory.isButton((GraphicalComponent)element)))) {
            listItemChild=WebAnchoringHelper.getWrapperComponent(comp,(IFormElement)element,listStartY,formBodySize,isLeftToRightOrientation,isListViewMode());
          }
        }
        updateRuntimeComponentStyleAttributes(comp);
        cellToElement.put(comp,element);
        listItemContainer.add(listItemChild);
        setUpComponent(comp,rec,compColor,compFgColor,compFont,compBorder,visibleRowIndex);
      }
    }
);
  }
 else {
    Iterator<? extends Component> children=listItemContainer.iterator();
    while (children.hasNext()) {
      Component child=CellContainer.getContentsForCell(children.next());
      initializeComponent(child,listCellview,cellToElement.get(child));
      updateRuntimeComponentStyleAttributes(child);
      setUpComponent(child,rec,color,fgColor,styleFont,styleBorder,visibleRowIndex);
    }
  }
  enableChildrenInContainer(this,isEnabled());
}

Fixed version (ground truth):
private void setUpItem(final ListItem<IRecordInternal> listItem,boolean createComponents){
  if (!createComponents) {
    List<IBehavior> allBehaviors=listItem.getBehaviors();
    for (int i=0; i < allBehaviors.size(); i++) {
      listItem.remove(allBehaviors.get(i));
    }
  }
  final IRecordInternal rec=listItem.getModelObject();
  boolean selected=isRecordSelected(rec);
  Object color=null, fgColor=null, styleFont=null, styleBorder=null;
  if (!isListViewMode()) {
    color=WebCellBasedView.this.getListItemBgColor(listItem,selected,false);
    if (color instanceof Undefined)     color=null;
    fgColor=WebCellBasedView.this.getListItemFgColor(listItem,selected,false);
    if (fgColor instanceof Undefined)     fgColor=null;
    styleFont=WebCellBasedView.this.getListItemFont(listItem,selected);
    if (styleFont instanceof Undefined)     styleFont=null;
    styleBorder=WebCellBasedView.this.getListItemBorder(listItem,selected);
  }
  if (color == null && fgColor == null && styleFont == null && styleBorder == null) {
    listItem.add(new AttributeModifier("String_Node_Str",new Model<String>((listItem.getIndex() % 2) == 0 ? "String_Node_Str" : "String_Node_Str")));
  }
  final int visibleRowIndex=listItem.getIndex() % getRowsPerPage();
  final WebMarkupContainer listItemContainer=listItem instanceof WebCellBasedViewListItem ? ((WebCellBasedViewListItem)listItem).getListContainer() : listItem;
  if (createComponents) {
    final Object compColor=color;
    final Object compFgColor=fgColor;
    final Object compFont=styleFont;
    final Object listItemBorder=styleBorder;
    createComponents(application,form,listCellview,dataProviderLookup,el,listStartY,listEndY,new ItemAdd(){
      public void add(      IPersist element,      final Component comp){
        Component listItemChild=comp;
        if (!isListViewMode()) {
          Component component=elementToColumnIdentifierComponent.values().iterator().next();
          if (component instanceof IComponent && comp instanceof IScriptableProvider) {
            IScriptable so=((IScriptableProvider)comp).getScriptObject();
            if (so instanceof IRuntimeComponent) {
              IRuntimeComponent ic=(IRuntimeComponent)so;
              ic.setSize(ic.getWidth(),((IComponent)component).getSize().height);
              ic.setLocation(ic.getLocationX(),visibleRowIndex * ic.getHeight());
            }
          }
          if (element instanceof ISupportName) {
            String elementName=((ISupportName)element).getName();
            if ((elementName != null) && (elementName.trim().length() > 0) || WebCellBasedView.this.addHeaders) {
              listItemChild=new CellContainer(comp);
              listItemChild.setOutputMarkupPlaceholderTag(true);
              ((MarkupContainer)listItemChild).add(comp);
            }
          }
        }
 else {
          if (!(cellview instanceof Portal) && useAnchors && (((element instanceof Field) && WebAnchoringHelper.needsWrapperDivForAnchoring((Field)element)) || (element instanceof Bean) || ((element instanceof GraphicalComponent) && ComponentFactory.isButton((GraphicalComponent)element)))) {
            listItemChild=WebAnchoringHelper.getWrapperComponent(comp,(IFormElement)element,listStartY,formBodySize,isLeftToRightOrientation,isListViewMode());
          }
        }
        updateRuntimeComponentStyleAttributes(comp);
        cellToElement.put(comp,element);
        listItemContainer.add(listItemChild);
        setUpComponent(comp,rec,compColor,compFgColor,compFont,listItemBorder,visibleRowIndex);
      }
    }
);
  }
 else {
    Iterator<? extends Component> children=listItemContainer.iterator();
    while (children.hasNext()) {
      Component child=CellContainer.getContentsForCell(children.next());
      initializeComponent(child,listCellview,cellToElement.get(child));
      updateRuntimeComponentStyleAttributes(child);
      setUpComponent(child,rec,color,fgColor,styleFont,styleBorder,visibleRowIndex);
    }
  }
  enableChildrenInContainer(this,isEnabled());
}