Program: 143542
Project: 143542
Buggy source:
public String getRowSelectionScript(boolean allCurrentPageRows){
  if (currentData == null)   return null;
  List<Integer> indexToUpdate;
  if (!hasOnRender() && (bgColorScript != null || (getRowSelectedStyle() != null && getRowSelectedStyle().getAttributeCount() > 0)) && (indexToUpdate=getIndexToUpdate(allCurrentPageRows)) != null) {
    int firstRow=table.isPageableMode() ? table.getCurrentPage() * table.getRowsPerPage() : table.getStartIndex();
    int lastRow=firstRow + table.getViewSize() - 1;
    int[] newSelectedIndexes=getSelectedIndexes();
    AppendingStringBuffer sab=new AppendingStringBuffer();
    for (    int rowIdx : indexToUpdate) {
      ArrayList<String> bgRuntimeColorjsArray=new ArrayList<String>();
      ArrayList<String> fgRuntimeColorjsArray=new ArrayList<String>();
      ArrayList<String> fstyleJsAray=new ArrayList<String>();
      ArrayList<String> fweightJsAray=new ArrayList<String>();
      ArrayList<String> fsizeJsAray=new ArrayList<String>();
      ArrayList<String> ffamilyJsAray=new ArrayList<String>();
      ArrayList<String> bstyleJsAray=new ArrayList<String>();
      ArrayList<String> bwidthJsAray=new ArrayList<String>();
      ArrayList<String> bcolorJsAray=new ArrayList<String>();
      if (rowIdx >= firstRow && rowIdx <= lastRow) {
        ListItem<IRecordInternal> selectedListItem=(ListItem<IRecordInternal>)table.get(Integer.toString(rowIdx));
        if (selectedListItem != null) {
          String selectedId=selectedListItem.getMarkupId();
          boolean isSelected=Arrays.binarySearch(newSelectedIndexes,rowIdx) >= 0;
          if (bgColorScript == null && !isSelected && (getRowOddStyle().getAttributeCount() == 0) && (getRowEvenStyle().getAttributeCount() == 0)) {
            Iterable<? extends Component> it=Utils.iterate(selectedListItem.iterator());
            for (            Component c : it) {
              if (c instanceof CellContainer) {
                CellContainer cell=(CellContainer)c;
                Component cellContents=cell.iterator().next();
                if (cellContents instanceof IScriptableProvider) {
                  IScriptable scriptableComponent=((IScriptableProvider)cellContents).getScriptObject();
                  if (scriptableComponent instanceof IRuntimeComponent) {
                    IRuntimeComponent runtimeComponent=(IRuntimeComponent)scriptableComponent;
                    bgRuntimeColorjsArray.add(runtimeComponentStyleAttributes.get(runtimeComponent).get(RenderableWrapper.PROPERTY_BGCOLOR));
                    fgRuntimeColorjsArray.add(runtimeComponentStyleAttributes.get(runtimeComponent).get(RenderableWrapper.PROPERTY_FGCOLOR));
                    String fontStyle=runtimeComponentStyleAttributes.get(runtimeComponent).get(RenderableWrapper.PROPERTY_FONT);
                    StringBuilder fstyle=new StringBuilder("String_Node_Str"), fweight=new StringBuilder("String_Node_Str"), fsize=new StringBuilder("String_Node_Str"), ffamily=new StringBuilder("String_Node_Str");
                    splitFontStyle(fontStyle,fstyle,fweight,fsize,ffamily);
                    fstyleJsAray.add(fstyle.toString());
                    fweightJsAray.add(fweight.toString());
                    fsizeJsAray.add(fsize.toString());
                    ffamilyJsAray.add(ffamily.toString());
                    String borderStyle=runtimeComponentStyleAttributes.get(runtimeComponent).get(RenderableWrapper.PROPERTY_BORDER);
                    StringBuilder bstyle=new StringBuilder("String_Node_Str"), bwidth=new StringBuilder("String_Node_Str"), bcolor=new StringBuilder("String_Node_Str");
                    splitBorderStyle(borderStyle,bstyle,bwidth,bcolor);
                    bstyleJsAray.add(bstyle.toString());
                    bwidthJsAray.add(bwidth.toString());
                    bcolorJsAray.add(bcolor.toString());
                  }
                }
              }
            }
          }
          Object selectedColor=null, selectedFgColor=null, selectedFont=null, selectedBorder=null;
          selectedColor=getListItemBgColor(selectedListItem,isSelected,true);
          if (!isListViewMode()) {
            selectedFgColor=getListItemFgColor(selectedListItem,isSelected,true);
            selectedFont=getListItemFont(selectedListItem,isSelected);
            selectedBorder=getListItemBorder(selectedListItem,isSelected);
          }
          selectedColor=(selectedColor == null ? "String_Node_Str" : selectedColor.toString());
          selectedFgColor=(selectedFgColor == null) ? "String_Node_Str" : selectedFgColor.toString();
          StringBuilder fstyle=new StringBuilder("String_Node_Str"), fweight=new StringBuilder("String_Node_Str"), fsize=new StringBuilder("String_Node_Str"), ffamily=new StringBuilder("String_Node_Str");
          splitFontStyle(selectedFont,fstyle,fweight,fsize,ffamily);
          StringBuilder bstyle=new StringBuilder("String_Node_Str"), bwidth=new StringBuilder("String_Node_Str"), bcolor=new StringBuilder("String_Node_Str");
          splitBorderStyle(selectedBorder,bstyle,bwidth,bcolor);
          if (bgColorScript == null && !isSelected && (getRowOddStyle().getAttributeCount() == 0) && (getRowEvenStyle().getAttributeCount() == 0) && !isListViewMode()) {
            sab.append("String_Node_Str").append(selectedId).append("String_Node_Str").append(toJsArrayString(bgRuntimeColorjsArray,"String_Node_Str")).append("String_Node_Str").append(toJsArrayString(fgRuntimeColorjsArray,"String_Node_Str")).append("String_Node_Str").append(toJsArrayString(fstyleJsAray,"String_Node_Str")).append("String_Node_Str").append(toJsArrayString(fweightJsAray,"String_Node_Str")).append("String_Node_Str").append(toJsArrayString(fsizeJsAray,"String_Node_Str")).append("String_Node_Str").append(toJsArrayString(ffamilyJsAray,"String_Node_Str")).append("String_Node_Str").append(toJsArrayString(bstyleJsAray,"String_Node_Str")).append("String_Node_Str").append(toJsArrayString(bwidthJsAray,"String_Node_Str")).append("String_Node_Str").append(toJsArrayString(bcolorJsAray,"String_Node_Str")).append("String_Node_Str").append(isListViewMode()).append("String_Node_Str");
          }
 else {
            sab.append("String_Node_Str").append(selectedId).append("String_Node_Str").append(selectedColor).append("String_Node_Str").append(selectedFgColor).append("String_Node_Str").append(fstyle).append("String_Node_Str").append(fweight).append("String_Node_Str").append(fsize).append("String_Node_Str").append(ffamily).append("String_Node_Str").append(bstyle).append("String_Node_Str").append(bwidth).append("String_Node_Str").append(bcolor).append("String_Node_Str").append(isListViewMode()).append("String_Node_Str");
          }
        }
      }
    }
    String rowSelectionScript=sab.toString();
    if (rowSelectionScript.length() > 0)     return rowSelectionScript;
  }
  return null;
}

