nus-yam/ex-repair huggingface dataset:
Program: 81519
Project: 81519
Buggy source:
public void testMultipleSheetList() throws IOException, ParsePropertyException {
  InputStream is=new BufferedInputStream(getClass().getResourceAsStream(multipleSheetListXLS));
  XLSTransformer transformer=new XLSTransformer();
  List sheetNames=new ArrayList();
  sheetNames.add("String_Node_Str");
  for (int i=0; i < departments.size(); i++) {
    Department department=(Department)departments.get(i);
    sheetNames.add(department.getName());
  }
  HSSFWorkbook resultWorkbook=transformer.transformMultipleSheetsList(is,departments,sheetNames,"String_Node_Str",new HashMap(),0);
  is.close();
  is=new BufferedInputStream(getClass().getResourceAsStream(multipleSheetListXLS));
  POIFSFileSystem fs=new POIFSFileSystem(is);
  HSSFWorkbook sourceWorkbook=new HSSFWorkbook(fs);
  assertEquals("String_Node_Str",sourceWorkbook.getNumberOfSheets() + departments.size() - 1,resultWorkbook.getNumberOfSheets());
  is.close();
  saveWorkbook(resultWorkbook,multipleSheetListDestXLS);
}

Fixed version (ground truth):
public void testMultipleSheetList() throws IOException, ParsePropertyException {
  InputStream is=new BufferedInputStream(getClass().getResourceAsStream(multipleSheetListXLS));
  XLSTransformer transformer=new XLSTransformer();
  List sheetNames=new ArrayList();
  for (int i=0; i < departments.size(); i++) {
    Department department=(Department)departments.get(i);
    sheetNames.add(department.getName());
  }
  HSSFWorkbook resultWorkbook=transformer.transformMultipleSheetsList(is,departments,sheetNames,"String_Node_Str",new HashMap(),0);
  is.close();
  is=new BufferedInputStream(getClass().getResourceAsStream(multipleSheetListXLS));
  POIFSFileSystem fs=new POIFSFileSystem(is);
  HSSFWorkbook sourceWorkbook=new HSSFWorkbook(fs);
  assertEquals("String_Node_Str",sourceWorkbook.getNumberOfSheets() + departments.size() - 1,resultWorkbook.getNumberOfSheets());
  is.close();
  saveWorkbook(resultWorkbook,multipleSheetListDestXLS);
}
Program: 81523
Project: 81523
Buggy source:
public boolean contains(CellRef cellRef){
  boolean flag=(startRowNum <= cellRef.getRowNum() && cellRef.getRowNum() <= endRowNum && ((startCellNum < 0 || endCellNum < 0) || (startCellNum <= cellRef.getColNum() && cellRef.getColNum() <= endCellNum)));
  if (flag && !affectedColumns.isEmpty()) {
    return affectedColumns.contains(new Short(cellRef.getColNum()));
  }
 else {
    return flag;
  }
}

Fixed version (ground truth):
public boolean contains(CellRef cellRef){
  String refSheetName=cellRef.getSheetName();
  boolean flag=((refSheetName == null || sheet.getSheetName().equals(refSheetName)) && startRowNum <= cellRef.getRowNum() && cellRef.getRowNum() <= endRowNum && ((startCellNum < 0 || endCellNum < 0) || (startCellNum <= cellRef.getColNum() && cellRef.getColNum() <= endCellNum)));
  if (flag && !affectedColumns.isEmpty()) {
    return affectedColumns.contains(new Short(cellRef.getColNum()));
  }
 else {
    return flag;
  }
}
Program: 81526
Project: 81526
Buggy source:
public void testHiddenSheetsExport() throws IOException, ParsePropertyException {
  Map beans=new HashMap();
  beans.put("String_Node_Str",simpleBean1);
  InputStream is=new BufferedInputStream(getClass().getResourceAsStream(hideSheetsXLS));
  XLSTransformer transformer=new XLSTransformer();
  transformer.setSpreadsheetsToHide(new String[]{"String_Node_Str","String_Node_Str"});
  HSSFWorkbook resultWorkbook=transformer.transformXLS(is,beans);
  assertEquals("String_Node_Str",1,resultWorkbook.getNumberOfSheets());
  is.close();
  saveWorkbook(resultWorkbook,hideSheetsDestXLS);
}

Fixed version (ground truth):
public void testHiddenSheetsExport() throws IOException, ParsePropertyException {
  Map beans=new HashMap();
  beans.put("String_Node_Str",simpleBean1);
  InputStream is=new BufferedInputStream(getClass().getResourceAsStream(hideSheetsXLS));
  XLSTransformer transformer=new XLSTransformer();
  transformer.setSpreadsheetsToHide(new String[]{"String_Node_Str","String_Node_Str"});
  HSSFWorkbook resultWorkbook=transformer.transformXLS(is,beans);
  assertEquals("String_Node_Str",1,resultWorkbook.getNumberOfSheets());
  is.close();
  is=new BufferedInputStream(getClass().getResourceAsStream(hideSheetsXLS));
  transformer.setSpreadsheetsToHide(new String[]{"String_Node_Str"});
  resultWorkbook=transformer.transformXLS(is,beans);
  assertEquals("String_Node_Str",2,resultWorkbook.getNumberOfSheets());
  is.close();
  saveWorkbook(resultWorkbook,hideSheetsDestXLS);
}
Program: 81528
Project: 81528
Buggy source:
public static void shiftCellsLeft(HSSFSheet sheet,int startRow,short startCol,int endRow,short endCol,short shiftNumber){
  for (int i=startRow; i <= endRow; i++) {
    HSSFRow row=sheet.getRow(i);
    if (row != null) {
      for (short j=startCol; j <= endCol; j++) {
        HSSFCell cell=row.getCell(j);
        if (cell == null) {
          cell=row.createCell(j);
        }
        HSSFCell destCell=row.getCell((short)(j - shiftNumber));
        if (destCell == null) {
          destCell=row.createCell((short)(j - shiftNumber));
        }
        copyCell(cell,destCell,true);
        sheet.setColumnWidth(destCell.getCellNum(),sheet.getColumnWidth(cell.getCellNum()));
      }
    }
  }
}

