Program: 81547
Project: 81547
Buggy source:
/** 
 * Processes rows in a template sheet using map of beans as parameter
 * @param stc - {@link SheetTransformationController} corresponding to the sheet containing given rows
 * @param sheet {@link net.sf.jxls.transformer.Sheet} object
 * @param startRow Row to start processing
 * @param endRow   Last row to be processed
 * @param beans    Beans for substitution
 * @param parentRow - {@link Row} object representing original template row linked to rows to process
 * @return A number of rows to be shifted
 * @throws ParsePropertyException
 */
public ResultTransformation processRows(SheetTransformationController stc,Sheet sheet,int startRow,int endRow,Map beans,Row parentRow) throws ParsePropertyException {
  int origEndRow=endRow;
  int nextRowShiftNumber=0;
  boolean hasTagProcessing=false;
  int lastProcessedRow=-1;
  for (int i=startRow; i <= endRow; i++) {
    HSSFRow hssfRow=sheet.getHssfSheet().getRow(i);
    lastProcessedRow=i;
    if (hssfRow != null) {
      ResultTransformation processResult=processRow(stc,sheet,hssfRow,beans,parentRow);
      if (!processResult.isTagProcessResult()) {
        int shiftNumber=processResult.getNextRowShift();
        nextRowShiftNumber+=shiftNumber;
        endRow+=processResult.getLastRowShift();
        i+=shiftNumber;
      }
 else {
        hasTagProcessing=true;
        if (processResult.getLastProcessedRow() >= 0) {
          i=processResult.getLastProcessedRow();
        }
 else {
          i--;
        }
        endRow+=processResult.getLastRowShift();
      }
    }
  }
  ResultTransformation r=new ResultTransformation(nextRowShiftNumber,endRow - origEndRow);
  r.setTagProcessResult(hasTagProcessing);
  r.setLastProcessedRow(lastProcessedRow);
  return r;
}

Fixed version (ground truth):
/** 
 * Processes rows in a template sheet using map of beans as parameter
 * @param stc - {@link SheetTransformationController} corresponding to the sheet containing given rows
 * @param sheet {@link net.sf.jxls.transformer.Sheet} object
 * @param startRow Row to start processing
 * @param endRow   Last row to be processed
 * @param beans    Beans for substitution
 * @param parentRow - {@link Row} object representing original template row linked to rows to process
 * @return A number of rows to be shifted
 * @throws ParsePropertyException
 */
public ResultTransformation processRows(SheetTransformationController stc,Sheet sheet,int startRow,int endRow,Map beans,Row parentRow) throws ParsePropertyException {
  int origEndRow=endRow;
  int nextRowShiftNumber=0;
  boolean hasTagProcessing=false;
  int lastProcessedRow=-1;
  for (int i=startRow; i <= endRow; i++) {
    HSSFRow hssfRow=sheet.getHssfSheet().getRow(i);
    if (hssfRow != null) {
      ResultTransformation processResult=processRow(stc,sheet,hssfRow,beans,parentRow);
      if (!processResult.isTagProcessResult()) {
        int shiftNumber=processResult.getNextRowShift();
        nextRowShiftNumber+=shiftNumber;
        endRow+=processResult.getLastRowShift();
        i+=shiftNumber;
        lastProcessedRow=i;
      }
 else {
        hasTagProcessing=true;
        if (processResult.getLastProcessedRow() >= 0) {
          i=processResult.getLastProcessedRow();
          lastProcessedRow=i;
        }
 else {
          i--;
        }
        endRow+=processResult.getLastRowShift();
      }
    }
  }
  ResultTransformation r=new ResultTransformation(nextRowShiftNumber,endRow - origEndRow);
  r.setTagProcessResult(hasTagProcessing);
  r.setLastProcessedRow(lastProcessedRow);
  return r;
}