Fixed version (ground truth):
public String getRowSelectionScript(boolean allCurrentPageRows){
  if (currentData == null)   return null;
  List<Integer> indexToUpdate;
  if (!hasOnRender() && (bgColorScript != null || (getRowSelectedStyle() != null && getRowSelectedStyle().getAttributeCount() > 0)) && (indexToUpdate=getIndexToUpdate(allCurrentPageRows)) != null) {
    int firstRow=table.isPageableMode() ? table.getCurrentPage() * table.getRowsPerPage() : table.getStartIndex();
    int lastRow=firstRow + table.getViewSize() - 1;
    int[] newSelectedIndexes=getSelectedIndexes();
    AppendingStringBuffer sab=new AppendingStringBuffer();
    for (    int rowIdx : indexToUpdate) {
      ArrayList<String> bgRuntimeColorjsArray=new ArrayList<String>();
      ArrayList<String> fgRuntimeColorjsArray=new ArrayList<String>();
      ArrayList<String> fstyleJsAray=new ArrayList<String>();
      ArrayList<String> fweightJsAray=new ArrayList<String>();
      ArrayList<String> fsizeJsAray=new ArrayList<String>();
      ArrayList<String> ffamilyJsAray=new ArrayList<String>();
      ArrayList<String> bstyleJsAray=new ArrayList<String>();
      ArrayList<String> bwidthJsAray=new ArrayList<String>();
      ArrayList<String> bcolorJsAray=new ArrayList<String>();
      if (rowIdx >= firstRow && rowIdx <= lastRow) {
        ListItem<IRecordInternal> selectedListItem=(ListItem<IRecordInternal>)table.get(Integer.toString(rowIdx));
        if (selectedListItem != null) {
          String selectedId=selectedListItem.getMarkupId();
          boolean isSelected=Arrays.binarySearch(newSelectedIndexes,rowIdx) >= 0;
          if (bgColorScript == null && !isSelected && (getRowOddStyle().getAttributeCount() == 0) && (getRowEvenStyle().getAttributeCount() == 0)) {
            Iterable<? extends Component> it=Utils.iterate(selectedListItem.iterator());
            for (            Component c : it) {
              if (c instanceof CellContainer) {
                CellContainer cell=(CellContainer)c;
                Component cellContents=cell.iterator().next();
                if (cellContents instanceof IScriptableProvider) {
                  IScriptable scriptableComponent=((IScriptableProvider)cellContents).getScriptObject();
                  if (scriptableComponent instanceof IRuntimeComponent) {
                    IRuntimeComponent runtimeComponent=(IRuntimeComponent)scriptableComponent;
                    bgRuntimeColorjsArray.add(runtimeComponentStyleAttributes.get(runtimeComponent).get(RenderableWrapper.PROPERTY_BGCOLOR));
                    fgRuntimeColorjsArray.add(runtimeComponentStyleAttributes.get(runtimeComponent).get(RenderableWrapper.PROPERTY_FGCOLOR));
                    String fontStyle=runtimeComponentStyleAttributes.get(runtimeComponent).get(RenderableWrapper.PROPERTY_FONT);
                    StringBuilder fstyle=new StringBuilder("String_Node_Str"), fweight=new StringBuilder("String_Node_Str"), fsize=new StringBuilder("String_Node_Str"), ffamily=new StringBuilder("String_Node_Str");
                    splitFontStyle(fontStyle,fstyle,fweight,fsize,ffamily);
                    fstyleJsAray.add(fstyle.toString());
                    fweightJsAray.add(fweight.toString());
                    fsizeJsAray.add(fsize.toString());
                    ffamilyJsAray.add(ffamily.toString());
                    String borderStyle=runtimeComponentStyleAttributes.get(runtimeComponent).get(RenderableWrapper.PROPERTY_BORDER);
                    StringBuilder bstyle=new StringBuilder("String_Node_Str"), bwidth=new StringBuilder("String_Node_Str"), bcolor=new StringBuilder("String_Node_Str");
                    splitBorderStyle(borderStyle,bstyle,bwidth,bcolor);
                    bstyleJsAray.add(bstyle.toString());
                    bwidthJsAray.add(bwidth.toString());
                    bcolorJsAray.add(bcolor.toString());
                  }
                }
              }
            }
          }
          String selectedColor=null, selectedFgColor=null, selectedFont=null, selectedBorder=null;
          selectedColor=getListItemBgColor(selectedListItem,isSelected,true);
          if (!isListViewMode()) {
            selectedFgColor=getListItemFgColor(selectedListItem,isSelected,true);
            selectedFont=getListItemFont(selectedListItem,isSelected);
            selectedBorder=getListItemBorder(selectedListItem,isSelected);
          }
          selectedColor=(selectedColor == null ? "String_Node_Str" : selectedColor.toString());
          selectedFgColor=(selectedFgColor == null) ? "String_Node_Str" : selectedFgColor.toString();
          StringBuilder fstyle=new StringBuilder("String_Node_Str"), fweight=new StringBuilder("String_Node_Str"), fsize=new StringBuilder("String_Node_Str"), ffamily=new StringBuilder("String_Node_Str");
          splitFontStyle(selectedFont,fstyle,fweight,fsize,ffamily);
          StringBuilder bstyle=new StringBuilder("String_Node_Str"), bwidth=new StringBuilder("String_Node_Str"), bcolor=new StringBuilder("String_Node_Str");
          splitBorderStyle(selectedBorder,bstyle,bwidth,bcolor);
          if (bgColorScript == null && !isSelected && (getRowOddStyle().getAttributeCount() == 0) && (getRowEvenStyle().getAttributeCount() == 0) && !isListViewMode()) {
            sab.append("String_Node_Str").append(selectedId).append("String_Node_Str").append(toJsArrayString(bgRuntimeColorjsArray,"String_Node_Str")).append("String_Node_Str").append(toJsArrayString(fgRuntimeColorjsArray,"String_Node_Str")).append("String_Node_Str").append(toJsArrayString(fstyleJsAray,"String_Node_Str")).append("String_Node_Str").append(toJsArrayString(fweightJsAray,"String_Node_Str")).append("String_Node_Str").append(toJsArrayString(fsizeJsAray,"String_Node_Str")).append("String_Node_Str").append(toJsArrayString(ffamilyJsAray,"String_Node_Str")).append("String_Node_Str").append(toJsArrayString(bstyleJsAray,"String_Node_Str")).append("String_Node_Str").append(toJsArrayString(bwidthJsAray,"String_Node_Str")).append("String_Node_Str").append(toJsArrayString(bcolorJsAray,"String_Node_Str")).append("String_Node_Str").append(isListViewMode()).append("String_Node_Str");
          }
 else {
            sab.append("String_Node_Str").append(selectedId).append("String_Node_Str").append(selectedColor).append("String_Node_Str").append(selectedFgColor).append("String_Node_Str").append(fstyle).append("String_Node_Str").append(fweight).append("String_Node_Str").append(fsize).append("String_Node_Str").append(ffamily).append("String_Node_Str").append(bstyle).append("String_Node_Str").append(bwidth).append("String_Node_Str").append(bcolor).append("String_Node_Str").append(isListViewMode()).append("String_Node_Str");
          }
        }
      }
    }
    String rowSelectionScript=sab.toString();
    if (rowSelectionScript.length() > 0)     return rowSelectionScript;
  }
  return null;
}