Fixed version (ground truth):
public static void shiftCellsLeft(HSSFSheet sheet,int startRow,short startCol,int endRow,short endCol,short shiftNumber){
  for (int i=startRow; i <= endRow; i++) {
    boolean doSetWidth=true;
    HSSFRow row=sheet.getRow(i);
    if (row != null) {
      for (short j=startCol; j <= endCol; j++) {
        HSSFCell cell=row.getCell(j);
        if (cell == null) {
          cell=row.createCell(j);
          doSetWidth=false;
        }
        HSSFCell destCell=row.getCell((short)(j - shiftNumber));
        if (destCell == null) {
          destCell=row.createCell((short)(j - shiftNumber));
        }
        copyCell(cell,destCell,true);
        if (doSetWidth) {
          sheet.setColumnWidth(destCell.getCellNum(),sheet.getColumnWidth(cell.getCellNum()));
        }
      }
    }
  }
}
Program: 81530
Project: 81530
Buggy source:
private Object getCellValue(HSSFCell cell,Object obj){
  Object value=null;
  if (obj instanceof String) {
    value=cell.getStringCellValue();
  }
 else   if (obj instanceof Double) {
    value=new Double(cell.getNumericCellValue());
  }
 else   if (obj instanceof BigDecimal) {
    value=new BigDecimal(cell.getNumericCellValue());
  }
 else   if (obj instanceof Integer) {
    value=new Integer((int)cell.getNumericCellValue());
  }
 else   if (obj instanceof Float) {
    value=new Float(cell.getNumericCellValue());
  }
 else   if (obj instanceof Date) {
    value=cell.getDateCellValue();
  }
 else   if (obj instanceof Calendar) {
    Calendar c=Calendar.getInstance();
    c.setTime(cell.getDateCellValue());
    value=c;
  }
 else   if (obj instanceof Boolean) {
    if (cell.getCellType() == HSSFCell.CELL_TYPE_BOOLEAN) {
      value=(cell.getBooleanCellValue()) ? Boolean.TRUE : Boolean.FALSE;
    }
 else     if (cell.getCellType() == HSSFCell.CELL_TYPE_STRING) {
      value=Boolean.valueOf(cell.getStringCellValue());
    }
 else {
      value=Boolean.FALSE;
    }
  }
  return value;
}

Fixed version (ground truth):
private Object getCellValue(HSSFCell cell,Object obj){
  Object value=null;
  if (obj instanceof String) {
    value=cell.getStringCellValue() != null ? cell.getStringCellValue().trim() : null;
  }
 else   if (obj instanceof Double) {
    value=new Double(cell.getNumericCellValue());
  }
 else   if (obj instanceof BigDecimal) {
    value=new BigDecimal(cell.getNumericCellValue());
  }
 else   if (obj instanceof Integer) {
    value=new Integer((int)cell.getNumericCellValue());
  }
 else   if (obj instanceof Float) {
    value=new Float(cell.getNumericCellValue());
  }
 else   if (obj instanceof Date) {
    value=cell.getDateCellValue();
  }
 else   if (obj instanceof Calendar) {
    Calendar c=Calendar.getInstance();
    c.setTime(cell.getDateCellValue());
    value=c;
  }
 else   if (obj instanceof Boolean) {
    if (cell.getCellType() == HSSFCell.CELL_TYPE_BOOLEAN) {
      value=(cell.getBooleanCellValue()) ? Boolean.TRUE : Boolean.FALSE;
    }
 else     if (cell.getCellType() == HSSFCell.CELL_TYPE_STRING) {
      value=Boolean.valueOf(cell.getStringCellValue());
    }
 else {
      value=Boolean.FALSE;
    }
  }
  return value;
}
Program: 81531
Project: 81531
Buggy source:
public boolean isCheckSuccessful(XLSRowCursor cursor){
  if (!cursor.hasNext()) {
    return cellChecks.isEmpty();
  }
  HSSFRow row=cursor.getSheet().getRow(offset + cursor.getCurrentRowNum());
  if (row == null) {
    return cellChecks.isEmpty();
  }
 else {
    return isCheckSuccessful(row);
  }
}

Fixed version (ground truth):
public boolean isCheckSuccessful(XLSRowCursor cursor){
  if (!cursor.hasNext()) {
    return isCellChecksEmpty();
  }
  HSSFRow row=cursor.getSheet().getRow(offset + cursor.getCurrentRowNum());
  if (row == null) {
    return cellChecks.isEmpty();
  }
 else {
    return isCheckSuccessful(row);
  }
}
Program: 81535
Project: 81535
Buggy source:
public void testDynamicColumns() throws IOException, ParsePropertyException {
  Map beans=new HashMap();
  List cols=new ArrayList();
  String[] colNames=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  for (int i=0; i < colNames.length; i++) {
    String colName=colNames[i];
    cols.add(new Column(colName));
  }
  beans.put("String_Node_Str",cols);
  InputStream is=new BufferedInputStream(getClass().getResourceAsStream(dynamicColumnsXLS));
  XLSTransformer transformer=new XLSTransformer();
  HSSFWorkbook resultWorkbook=transformer.transformXLS(is,beans);
  is.close();
  is=new BufferedInputStream(getClass().getResourceAsStream(dynamicColumnsXLS));
  POIFSFileSystem fs=new POIFSFileSystem(is);
  HSSFWorkbook sourceWorkbook=new HSSFWorkbook(fs);
  HSSFSheet sourceSheet=sourceWorkbook.getSheetAt(0);
  HSSFSheet resultSheet=resultWorkbook.getSheetAt(0);
  Map props=new HashMap();
  props.put("String_Node_Str",colNames[0]);
  CellsChecker checker=new CellsChecker(props);
  checker.checkCells(sourceSheet,resultSheet,0,(short)1,0,(short)0,true);
  props.put("String_Node_Str",colNames[1]);
  checker.checkCells(sourceSheet,resultSheet,0,(short)1,0,(short)1,true);
  props.put("String_Node_Str",colNames[2]);
  checker.checkCells(sourceSheet,resultSheet,0,(short)1,0,(short)2,true);
  is.close();
  saveWorkbook(resultWorkbook,dynamicColumnsDestXLS);
}

Fixed version (ground truth):
public void testDynamicColumns() throws IOException, ParsePropertyException {
  Map beans=new HashMap();
  List cols=new ArrayList();
  String[] colNames=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"};
  for (int i=0; i < colNames.length; i++) {
    String colName=colNames[i];
    cols.add(new Column(colName));
  }
  beans.put("String_Node_Str",cols);
  List list=new ArrayList();
  list.add(new Item("String_Node_Str",new int[]{1,2,3}));
  list.add(new Item("String_Node_Str",new int[]{}));
  list.add(new Item("String_Node_Str",new int[]{4,5,6}));
  list.add(new Item("String_Node_Str",new int[]{}));
  beans.put("String_Node_Str",list);
  InputStream is=new BufferedInputStream(getClass().getResourceAsStream(dynamicColumnsXLS));
  XLSTransformer transformer=new XLSTransformer();
  HSSFWorkbook resultWorkbook=transformer.transformXLS(is,beans);
  is.close();
  is=new BufferedInputStream(getClass().getResourceAsStream(dynamicColumnsXLS));
  POIFSFileSystem fs=new POIFSFileSystem(is);
  HSSFWorkbook sourceWorkbook=new HSSFWorkbook(fs);
  HSSFSheet sourceSheet=sourceWorkbook.getSheetAt(0);
  HSSFSheet resultSheet=resultWorkbook.getSheetAt(0);
  Map props=new HashMap();
  props.put("String_Node_Str",colNames[0]);
  CellsChecker checker=new CellsChecker(props);
  checker.checkCells(sourceSheet,resultSheet,0,(short)1,0,(short)0,true);
  props.put("String_Node_Str",colNames[1]);
  checker.checkCells(sourceSheet,resultSheet,0,(short)1,0,(short)1,true);
  props.put("String_Node_Str",colNames[2]);
  checker.checkCells(sourceSheet,resultSheet,0,(short)1,0,(short)2,true);
  is.close();
  saveWorkbook(resultWorkbook,dynamicColumnsDestXLS);
}
Program: 81536
Project: 81536
Buggy source:
public Item(String name){
  attributes.add(name + "String_Node_Str");
  attributes.add(name + "String_Node_Str");
}

