Program: 81534
Project: 81534
Buggy source:
private ResultTransformation processOneRowTag(SheetTransformer sheetTransformer){
  Block body=tagContext.getTagBody();
  int shiftNumber=0;
  if (itemsCollection != null && !itemsCollection.isEmpty()) {
    tagContext.getSheetTransformationController().removeLeftRightBorders(body);
    shiftNumber+=-2;
    Map beans=tagContext.getBeans();
    ResultTransformation shift=new ResultTransformation();
    shift.setLastProcessedRow(-1);
    if (groupBy == null || groupBy.length() == 0) {
      shiftNumber+=tagContext.getSheetTransformationController().duplicateRight(body,itemsCollection.size() - 1);
      processCollectionItemsOneRow(beans,body,shift,sheetTransformer);
    }
 else {
      try {
        Collection groupedData=ReportUtil.groupCollectionData(itemsCollection,groupBy,groupOrder,select,configuration);
        shiftNumber+=tagContext.getSheetTransformationController().duplicateRight(body,groupedData.size() - 1);
        Object savedGroupData=null;
        if (beans.containsKey(GROUP_DATA_KEY)) {
          savedGroupData=beans.get(GROUP_DATA_KEY);
        }
        processGroupedDataOneRow(groupedData,beans,body,shift,sheetTransformer);
        beans.remove(GROUP_DATA_KEY);
        if (savedGroupData != null) {
          beans.put(GROUP_DATA_KEY,savedGroupData);
        }
      }
 catch (      NoSuchMethodException e) {
        log.error(e,new Exception("String_Node_Str" + groupBy,e));
      }
catch (      IllegalAccessException e) {
        log.error(e,new Exception("String_Node_Str" + groupBy,e));
      }
catch (      InvocationTargetException e) {
        log.error(e,new Exception("String_Node_Str" + groupBy,e));
      }
    }
    shift.addRightShift((short)shiftNumber);
    shift.setTagProcessResult(true);
    return shift;
  }
 else {
    log.warn("String_Node_Str" + items + "String_Node_Str");
    tagContext.getSheetTransformationController().removeBodyRows(body);
    ResultTransformation shift=new ResultTransformation(0);
    shift.add(new ResultTransformation(-1,-body.getNumberOfRows()));
    shift.setLastProcessedRow(-1);
    shift.setTagProcessResult(true);
    return shift;
  }
}

Fixed version (ground truth):
private ResultTransformation processOneRowTag(SheetTransformer sheetTransformer){
  Block body=tagContext.getTagBody();
  int shiftNumber=0;
  if (itemsCollection != null && !itemsCollection.isEmpty()) {
    tagContext.getSheetTransformationController().removeLeftRightBorders(body);
    shiftNumber+=-2;
    Map beans=tagContext.getBeans();
    ResultTransformation shift=new ResultTransformation();
    shift.setLastProcessedRow(-1);
    if (groupBy == null || groupBy.length() == 0) {
      shiftNumber+=tagContext.getSheetTransformationController().duplicateRight(body,itemsCollection.size() - 1);
      processCollectionItemsOneRow(beans,body,shift,sheetTransformer);
    }
 else {
      try {
        Collection groupedData=ReportUtil.groupCollectionData(itemsCollection,groupBy,groupOrder,select,configuration);
        shiftNumber+=tagContext.getSheetTransformationController().duplicateRight(body,groupedData.size() - 1);
        Object savedGroupData=null;
        if (beans.containsKey(GROUP_DATA_KEY)) {
          savedGroupData=beans.get(GROUP_DATA_KEY);
        }
        processGroupedDataOneRow(groupedData,beans,body,shift,sheetTransformer);
        beans.remove(GROUP_DATA_KEY);
        if (savedGroupData != null) {
          beans.put(GROUP_DATA_KEY,savedGroupData);
        }
      }
 catch (      NoSuchMethodException e) {
        log.error(e,new Exception("String_Node_Str" + groupBy,e));
      }
catch (      IllegalAccessException e) {
        log.error(e,new Exception("String_Node_Str" + groupBy,e));
      }
catch (      InvocationTargetException e) {
        log.error(e,new Exception("String_Node_Str" + groupBy,e));
      }
    }
    shift.addRightShift((short)shiftNumber);
    shift.setTagProcessResult(true);
    return shift;
  }
 else {
    log.warn("String_Node_Str" + items + "String_Node_Str");
    HSSFRow currentRow=tagContext.getSheet().getHssfSheet().getRow(body.getStartRowNum());
    tagContext.getSheetTransformationController().removeRowCells(currentRow,body.getStartCellNum(),body.getEndCellNum());
    ResultTransformation shift=new ResultTransformation(0);
    shift.add(new ResultTransformation((short)-body.getNumberOfColumns(),(short)(-body.getNumberOfColumns())));
    shift.setLastProcessedRow(-1);
    shift.setTagProcessResult(true);
    return shift;
  }
}