Fixed version (ground truth):
public Item(String key,int[] _values){
  this.key=key;
  for (int i=0; i < _values.length; i++) {
    values.add(Integer.valueOf(_values[i]));
  }
}
Program: 81537
Project: 81537
Buggy source:
public void removeBodyRows(Block block){
  if (block.getSheet() == null) {
    block.setSheet(sheet);
  }
  transformations.add(new RemoveTransformation(block));
  ShiftTransformation shiftTransformation=new ShiftTransformation(new Block(sheet,block.getEndRowNum() + 1,Integer.MAX_VALUE),-block.getNumberOfRows(),0);
  transformations.add(shiftTransformation);
  formulaController.updateWorkbookFormulas(shiftTransformation);
  TagBodyHelper.removeBodyRows(sheet.getHssfSheet(),block);
}

Fixed version (ground truth):
public void removeBodyRows(Block block){
  if (block.getSheet() == null) {
    block.setSheet(sheet);
  }
  RemoveTransformation removeTransformation=new RemoveTransformation(block);
  transformations.add(removeTransformation);
  ShiftTransformation shiftTransformation=new ShiftTransformation(new Block(sheet,block.getEndRowNum() + 1,Integer.MAX_VALUE),-block.getNumberOfRows(),0);
  transformations.add(shiftTransformation);
  formulaController.updateWorkbookFormulas(removeTransformation);
  formulaController.updateWorkbookFormulas(shiftTransformation);
  TagBodyHelper.removeBodyRows(sheet.getHssfSheet(),block);
}
Program: 81539
Project: 81539
Buggy source:
private void parseTag(String tagName,Block tagBody,Map beans){
  Digester digester=new Digester();
  digester.setNamespaceAware(true);
  digester.setRuleNamespaceURI(Configuration.NAMESPACE_URI);
  digester.setValidating(false);
  Set tagKeys=Taglib.getTags().keySet();
  for (Iterator iterator=tagKeys.iterator(); iterator.hasNext(); ) {
    String tagKey=(String)iterator.next();
    digester.addObjectCreate(Configuration.JXLS_ROOT_TAG + "String_Node_Str" + tagKey,(String)Taglib.getTags().get(tagKey));
    digester.addSetProperties(Configuration.JXLS_ROOT_TAG + "String_Node_Str" + tagKey);
  }
  try {
    String xml=Configuration.JXLS_ROOT_START + cell.getHssfCellValue() + "String_Node_Str"+ configuration.getTagPrefix()+ tagName+ "String_Node_Str"+ Configuration.JXLS_ROOT_END;
    String escapedXml=Util.escapeAttributes(xml);
    Tag tag=(Tag)digester.parse(new StringReader(escapedXml));
    cell.setTag(tag);
    TagContext tagContext=new TagContext(cell.getRow().getSheet(),tagBody,beans);
    tag.init(tagContext);
  }
 catch (  IOException e) {
    log.warn("String_Node_Str" + cell.getHssfCellValue(),e);
  }
catch (  SAXException e) {
    log.warn("String_Node_Str" + cell.getHssfCellValue(),e);
  }
}

Fixed version (ground truth):
private void parseTag(String tagName,Block tagBody,Map beans){
  Digester digester=new Digester();
  digester.setNamespaceAware(true);
  digester.setRuleNamespaceURI(Configuration.NAMESPACE_URI);
  digester.setValidating(false);
  Set tagKeys=Taglib.getTagMap().keySet();
  for (Iterator iterator=tagKeys.iterator(); iterator.hasNext(); ) {
    String tagKey=(String)iterator.next();
    digester.addObjectCreate(Configuration.JXLS_ROOT_TAG + "String_Node_Str" + tagKey,(String)Taglib.getTagMap().get(tagKey));
    digester.addSetProperties(Configuration.JXLS_ROOT_TAG + "String_Node_Str" + tagKey);
  }
  try {
    String xml=Configuration.JXLS_ROOT_START + cell.getHssfCellValue() + "String_Node_Str"+ configuration.getTagPrefix()+ tagName+ "String_Node_Str"+ Configuration.JXLS_ROOT_END;
    String escapedXml=Util.escapeAttributes(xml);
    Tag tag=(Tag)digester.parse(new StringReader(escapedXml));
    cell.setTag(tag);
    TagContext tagContext=new TagContext(cell.getRow().getSheet(),tagBody,beans);
    tag.init(tagContext);
  }
 catch (  IOException e) {
    log.warn("String_Node_Str" + cell.getHssfCellValue(),e);
  }
catch (  SAXException e) {
    log.warn("String_Node_Str" + cell.getHssfCellValue(),e);
  }
}
Program: 81540
Project: 81540
Buggy source:
public List transformCell(String sheetName,CellRef cellRef){
  return null;
}

Fixed version (ground truth):
public List transformCell(String sheetName,CellRef cellRef){
  List cells=null;
  String refSheetName=cellRef.getSheetName();
  if (block.getSheet().getSheetName().equalsIgnoreCase(refSheetName) || (cellRef.getSheetName() == null && block.getSheet().getSheetName().equalsIgnoreCase(sheetName))) {
    if (!block.contains(cellRef.getRowNum(),cellRef.getColNum())) {
      cells=new ArrayList();
      cells.add(cellRef.toString());
    }
  }
 else {
    cells=new ArrayList();
    cells.add(cellRef.toString());
  }
  return cells;
}
Program: 81541
Project: 81541
Buggy source:
public void registerTaglib(String prefix,Taglib taglib){
  if (taglibs.containsKey(prefix)) {
    throw new TaglibRegistrationException("String_Node_Str" + prefix + "String_Node_Str");
  }
 else {
    taglibs.put(prefix,taglib);
  }
}

Fixed version (ground truth):
public void registerTaglib(String taglibFileName){
  TaglibXMLParser parser=new TaglibXMLParser();
  Taglib taglib=parser.parseTaglibXMLFile(taglibFileName);
}
Program: 81542
Project: 81542
Buggy source:
private static void prepareCollectionPropertyInCellForDuplication(HSSFCell cell,String collectionName,String collectionItemName){
  if (cell != null && cell.getCellType() == HSSFCell.CELL_TYPE_STRING) {
    String cellValue=cell.getStringCellValue();
    String newValue=cellValue.replaceAll(collectionName,collectionItemName);
    cell.setCellValue(newValue);
  }
}

Fixed version (ground truth):
private static void prepareCollectionPropertyInCellForDuplication(HSSFCell cell,String collectionName,String collectionItemName){
  if (cell != null && cell.getCellType() == HSSFCell.CELL_TYPE_STRING) {
    String cellValue=cell.getStringCellValue();
    String newValue=replaceCollectionProperty(cellValue,collectionName,collectionItemName);
    cell.setCellValue(newValue);
  }
}
Program: 81545
Project: 81545
Buggy source:
public SimpleBean(String name,Double doubleValue,Integer intValue){
  this.name=name;
  this.doubleValue=doubleValue;
  this.intValue=intValue;
}

Fixed version (ground truth):
public SimpleBean(int amount){
  this.amount=amount;
}
Program: 81546
Project: 81546
Buggy source:
void transformSheet(WorkbookTransformationController workbookTransformationController,Sheet sheet,Map beans) throws ParsePropertyException {
  log.info("String_Node_Str" + sheet.getSheetName());
  if (!beans.isEmpty()) {
    SheetTransformationController stc=new SheetTransformationControllerImpl(sheet);
    workbookTransformationController.addSheetTransformationController(stc);
    for (int i=sheet.getHssfSheet().getFirstRowNum(); i <= sheet.getHssfSheet().getLastRowNum(); i++) {
      HSSFRow hssfRow=sheet.getHssfSheet().getRow(i);
      if (hssfRow != null) {
        RowTransformer rowTransformer=parseRow(sheet,hssfRow,beans);
        if (rowTransformer != null) {
          Row row=rowTransformer.getRow();
          applyRowProcessors(sheet,row);
          ResultTransformation processResult=rowTransformer.transform(stc,this,beans);
          transformers.add(rowTransformer);
          if (!processResult.isTagProcessResult()) {
            i+=processResult.getNextRowShift();
          }
 else {
            if (processResult.getLastProcessedRow() >= 0) {
              i=processResult.getLastProcessedRow();
            }
          }
        }
      }
    }
    groupRows(sheet);
  }
}

Fixed version (ground truth):
void transformSheet(WorkbookTransformationController workbookTransformationController,Sheet sheet,Map beans) throws ParsePropertyException {
  log.info("String_Node_Str" + sheet.getSheetName());
  if (!beans.isEmpty()) {
    SheetTransformationController stc=new SheetTransformationControllerImpl(sheet);
    workbookTransformationController.addSheetTransformationController(stc);
    for (int i=sheet.getHssfSheet().getFirstRowNum(); i <= sheet.getHssfSheet().getLastRowNum(); i++) {
      HSSFRow hssfRow=sheet.getHssfSheet().getRow(i);
      if (hssfRow != null) {
        RowTransformer rowTransformer=parseRow(sheet,hssfRow,beans);
        if (rowTransformer != null) {
          Row row=rowTransformer.getRow();
          applyRowProcessors(sheet,row);
          ResultTransformation processResult=rowTransformer.transform(stc,this,beans);
          transformers.add(rowTransformer);
          if (!processResult.isTagProcessResult()) {
            i+=processResult.getNextRowShift();
          }
 else {
            if (processResult.getLastProcessedRow() >= 0) {
              i=processResult.getLastProcessedRow();
            }
 else {
              i--;
            }
          }
        }
      }
    }
    groupRows(sheet);
  }
}
Program: 81548
Project: 81548
Buggy source:
void checkRows(HSSFSheet sourceSheet,HSSFSheet destSheet,int sourceRowNum,int destRowNum,int numberOfRows){
  for (int i=0; i < numberOfRows; i++) {
    HSSFRow sourceRow=sourceSheet.getRow(sourceRowNum + i);
    HSSFRow destRow=destSheet.getRow(destRowNum + i);
    assertTrue("String_Node_Str",(sourceRow != null && destRow != null) || (sourceRow == null && destRow == null));
    if (sourceRow != null && destRow != null) {
      assertEquals("String_Node_Str",sourceRow.getFirstCellNum(),destRow.getFirstCellNum());
      assertEquals("String_Node_Str",sourceRow.getPhysicalNumberOfCells(),destRow.getPhysicalNumberOfCells());
      assertEquals("String_Node_Str",sourceRow.getHeight(),destRow.getHeight());
      checkCells(sourceRow,destRow,sourceRow.getFirstCellNum(),sourceRow.getLastCellNum());
    }
  }
}

Fixed version (ground truth):
void checkRows(HSSFSheet sourceSheet,HSSFSheet destSheet,int sourceRowNum,int destRowNum,int numberOfRows){
  for (int i=0; i < numberOfRows; i++) {
    HSSFRow sourceRow=sourceSheet.getRow(sourceRowNum + i);
    HSSFRow destRow=destSheet.getRow(destRowNum + i);
    assertTrue("String_Node_Str",(sourceRow != null && destRow != null) || (sourceRow == null && destRow == null));
    if (sourceRow != null && destRow != null) {
      if (!ignoreFirstLastCellNums) {
        assertEquals("String_Node_Str",sourceRow.getFirstCellNum(),destRow.getFirstCellNum());
      }
      assertEquals("String_Node_Str",sourceRow.getPhysicalNumberOfCells(),destRow.getPhysicalNumberOfCells());
      assertEquals("String_Node_Str",sourceRow.getHeight(),destRow.getHeight());
      checkCells(sourceRow,destRow,sourceRow.getFirstCellNum(),sourceRow.getLastCellNum());
    }
  }
}
Program: 81551
Project: 81551
Buggy source:
public void testForGroupBy() throws IOException, ParsePropertyException {
  Map beans=new HashMap();
  beans.put("String_Node_Str",departments);
  InputStream is=new BufferedInputStream(getClass().getResourceAsStream(forGroupByXLS));
  XLSTransformer transformer=new XLSTransformer();
  HSSFWorkbook resultWorkbook=transformer.transformXLS(is,beans);
  is.close();
  is=new BufferedInputStream(getClass().getResourceAsStream(forGroupByXLS));
  is.close();
  saveWorkbook(resultWorkbook,forGroupByDestXLS);
}

Fixed version (ground truth):
public void testForGroupBy() throws IOException, ParsePropertyException {
  Map beans=new HashMap();
  beans.put("String_Node_Str",departments);
  InputStream is=new BufferedInputStream(getClass().getResourceAsStream(forGroupByXLS));
  XLSTransformer transformer=new XLSTransformer();
  HSSFWorkbook resultWorkbook=transformer.transformXLS(is,beans);
  is.close();
  is=new BufferedInputStream(getClass().getResourceAsStream(forGroupByXLS));
  is.close();
  saveWorkbook(resultWorkbook,forGroupByDestXLS);
  ((Department)departments.get(0)).getStaff().clear();
  is=new BufferedInputStream(getClass().getResourceAsStream(forGroupByXLS));
  resultWorkbook=transformer.transformXLS(is,beans);
  is.close();
}
Program: 81552
Project: 81552
Buggy source:
public void initSheetName(){
  for (int i=0; i < hssfWorkbook.getNumberOfSheets(); i++) {
    HSSFSheet sheet=hssfWorkbook.getSheetAt(i);
    if (sheet == hssfSheet) {
      sheetName=hssfWorkbook.getSheetName(i);
    }
  }
}

Fixed version (ground truth):
public void initSheetName(){
  for (int i=0; i < hssfWorkbook.getNumberOfSheets(); i++) {
    HSSFSheet sheet=hssfWorkbook.getSheetAt(i);
    if (sheet == hssfSheet) {
      sheetName=hssfWorkbook.getSheetName(i);
      if (sheetName.indexOf(' ') >= 0) {
        sheetName="String_Node_Str" + sheetName + "String_Node_Str";
      }
    }
  }
}
Program: 81554
Project: 81554
Buggy source:
private static String printObject(Object obj){
  List<String> result=new ArrayList<>();
  for (  Field field : getFields(obj,Object.class)) {
    Object value=getFieldValue(field,obj);
    String strValue=null;
    if (value == null)     strValue="String_Node_Str";
 else     if (isClass(value.getClass(),String.class))     strValue=(String)value;
 else     if (isClass(value.getClass(),Enum.class))     strValue=value.toString();
 else     if (field.isAnnotationPresent(Complex.class))     strValue="String_Node_Str" + printObject(value) + "String_Node_Str";
    if (strValue != null)     result.add(String.format("String_Node_Str",AnnotationsUtil.getElementName(field),strValue));
  }
  return print(result,"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
private static String printObject(Object obj){
  List<String> result=new ArrayList<>();
  for (  Field field : getFields(obj,Object.class)) {
    Object value=getValueField(field,obj);
    String strValue=null;
    if (value == null)     strValue="String_Node_Str";
 else     if (isClass(value.getClass(),String.class))     strValue=(String)value;
 else     if (isClass(value.getClass(),Enum.class))     strValue=value.toString();
 else     if (field.isAnnotationPresent(Complex.class))     strValue="String_Node_Str" + printObject(value) + "String_Node_Str";
    if (strValue != null)     result.add(String.format("String_Node_Str",AnnotationsUtil.getElementName(field),strValue));
  }
  return print(result,"String_Node_Str","String_Node_Str");
}
Program: 81555
Project: 81555
Buggy source:
public static String printFields(Object obj,String separator){
  String className=obj.getClass().getSimpleName();
  String params=print(select(getFields(obj,String.class),field -> format("String_Node_Str",field.getName(),getFieldValue(field,obj))),separator,"String_Node_Str");
  return format("String_Node_Str",className,params);
}

Fixed version (ground truth):
public static String printFields(Object obj,String separator){
  String className=obj.getClass().getSimpleName();
  String params=print(select(getFields(obj,String.class),field -> format("String_Node_Str",field.getName(),getValueField(field,obj))),separator,"String_Node_Str");
  return format("String_Node_Str",className,params);
}
Program: 81556
Project: 81556
Buggy source:
public static <T>T getFirstField(Object obj,Class<T> type){
  return (T)getFieldValue(LinqUtils.first(obj.getClass().getDeclaredFields(),field -> isClass(field,type) || isInterface(field,type)),obj);
}

Fixed version (ground truth):
public static <T>T getFirstField(Object obj,Class<T> type){
  return (T)getValueField(LinqUtils.first(obj.getClass().getDeclaredFields(),field -> isClass(field,type) || isInterface(field,type)),obj);
}
Program: 81557
Project: 81557
Buggy source:
private static BaseElement createChildFromField(Object parent,Object parentInstance,Field field,Class<?> type){
  BaseElement instance=(BaseElement)getFieldValue(field,parentInstance);
  if (instance == null)   try {
    instance=getElementInstance(type,field.getName(),getNewLocator(field));
  }
 catch (  Exception ex) {
    throw exception(format("String_Node_Str",parentInstance.getClass().getSimpleName(),field.getType().getSimpleName()));
  }
 else   if (instance.getLocator() == null)   instance.avatar.byLocator=getNewLocator(field);
  instance.avatar.context=(isBaseElement(parent)) ? ((BaseElement)parent).avatar.context.copy() : new Pairs<>();
  if (type != null) {
    By frameBy=AnnotationsUtil.getFrame(type.getDeclaredAnnotation(Frame.class));
    if (frameBy != null)     instance.avatar.context.add(ContextType.Frame,frameBy);
  }
  if (isBaseElement(parent)) {
    By parentLocator=((BaseElement)parent).getLocator();
    if (parentLocator != null)     instance.avatar.context.add(ContextType.Locator,parentLocator);
  }
  return instance;
}

Fixed version (ground truth):
private static BaseElement createChildFromField(Object parent,Object parentInstance,Field field,Class<?> type){
  BaseElement instance=(BaseElement)getValueField(field,parentInstance);
  if (instance == null)   try {
    instance=getElementInstance(type,field.getName(),getNewLocator(field));
  }
 catch (  Exception ex) {
    throw exception(format("String_Node_Str",parentInstance.getClass().getSimpleName(),field.getType().getSimpleName()));
  }
 else   if (instance.getLocator() == null)   instance.avatar.byLocator=getNewLocator(field);
  instance.avatar.context=(isBaseElement(parent)) ? ((BaseElement)parent).avatar.context.copy() : new Pairs<>();
  if (type != null) {
    By frameBy=AnnotationsUtil.getFrame(type.getDeclaredAnnotation(Frame.class));
    if (frameBy != null)     instance.avatar.context.add(ContextType.Frame,frameBy);
  }
  if (isBaseElement(parent)) {
    By parentLocator=((BaseElement)parent).getLocator();
    if (parentLocator != null)     instance.avatar.context.add(ContextType.Locator,parentLocator);
  }
  return instance;
}
Program: 81558
Project: 81558
Buggy source:
private static BaseElement createChildFromFieldStatic(Class<?> parentClass,Field field,Class<?> type){
  BaseElement instance=(BaseElement)getFieldValue(field,null);
  if (instance == null)   try {
    instance=getElementInstance(type,field.getName(),getNewLocator(field));
  }
 catch (  Exception ex) {
    throw exception(format("String_Node_Str",parentClass.getSimpleName(),field.getType().getSimpleName()));
  }
 else   if (instance.getLocator() == null)   instance.avatar.byLocator=getNewLocator(field);
  instance.avatar.context=new Pairs<>();
  if (type != null) {
    By frameBy=AnnotationsUtil.getFrame(type.getDeclaredAnnotation(Frame.class));
    if (frameBy != null)     instance.avatar.context.add(ContextType.Frame,frameBy);
  }
  return instance;
}

Fixed version (ground truth):
private static BaseElement createChildFromFieldStatic(Class<?> parentClass,Field field,Class<?> type){
  BaseElement instance=(BaseElement)getValueField(field,null);
  if (instance == null)   try {
    instance=getElementInstance(type,field.getName(),getNewLocator(field));
  }
 catch (  Exception ex) {
    throw exception(format("String_Node_Str",parentClass.getSimpleName(),field.getType().getSimpleName()));
  }
 else   if (instance.getLocator() == null)   instance.avatar.byLocator=getNewLocator(field);
  instance.avatar.context=new Pairs<>();
  if (type != null) {
    By frameBy=AnnotationsUtil.getFrame(type.getDeclaredAnnotation(Frame.class));
    if (frameBy != null)     instance.avatar.context.add(ContextType.Frame,frameBy);
  }
  return instance;
}
Program: 81559
Project: 81559
Buggy source:
public static void setElement(Object parent,Object parentInstance,Field field){
  try {
    Class<?> type=field.getType();
    if (parentInstance == null)     parentInstance=parent;
    BaseElement instance;
    if (isClass(type,Page.class)) {
      instance=(BaseElement)getFieldValue(field,parentInstance);
      if (instance == null)       instance=(BaseElement)type.newInstance();
      fillPage(instance,field,parent != null ? parent.getClass() : null);
    }
 else {
      instance=createChildFromField(parent,parentInstance,field,type);
      instance.function=AnnotationsUtil.getFunction(field);
    }
    instance.setName(field);
    if (instance.getClass().getSimpleName().equals("String_Node_Str"))     instance.setTypeName(type.getSimpleName());
    instance.setParentName(getClassName(parent));
    field.set(parent,instance);
    if (isInterface(field,IComposite.class))     InitElements(instance);
  }
 catch (  Exception ex) {
    throw exception("String_Node_Str",field.getName(),getClassName(parent) + LineBreak + ex.getMessage());
  }
}

Fixed version (ground truth):
public static void setElement(Object parent,Object parentInstance,Field field){
  try {
    Class<?> type=field.getType();
    if (parentInstance == null)     parentInstance=parent;
    BaseElement instance;
    if (isClass(type,Page.class)) {
      instance=(BaseElement)getValueField(field,parentInstance);
      if (instance == null)       instance=(BaseElement)type.newInstance();
      fillPage(instance,field,parent != null ? parent.getClass() : null);
    }
 else {
      instance=createChildFromField(parent,parentInstance,field,type);
      instance.function=AnnotationsUtil.getFunction(field);
    }
    instance.setName(field);
    if (instance.getClass().getSimpleName().equals("String_Node_Str"))     instance.setTypeName(type.getSimpleName());
    instance.setParentName(getClassName(parent));
    field.set(parent,instance);
    if (isInterface(field,IComposite.class))     InitElements(instance);
  }
 catch (  Exception ex) {
    throw exception("String_Node_Str",field.getName(),getClassName(parent) + LineBreak + ex.getMessage());
  }
}
Program: 81560
Project: 81560
Buggy source:
public void submit(T entity,Enum buttonName){
  fill(PrintUtils.objToSetValue(entity));
  getElement.getButton(buttonName.toString().toLowerCase()).click();
}

Fixed version (ground truth):
public void submit(T entity,Enum buttonName){
  fill(objToSetValue(entity));
  getElement.getButton(buttonName.toString().toLowerCase()).click();
}
Program: 81561
Project: 81561
Buggy source:
protected String getValueAction(){
  return PrintUtils.print(LinqUtils.select(ReflectionUtils.getFields(this,IHasValue.class),field -> ((IHasValue)ReflectionUtils.getFieldValue(field,this)).getValue()));
}

Fixed version (ground truth):
protected String getValueAction(){
  return PrintUtils.print(LinqUtils.select(getFields(this,IHasValue.class),field -> ((IHasValue)getValueField(field,this)).getValue()));
}
Program: 81562
Project: 81562
Buggy source:
public void verify(T entity){
  verify(PrintUtils.objToSetValue(entity),JDISettings.asserter::areEquals);
}

Fixed version (ground truth):
public List<String> verify(T entity){
  return verify(objToSetValue(entity));
}
Program: 81563
Project: 81563
Buggy source:
private Button getSubmitButton(){
  List<Field> fields=ReflectionUtils.getFields(this,IButton.class);
switch (fields.size()) {
case 0:
    throw JDISettings.exception("String_Node_Str",toString());
case 1:
  return (Button)ReflectionUtils.getFieldValue(fields.get(0),this);
default :
throw JDISettings.exception("String_Node_Str",toString());
}
}

Fixed version (ground truth):
private Button getSubmitButton(){
  List<Field> fields=getFields(this,IButton.class);
switch (fields.size()) {
case 0:
    throw exception("String_Node_Str",toString());
case 1:
  return (Button)getValueField(fields.get(0),this);
default :
throw exception("String_Node_Str",toString());
}
}
Program: 81564
Project: 81564
Buggy source:
public void fill(T entity){
  fill(PrintUtils.objToSetValue(entity));
}

Fixed version (ground truth):
public void fill(T entity){
  fill(objToSetValue(entity));
}
Program: 81565
Project: 81565
Buggy source:
private void setText(String text){
  Field field=ReflectionUtils.getFields(this,ISetValue.class).get(0);
  ISetValue setValueElement=(ISetValue)ReflectionUtils.getFieldValue(field,this);
  doActionRule.invoke(text,val -> setValueAction(val,setValueElement));
}

Fixed version (ground truth):
private void setText(String text){
  Field field=getFields(this,ISetValue.class).get(0);
  ISetValue setValueElement=(ISetValue)getValueField(field,this);
  doActionRule.invoke(text,val -> setValueAction(val,setValueElement));
}
Program: 81566
Project: 81566
Buggy source:
private Clickable getClickable(String name){
  List<Field> fields=ReflectionUtils.getFields(this,IClickable.class);
  Collection<Clickable> clickables=select(fields,f -> (Clickable)ReflectionUtils.getFieldValue(f,this));
  return LinqUtils.first(clickables,cl -> cl.getName().contains(getElementName(name.toLowerCase())));
}

Fixed version (ground truth):
private Clickable getClickable(String name){
  List<Field> fields=ReflectionUtils.getFields(this,IClickable.class);
  Collection<Clickable> clickables=select(fields,f -> (Clickable)ReflectionUtils.getValueField(f,this));
  return LinqUtils.first(clickables,cl -> cl.getName().contains(getElementName(name.toLowerCase())));
}
Program: 81567
Project: 81567
Buggy source:
private ITextField getSearchField(){
  List<Field> fields=getFields(this,ITextField.class);
switch (fields.size()) {
case 0:
    throw JDISettings.exception("String_Node_Str",toString());
case 1:
  return (ITextField)getFieldValue(fields.get(0),this);
default :
throw JDISettings.exception("String_Node_Str",toString());
}
}

Fixed version (ground truth):
private ITextField getSearchField(){
  List<Field> fields=getFields(this,ITextField.class);
switch (fields.size()) {
case 0:
    throw JDISettings.exception("String_Node_Str",toString());
case 1:
  return (ITextField)getValueField(fields.get(0),this);
default :
throw JDISettings.exception("String_Node_Str",toString());
}
}
Program: 81568
Project: 81568
Buggy source:
private IButton getSearchButton(){
  List<Field> fields=getFields(this,IButton.class);
switch (fields.size()) {
case 0:
    throw JDISettings.exception("String_Node_Str",toString());
case 1:
  return (IButton)getFieldValue(fields.get(0),this);
default :
throw JDISettings.exception("String_Node_Str",toString());
}
}

Fixed version (ground truth):
private IButton getSearchButton(){
  List<Field> fields=getFields(this,IButton.class);
switch (fields.size()) {
case 0:
    throw JDISettings.exception("String_Node_Str",toString());
case 1:
  return (IButton)getValueField(fields.get(0),this);
default :
throw JDISettings.exception("String_Node_Str",toString());
}
}
Program: 81569
Project: 81569
Buggy source:
public Button getButton(Functions funcName){
  List<Field> fields=getFields(element,IButton.class);
  if (fields.size() == 1)   return (Button)getFieldValue(fields.get(0),element);
  Collection<Button> buttons=LinqUtils.select(fields,f -> (Button)getFieldValue(f,element));
  Button button=LinqUtils.first(buttons,b -> b.function.equals(funcName));
  if (button == null) {
    String name=funcName.name;
    String buttonName=name.toLowerCase().contains("String_Node_Str") ? name : name + "String_Node_Str";
    button=LinqUtils.first(buttons,b -> namesEqual(b.getName(),buttonName));
    if (button == null)     throw JDISettings.exception("String_Node_Str",name,toString());
  }
  return button;
}

Fixed version (ground truth):
public Button getButton(Functions funcName){
  List<Field> fields=getFields(element,IButton.class);
  if (fields.size() == 1)   return (Button)getValueField(fields.get(0),element);
  Collection<Button> buttons=LinqUtils.select(fields,f -> (Button)getValueField(f,element));
  Button button=LinqUtils.first(buttons,b -> b.function.equals(funcName));
  if (button == null) {
    String name=funcName.name;
    String buttonName=name.toLowerCase().contains("String_Node_Str") ? name : name + "String_Node_Str";
    button=LinqUtils.first(buttons,b -> namesEqual(b.getName(),buttonName));
    if (button == null)     throw JDISettings.exception("String_Node_Str",name,toString());
  }
  return button;
}
Program: 81570
Project: 81570
Buggy source:
public Text getTextElement(){
  Field textField=LinqUtils.first(getClass().getDeclaredFields(),f -> (f.getType() == Text.class) || (f.getType() == IText.class));
  if (textField == null)   throw JDISettings.exception("String_Node_Str",toString());
  return (Text)getFieldValue(textField,element);
}

Fixed version (ground truth):
public Text getTextElement(){
  Field textField=LinqUtils.first(getClass().getDeclaredFields(),f -> (f.getType() == Text.class) || (f.getType() == IText.class));
  if (textField == null)   throw JDISettings.exception("String_Node_Str",toString());
  return (Text)getValueField(textField,element);
}
Program: 81571
Project: 81571
Buggy source:
public static List<Field> getFields(Object obj,Class<?> type){
  return where(deepGetFields(obj.getClass()),field -> !isStatic(field.getModifiers()) && (isClass(field,type) || isInterface(field,type)));
}

Fixed version (ground truth):
public static List<Field> getFields(Object obj,Class<?> type){
  return where(obj.getClass().getDeclaredFields(),field -> !isStatic(field.getModifiers()) && (isClass(field,type) || isInterface(field,type)));
}
Program: 81572
Project: 81572
Buggy source:
private static List<Field> deepGetFields(Class<?> clazz){
  List<Field> result=new ArrayList<>();
  if (clazz != BaseElement.class)   result.addAll(deepGetFields(clazz.getSuperclass()));
  result.addAll(Arrays.asList(clazz.getDeclaredFields()));
  return result;
}

Fixed version (ground truth):
public static List<Field> deepGetFields(Object obj,Class<?> type){
  return where(deepGetFields(obj.getClass()),field -> !isStatic(field.getModifiers()) && (isClass(field,type) || isInterface(field,type)));
}
Program: 81573
Project: 81573
Buggy source:
private static void initSubElements(Object parent,Object parentInstance){
  foreach(getFields(parent,IBaseElement.class),field -> setElement(parent,parentInstance,field));
}

Fixed version (ground truth):
private static void initSubElements(Object parent,Object parentInstance){
  foreach(deepGetFields(parent,IBaseElement.class),field -> setElement(parent,parentInstance,field));
}
Program: 81574
Project: 81574
Buggy source:
public String[] footer(){
  if (_footer != null)   return _footer;
  _footer=invoker.doJActionResult("String_Node_Str",this::getFooterAction);
  if (_footer == null || _footer.length == 0)   return new String[]{};
  columns().setCount(_footer.length);
  return _footer;
}

Fixed version (ground truth):
public String[] footer(){
  if (_footer != null)   return getFooter();
  _footer=invoker.doJActionResult("String_Node_Str",this::getFooterAction);
  if (_footer == null || _footer.length == 0)   return new String[]{};
  columns().setCount(_footer.length);
  return getFooter();
}
Program: 81575
Project: 81575
Buggy source:
public void setFooter(final String[] value){
  _footer=value;
}

Fixed version (ground truth):
public void setFooter(String[] value){
  _footer=value.clone();
}
Program: 81576
Project: 81576
Buggy source:
public String[] headers(){
  if (headers != null)   return headers;
  String[] localHeaders=Timer.getResultAction(this::getHeadersTextAction);
  localHeaders=(hasHeader) ? localHeaders : getNumList(localHeaders.length);
  setHeaders(localHeaders);
  if (localHeaders == null || localHeaders.length == 0)   throw exception("String_Node_Str");
  setCount(localHeaders.length);
  return localHeaders;
}

Fixed version (ground truth):
public String[] headers(){
  if (headers != null)   return headers.clone();
  String[] localHeaders=Timer.getResultAction(this::getHeadersTextAction);
  localHeaders=(hasHeader) ? localHeaders : getNumList(localHeaders.length);
  setHeaders(localHeaders);
  if (localHeaders == null || localHeaders.length == 0)   throw exception("String_Node_Str");
  setCount(localHeaders.length);
  return localHeaders;
}
Program: 81577
Project: 81577
Buggy source:
@DataProvider(name="String_Node_Str") public static Object[][] matchText(){
  return new Object[][]{{"String_Node_Str",currentDate()}};
}

Fixed version (ground truth):
@DataProvider(name="String_Node_Str") public static Object[][] matchText(){
  return new Object[][]{{"String_Node_Str",Timer.nowTime("String_Node_Str")}};
}
Program: 81578
Project: 81578
Buggy source:
@DataProvider(name="String_Node_Str") public static Object[][] waitText(){
  return new Object[][]{{currentYear(),currentDate()}};
}

Fixed version (ground truth):
@DataProvider(name="String_Node_Str") public static Object[][] waitText(){
  return new Object[][]{{Timer.nowTime("String_Node_Str"),Timer.nowTime("String_Node_Str")}};
}
Program: 81579
Project: 81579
Buggy source:
@Test public void multiKeyTest() throws Exception {
  BaseScenarioInput.multiKeyTest(this,DatePickerDP.currentDate());
}

Fixed version (ground truth):
@Test public void multiKeyTest() throws Exception {
  BaseScenarioInput.multiKeyTest(this,Timer.nowTime("String_Node_Str"));
}
Program: 81580
Project: 81580
Buggy source:
@Test public void newInputTest() throws Exception {
  BaseScenarioInput.newInputTest(this,DatePickerDP.currentDate());
}

Fixed version (ground truth):
@Test public void newInputTest() throws Exception {
  BaseScenarioInput.newInputTest(this,Timer.nowTime("String_Node_Str"));
}
Program: 81581
Project: 81581
Buggy source:
@BeforeMethod public void before(final Method method) throws Exception {
  isInState(_onPage,method);
}

Fixed version (ground truth):
@BeforeMethod public void before(final Method method){
  isInState(_onPage,method);
}
Program: 81582
Project: 81582
Buggy source:
protected void checkAction(){
  if (!isCheckedAction())   clickAction();
}

Fixed version (ground truth):
protected void checkAction(){
  if (!isCheckedAction())   clickAction();
  if (!isCheckedAction())   throw asserter.exception("String_Node_Str");
}
Program: 81583
Project: 81583
Buggy source:
protected void uncheckAction(){
  if (isCheckedAction())   clickAction();
}

Fixed version (ground truth):
protected void uncheckAction(){
  if (isCheckedAction())   clickAction();
  if (isCheckedAction())   throw asserter.exception("String_Node_Str");
}
Program: 81584
Project: 81584
Buggy source:
protected boolean isCheckedAction(){
  return getWebElement().isSelected();
}

Fixed version (ground truth):
protected boolean isCheckedAction(){
  return isCheckedFunc.invoke(getWebElement());
}
Program: 81585
Project: 81585
Buggy source:
public String rowName(){
  return (rowName != null && !rowName.equals("String_Node_Str")) ? rowName : table.rows().headers()[rowNum];
}

Fixed version (ground truth):
public String rowName(){
  return (rowName != null && !rowName.equals("String_Node_Str")) ? rowName : table.rows().headers()[rowNum - 1];
}
Program: 81586
Project: 81586
Buggy source:
public String columnName(){
  return (columnName != null && !columnName.equals("String_Node_Str")) ? columnName : table.columns().headers()[columnNum];
}

Fixed version (ground truth):
public String columnName(){
  return (columnName != null && !columnName.equals("String_Node_Str")) ? columnName : table.columns().headers()[columnNum - 1];
}
Program: 81587
Project: 81587
Buggy source:
protected List<WebElement> getHeadersAction(){
  return table.getWebElement().findElements(columnsHeadersTemplate);
}

Fixed version (ground truth):
protected List<WebElement> getHeadersAction(){
  List<WebElement> headers=table.getWebElement().findElements(columnsHeadersLocator);
  return (table.rows().hasHeader) ? listCopy(headers,1,WebElement.class) : headers;
}
Program: 81588
Project: 81588
Buggy source:
protected List<WebElement> getHeadersAction(){
  return table.getWebElement().findElements(rowsHeadersTemplate);
}

Fixed version (ground truth):
protected List<WebElement> getHeadersAction(){
  return table.getWebElement().findElements(rowsHeadersLocator);
}
Program: 81589
Project: 81589
Buggy source:
public Table(By tableLocator,Class<?>... columnsTemplate){
  this(tableLocator);
  this.columnsTemplate=columnsTemplate;
}

Fixed version (ground truth):
public Table(TableSettings settings){
  this();
  rows().hasHeader=settings.rowHasHeaders;
  rows().headers=settings.rowHeaders;
  rows().count=settings.rowsCount;
  columns().hasHeader=settings.columnHasHeaders;
  columns().headers=settings.columnHeaders;
  columns().count=settings.columnsCount;
}
Program: 81590
Project: 81590
Buggy source:
public final String[] headers(){
  if (headers != null)   return headers;
  String[] localHeaders=Timer.getResultAction(this::getHeadersTextAction);
  localHeaders=(hasHeader) ? localHeaders : getNumList(localHeaders.length);
  setHeaders(localHeaders);
  if (localHeaders == null || localHeaders.length == 0)   throw exception("String_Node_Str");
  setCount(localHeaders.length);
  return localHeaders;
}

Fixed version (ground truth):
public String[] headers(){
  if (headers != null)   return headers;
  String[] localHeaders=Timer.getResultAction(this::getHeadersTextAction);
  localHeaders=(hasHeader) ? localHeaders : getNumList(localHeaders.length);
  setHeaders(localHeaders);
  if (localHeaders == null || localHeaders.length == 0)   throw exception("String_Node_Str");
  setCount(localHeaders.length);
  return localHeaders;
}