nus-yam/ex-repair huggingface dataset:
Program: 25290
Project: 25290
Buggy source:
private FactTable createFactTable(String factName,String[] storages,String[] updatePeriods){
  FactTable f=cubeObjectFactory.createFactTable();
  f.setName(factName);
  f.setWeight(10.0);
  f.setCubeName("String_Node_Str");
  Columns cols=cubeObjectFactory.createColumns();
  Column c1=cubeObjectFactory.createColumn();
  c1.setName("String_Node_Str");
  c1.setType("String_Node_Str");
  c1.setComment("String_Node_Str");
  cols.getColumns().add(c1);
  Column c2=cubeObjectFactory.createColumn();
  c2.setName("String_Node_Str");
  c2.setType("String_Node_Str");
  c2.setComment("String_Node_Str");
  cols.getColumns().add(c2);
  f.setColumns(cols);
  Map<String,String> properties=new HashMap<String,String>();
  properties.put("String_Node_Str","String_Node_Str");
  f.setProperties(JAXBUtils.xPropertiesFromMap(properties));
  UpdatePeriods upd=cubeObjectFactory.createUpdatePeriods();
  for (int i=0; i < storages.length; i++) {
    UpdatePeriodElement uel=cubeObjectFactory.createUpdatePeriodElement();
    uel.setStorageName(storages[i]);
    uel.getUpdatePeriods().add(updatePeriods[i]);
    upd.getUpdatePeriodElement().add(uel);
  }
  f.setStorageUpdatePeriods(upd);
  return f;
}

Fixed version (ground truth):
private FactTable createFactTable(String factName,String[] storages,String[] updatePeriods,final String cubeName){
  FactTable f=cubeObjectFactory.createFactTable();
  f.setName(factName);
  f.setWeight(10.0);
  f.setCubeName(cubeName);
  Columns cols=cubeObjectFactory.createColumns();
  Column c1=cubeObjectFactory.createColumn();
  c1.setName("String_Node_Str");
  c1.setType("String_Node_Str");
  c1.setComment("String_Node_Str");
  cols.getColumns().add(c1);
  Column c2=cubeObjectFactory.createColumn();
  c2.setName("String_Node_Str");
  c2.setType("String_Node_Str");
  c2.setComment("String_Node_Str");
  cols.getColumns().add(c2);
  f.setColumns(cols);
  Map<String,String> properties=new HashMap<String,String>();
  properties.put("String_Node_Str","String_Node_Str");
  f.setProperties(JAXBUtils.xPropertiesFromMap(properties));
  UpdatePeriods upd=cubeObjectFactory.createUpdatePeriods();
  for (int i=0; i < storages.length; i++) {
    UpdatePeriodElement uel=cubeObjectFactory.createUpdatePeriodElement();
    uel.setStorageName(storages[i]);
    uel.getUpdatePeriods().add(updatePeriods[i]);
    upd.getUpdatePeriodElement().add(uel);
  }
  f.setStorageUpdatePeriods(upd);
  return f;
}
Program: 25292
Project: 25292
Buggy source:
private XStorageTableElement createStorageTblElement(String storageName,String table,String... updatePeriod){
  XStorageTableElement tbl=cubeObjectFactory.createXStorageTableElement();
  tbl.setStorageName(storageName);
  if (updatePeriod != null) {
    for (    String p : updatePeriod) {
      tbl.getUpdatePeriods().add(p);
    }
  }
  tbl.setTableDesc(createStorageTableDesc(table));
  return tbl;
}

Fixed version (ground truth):
private XStorageTableElement createStorageTblElement(String storageName,String table,final String[] timePartColNames,String... updatePeriod){
  XStorageTableElement tbl=cubeObjectFactory.createXStorageTableElement();
  tbl.setStorageName(storageName);
  if (updatePeriod != null) {
    for (    String p : updatePeriod) {
      tbl.getUpdatePeriods().add(p);
    }
  }
  tbl.setTableDesc(createStorageTableDesc(table,timePartColNames));
  return tbl;
}
Program: 25293
Project: 25293
Buggy source:
private XStorageTableDesc createStorageTableDesc(String name){
  XStorageTableDesc xs1=cubeObjectFactory.createXStorageTableDesc();
  xs1.setCollectionDelimiter("String_Node_Str");
  xs1.setEscapeChar("String_Node_Str");
  xs1.setFieldDelimiter("String_Node_Str");
  xs1.setFieldDelimiter("String_Node_Str");
  xs1.setLineDelimiter("String_Node_Str");
  xs1.setMapKeyDelimiter("String_Node_Str");
  xs1.setTableLocation("String_Node_Str" + name);
  xs1.setExternal(true);
  Columns partCols=cubeObjectFactory.createColumns();
  Column dt=cubeObjectFactory.createColumn();
  dt.setName("String_Node_Str");
  dt.setType("String_Node_Str");
  dt.setComment("String_Node_Str");
  partCols.getColumns().add(dt);
  xs1.getTimePartCols().add("String_Node_Str");
  xs1.setPartCols(partCols);
  return xs1;
}

Fixed version (ground truth):
private XStorageTableDesc createStorageTableDesc(String name,final String[] timePartColNames){
  XStorageTableDesc xs1=cubeObjectFactory.createXStorageTableDesc();
  xs1.setCollectionDelimiter("String_Node_Str");
  xs1.setEscapeChar("String_Node_Str");
  xs1.setFieldDelimiter("String_Node_Str");
  xs1.setFieldDelimiter("String_Node_Str");
  xs1.setLineDelimiter("String_Node_Str");
  xs1.setMapKeyDelimiter("String_Node_Str");
  xs1.setTableLocation("String_Node_Str" + name);
  xs1.setExternal(true);
  Columns timePartCols=cubeObjectFactory.createColumns();
  for (  String timePartColName : timePartColNames) {
    Column partCol=cubeObjectFactory.createColumn();
    partCol.setName(timePartColName);
    partCol.setType("String_Node_Str");
    partCol.setComment("String_Node_Str");
    timePartCols.getColumns().add(partCol);
    xs1.getTimePartCols().add(timePartColName);
  }
  xs1.setPartCols(timePartCols);
  return xs1;
}
Program: 25294
Project: 25294
Buggy source:
private XPartition createPartition(String cubeTableName,Date partDate){
  XPartition xp=cubeObjectFactory.createXPartition();
  xp.setLocation("String_Node_Str");
  xp.setCubeTableName(cubeTableName);
  XTimePartSpec timeSpec=cubeObjectFactory.createXTimePartSpec();
  XTimePartSpecElement timePart=cubeObjectFactory.createXTimePartSpecElement();
  timePart.setKey("String_Node_Str");
  timePart.setValue(JAXBUtils.getXMLGregorianCalendar(partDate));
  timeSpec.getPartSpecElement().add(timePart);
  xp.setTimePartitionSpec(timeSpec);
  xp.setUpdatePeriod("String_Node_Str");
  return xp;
}

Fixed version (ground truth):
private XPartition createPartition(String cubeTableName,final List<XTimePartSpecElement> timePartSpecs){
  XPartition xp=cubeObjectFactory.createXPartition();
  xp.setLocation("String_Node_Str");
  xp.setCubeTableName(cubeTableName);
  XTimePartSpec timeSpec=cubeObjectFactory.createXTimePartSpec();
  for (  XTimePartSpecElement timePartSpec : timePartSpecs) {
    timeSpec.getPartSpecElement().add(timePartSpec);
  }
  xp.setTimePartitionSpec(timeSpec);
  xp.setUpdatePeriod("String_Node_Str");
  return xp;
}
Program: 25295
Project: 25295
Buggy source:
private FactTable createFactTable(String factName,String[] storages,String[] updatePeriods){
  FactTable f=cubeObjectFactory.createFactTable();
  f.setName(factName);
  f.setWeight(10.0);
  f.setCubeName("String_Node_Str");
  Columns cols=cubeObjectFactory.createColumns();
  Column c1=cubeObjectFactory.createColumn();
  c1.setName("String_Node_Str");
  c1.setType("String_Node_Str");
  c1.setComment("String_Node_Str");
  cols.getColumns().add(c1);
  Column c2=cubeObjectFactory.createColumn();
  c2.setName("String_Node_Str");
  c2.setType("String_Node_Str");
  c2.setComment("String_Node_Str");
  cols.getColumns().add(c2);
  f.setColumns(cols);
  Map<String,String> properties=new HashMap<String,String>();
  properties.put("String_Node_Str","String_Node_Str");
  f.setProperties(JAXBUtils.xPropertiesFromMap(properties));
  UpdatePeriods upd=cubeObjectFactory.createUpdatePeriods();
  for (int i=0; i < storages.length; i++) {
    UpdatePeriodElement uel=cubeObjectFactory.createUpdatePeriodElement();
    uel.setStorageName(storages[i]);
    uel.getUpdatePeriods().add(updatePeriods[i]);
    upd.getUpdatePeriodElement().add(uel);
  }
  f.setStorageUpdatePeriods(upd);
  return f;
}

Fixed version (ground truth):
private FactTable createFactTable(String factName,String[] storages,String[] updatePeriods,final String cubeName){
  FactTable f=cubeObjectFactory.createFactTable();
  f.setName(factName);
  f.setWeight(10.0);
  f.setCubeName(cubeName);
  Columns cols=cubeObjectFactory.createColumns();
  Column c1=cubeObjectFactory.createColumn();
  c1.setName("String_Node_Str");
  c1.setType("String_Node_Str");
  c1.setComment("String_Node_Str");
  cols.getColumns().add(c1);
  Column c2=cubeObjectFactory.createColumn();
  c2.setName("String_Node_Str");
  c2.setType("String_Node_Str");
  c2.setComment("String_Node_Str");
  cols.getColumns().add(c2);
  f.setColumns(cols);
  Map<String,String> properties=new HashMap<String,String>();
  properties.put("String_Node_Str","String_Node_Str");
  f.setProperties(JAXBUtils.xPropertiesFromMap(properties));
  UpdatePeriods upd=cubeObjectFactory.createUpdatePeriods();
  for (int i=0; i < storages.length; i++) {
    UpdatePeriodElement uel=cubeObjectFactory.createUpdatePeriodElement();
    uel.setStorageName(storages[i]);
    uel.getUpdatePeriods().add(updatePeriods[i]);
    upd.getUpdatePeriodElement().add(uel);
  }
  f.setStorageUpdatePeriods(upd);
  return f;
}
Program: 25299
Project: 25299
Buggy source:
/** 
 * Adds the dim1 table.
 * @param tableName the table name
 * @param specName the spec name
 * @param storageSpecName the storage spec name
 * @param storageName the storage name
 */
public static void addDim1Table(String tableName,String specName,String storageSpecName,String storageName){
  LensDimensionTableCommands command=getCommand();
  String dimList=command.showDimensionTables();
  Assert.assertEquals("String_Node_Str",dimList,"String_Node_Str");
  TestLensStorageCommands.addLocalStorage(storageName);
  URL dimSpec=TestLensDimensionTableCommands.class.getClassLoader().getResource(specName);
  URL factStorageSpec=TestLensDimensionTableCommands.class.getClassLoader().getResource(storageSpecName);
  try {
    command.createDimensionTable(new File(dimSpec.toURI()).getAbsolutePath() + "String_Node_Str" + new File(factStorageSpec.toURI()).getAbsolutePath());
  }
 catch (  Exception e) {
    e.printStackTrace();
    Assert.fail("String_Node_Str" + e.getMessage());
  }
  dimList=command.showDimensionTables();
  Assert.assertEquals(tableName,dimList,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Adds the dim1 table.
 * @param tableName the table name
 * @param specName the spec name
 * @param storageSpecName the storage spec name
 * @param storageName the storage name
 */
public synchronized static void addDim1Table(String tableName,String specName,String storageSpecName,String storageName){
  LensDimensionTableCommands command=getCommand();
  String dimList=command.showDimensionTables();
  TestLensStorageCommands.addLocalStorage(storageName);
  URL dimSpec=TestLensDimensionTableCommands.class.getClassLoader().getResource(specName);
  URL factStorageSpec=TestLensDimensionTableCommands.class.getClassLoader().getResource(storageSpecName);
  try {
    command.createDimensionTable(new File(dimSpec.toURI()).getAbsolutePath() + "String_Node_Str" + new File(factStorageSpec.toURI()).getAbsolutePath());
  }
 catch (  Exception e) {
    e.printStackTrace();
    Assert.fail("String_Node_Str" + e.getMessage());
  }
  dimList=command.showDimensionTables();
  Assert.assertTrue(dimList.contains(tableName),"String_Node_Str");
}
Program: 25305
Project: 25305
Buggy source:
/** 
 * Format result set.
 * @param rs the rs
 * @return the string
 */
private String formatResultSet(LensClient.LensClientResultSetWithStats rs){
  StringBuilder b=new StringBuilder();
  int i=0;
  if (rs.getResultSet() != null) {
    QueryResultSetMetadata resultSetMetadata=rs.getResultSet().getResultSetMetadata();
    for (    ResultColumn column : resultSetMetadata.getColumns()) {
      b.append(column.getName()).append("String_Node_Str");
    }
    b.append("String_Node_Str");
    QueryResult r=rs.getResultSet().getResult();
    if (r instanceof InMemoryQueryResult) {
      InMemoryQueryResult temp=(InMemoryQueryResult)r;
      for (      ResultRow row : temp.getRows()) {
        for (        Object col : row.getValues()) {
          b.append(col).append("String_Node_Str");
        }
        i++;
        b.append("String_Node_Str");
      }
    }
 else {
      PersistentQueryResult temp=(PersistentQueryResult)r;
      b.append("String_Node_Str").append(temp.getPersistedURI()).append("String_Node_Str");
    }
  }
  if (rs.getQuery() != null) {
    long submissionTime=rs.getQuery().getSubmissionTime();
    long endTime=rs.getQuery().getFinishTime();
    b.append(i).append("String_Node_Str").append(endTime > 0 ? ((endTime - submissionTime) / 1000) : 0).append("String_Node_Str");
  }
  return b.toString();
}

Fixed version (ground truth):
/** 
 * Format result set.
 * @param rs the rs
 * @return the string
 */
private String formatResultSet(LensClient.LensClientResultSetWithStats rs){
  StringBuilder b=new StringBuilder();
  int numRows=0;
  if (rs.getResultSet() != null) {
    QueryResultSetMetadata resultSetMetadata=rs.getResultSet().getResultSetMetadata();
    for (    ResultColumn column : resultSetMetadata.getColumns()) {
      b.append(column.getName()).append("String_Node_Str");
    }
    b.append("String_Node_Str");
    QueryResult r=rs.getResultSet().getResult();
    if (r instanceof InMemoryQueryResult) {
      InMemoryQueryResult temp=(InMemoryQueryResult)r;
      for (      ResultRow row : temp.getRows()) {
        for (        Object col : row.getValues()) {
          b.append(col).append("String_Node_Str");
        }
        numRows++;
        b.append("String_Node_Str");
      }
    }
 else {
      PersistentQueryResult temp=(PersistentQueryResult)r;
      numRows=temp.getNumRows();
      b.append("String_Node_Str").append(temp.getPersistedURI()).append("String_Node_Str");
    }
  }
  if (rs.getQuery() != null) {
    long submissionTime=rs.getQuery().getSubmissionTime();
    long endTime=rs.getQuery().getFinishTime();
    b.append(numRows).append("String_Node_Str").append(endTime > 0 ? ((endTime - submissionTime) / 1000) : 0).append("String_Node_Str");
  }
  return b.toString();
}
Program: 25306
Project: 25306
Buggy source:
/** 
 * Format result set.
 * @param rs the rs
 * @return the string
 */
private String formatResultSet(LensClient.LensClientResultSetWithStats rs){
  StringBuilder b=new StringBuilder();
  int i=0;
  if (rs.getResultSet() != null) {
    QueryResultSetMetadata resultSetMetadata=rs.getResultSet().getResultSetMetadata();
    for (    ResultColumn column : resultSetMetadata.getColumns()) {
      b.append(column.getName()).append("String_Node_Str");
    }
    b.append("String_Node_Str");
    QueryResult r=rs.getResultSet().getResult();
    if (r instanceof InMemoryQueryResult) {
      InMemoryQueryResult temp=(InMemoryQueryResult)r;
      for (      ResultRow row : temp.getRows()) {
        for (        Object col : row.getValues()) {
          b.append(col).append("String_Node_Str");
        }
        i++;
        b.append("String_Node_Str");
      }
    }
 else {
      PersistentQueryResult temp=(PersistentQueryResult)r;
      b.append("String_Node_Str").append(temp.getPersistedURI()).append("String_Node_Str");
    }
  }
  if (rs.getQuery() != null) {
    long submissionTime=rs.getQuery().getSubmissionTime();
    long endTime=rs.getQuery().getFinishTime();
    b.append(i).append("String_Node_Str").append(endTime > 0 ? ((endTime - submissionTime) / 1000) : 0).append("String_Node_Str");
  }
  return b.toString();
}

Fixed version (ground truth):
/** 
 * Format result set.
 * @param rs the rs
 * @return the string
 */
private String formatResultSet(LensClient.LensClientResultSetWithStats rs){
  StringBuilder b=new StringBuilder();
  int numRows=0;
  if (rs.getResultSet() != null) {
    QueryResultSetMetadata resultSetMetadata=rs.getResultSet().getResultSetMetadata();
    for (    ResultColumn column : resultSetMetadata.getColumns()) {
      b.append(column.getName()).append("String_Node_Str");
    }
    b.append("String_Node_Str");
    QueryResult r=rs.getResultSet().getResult();
    if (r instanceof InMemoryQueryResult) {
      InMemoryQueryResult temp=(InMemoryQueryResult)r;
      for (      ResultRow row : temp.getRows()) {
        for (        Object col : row.getValues()) {
          b.append(col).append("String_Node_Str");
        }
        numRows++;
        b.append("String_Node_Str");
      }
    }
 else {
      PersistentQueryResult temp=(PersistentQueryResult)r;
      numRows=temp.getNumRows();
      b.append("String_Node_Str").append(temp.getPersistedURI()).append("String_Node_Str");
    }
  }
  if (rs.getQuery() != null) {
    long submissionTime=rs.getQuery().getSubmissionTime();
    long endTime=rs.getQuery().getFinishTime();
    b.append(numRows).append("String_Node_Str").append(endTime > 0 ? ((endTime - submissionTime) / 1000) : 0).append("String_Node_Str");
  }
  return b.toString();
}
Program: 25307
Project: 25307
Buggy source:
protected List<String> getExpectedCSVRowsWithoutComma(){
  List<String> csvRows=new ArrayList<String>();
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str" + "String_Node_Str");
  csvRows.add("String_Node_Str");
  return csvRows;
}

Fixed version (ground truth):
protected abstract List<String> getExpectedCSVRowsWithoutComma();
Program: 25308
Project: 25308
Buggy source:
protected List<String> getExpectedCSVRowsWithMultipleWithoutComma(){
  List<String> csvRows=new ArrayList<String>();
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str" + "String_Node_Str");
  csvRows.add("String_Node_Str");
  return csvRows;
}

Fixed version (ground truth):
protected abstract List<String> getExpectedCSVRowsWithMultipleWithoutComma();
Program: 25309
Project: 25309
Buggy source:
protected List<String> getExpectedTextRowsWithMultipleWithoutComma(){
  List<String> txtRows=new ArrayList<String>();
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  return txtRows;
}

Fixed version (ground truth):
protected abstract List<String> getExpectedTextRowsWithMultipleWithoutComma();
Program: 25310
Project: 25310
Buggy source:
protected List<String> getExpectedTextRowsWithMultiple(){
  List<String> txtRows=new ArrayList<String>();
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  return txtRows;
}

Fixed version (ground truth):
protected abstract List<String> getExpectedTextRowsWithMultiple();
Program: 25311
Project: 25311
Buggy source:
protected List<String> getExpectedCSVRowsWithMultiple(){
  List<String> csvRows=new ArrayList<String>();
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str" + "String_Node_Str");
  csvRows.add("String_Node_Str");
  return csvRows;
}

Fixed version (ground truth):
protected abstract List<String> getExpectedCSVRowsWithMultiple();
Program: 25312
Project: 25312
Buggy source:
protected List<String> getExpectedCSVRows(){
  List<String> csvRows=new ArrayList<String>();
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str" + "String_Node_Str");
  csvRows.add("String_Node_Str");
  return csvRows;
}

Fixed version (ground truth):
protected abstract List<String> getExpectedCSVRows();
Program: 25313
Project: 25313
Buggy source:
protected List<String> getExpectedTextRows(){
  List<String> txtRows=new ArrayList<String>();
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  return txtRows;
}

Fixed version (ground truth):
protected abstract List<String> getExpectedTextRows();
Program: 25314
Project: 25314
Buggy source:
protected List<String> getExpectedTextRowsWithoutComma(){
  List<String> txtRows=new ArrayList<String>();
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  return txtRows;
}

Fixed version (ground truth):
protected abstract List<String> getExpectedTextRowsWithoutComma();
Program: 25315
Project: 25315
Buggy source:
protected List<String> getExpectedCSVRowsWithoutComma(){
  List<String> csvRows=new ArrayList<String>();
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str" + "String_Node_Str");
  csvRows.add("String_Node_Str");
  return csvRows;
}

Fixed version (ground truth):
protected abstract List<String> getExpectedCSVRowsWithoutComma();
Program: 25316
Project: 25316
Buggy source:
protected List<String> getExpectedCSVRowsWithMultipleWithoutComma(){
  List<String> csvRows=new ArrayList<String>();
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str" + "String_Node_Str");
  csvRows.add("String_Node_Str");
  return csvRows;
}

Fixed version (ground truth):
protected abstract List<String> getExpectedCSVRowsWithMultipleWithoutComma();
Program: 25317
Project: 25317
Buggy source:
protected List<String> getExpectedTextRowsWithMultipleWithoutComma(){
  List<String> txtRows=new ArrayList<String>();
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  return txtRows;
}

Fixed version (ground truth):
protected abstract List<String> getExpectedTextRowsWithMultipleWithoutComma();
Program: 25318
Project: 25318
Buggy source:
protected List<String> getExpectedTextRowsWithMultiple(){
  List<String> txtRows=new ArrayList<String>();
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  return txtRows;
}

Fixed version (ground truth):
protected abstract List<String> getExpectedTextRowsWithMultiple();
Program: 25319
Project: 25319
Buggy source:
protected List<String> getExpectedCSVRowsWithMultiple(){
  List<String> csvRows=new ArrayList<String>();
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str" + "String_Node_Str");
  csvRows.add("String_Node_Str");
  return csvRows;
}

Fixed version (ground truth):
protected abstract List<String> getExpectedCSVRowsWithMultiple();
Program: 25320
Project: 25320
Buggy source:
protected List<String> getExpectedCSVRows(){
  List<String> csvRows=new ArrayList<String>();
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str");
  csvRows.add("String_Node_Str" + "String_Node_Str");
  csvRows.add("String_Node_Str");
  return csvRows;
}

Fixed version (ground truth):
protected abstract List<String> getExpectedCSVRows();
Program: 25321
Project: 25321
Buggy source:
protected List<String> getExpectedTextRows(){
  List<String> txtRows=new ArrayList<String>();
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  return txtRows;
}

Fixed version (ground truth):
protected abstract List<String> getExpectedTextRows();
Program: 25322
Project: 25322
Buggy source:
protected List<String> getExpectedTextRowsWithoutComma(){
  List<String> txtRows=new ArrayList<String>();
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  txtRows.add("String_Node_Str");
  return txtRows;
}

Fixed version (ground truth):
protected abstract List<String> getExpectedTextRowsWithoutComma();
Program: 25323
Project: 25323
Buggy source:
/** 
 * Close a Lens server session.
 * @param publicId Session's public id of the session to be closed
 * @return APIResult object indicating if the operation was successful (check result.getStatus())
 */
@DELETE @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML,MediaType.TEXT_PLAIN}) public APIResult closeSession(@QueryParam("String_Node_Str") UUID publicId){
  LensSessionHandle sessionHandle=openSessions.get(publicId);
  checkSessionHandle(sessionHandle);
  openSessions.remove(publicId);
  try {
    sessionService.closeSession(sessionHandle);
  }
 catch (  LensException e) {
    return new APIResult(Status.FAILED,e.getMessage());
  }
  return new APIResult(Status.SUCCEEDED,"String_Node_Str" + sessionHandle + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Close a Lens server session.
 * @param publicId Session's public id of the session to be closed
 * @return APIResult object indicating if the operation was successful (check result.getStatus())
 */
@DELETE @Path("String_Node_Str") @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML,MediaType.TEXT_PLAIN}) public APIResult closeSession(@PathParam("String_Node_Str") UUID publicId){
  LOG.info("String_Node_Str" + publicId);
  LensSessionHandle sessionHandle=openSessions.get(publicId);
  checkSessionHandle(sessionHandle);
  openSessions.remove(publicId);
  try {
    sessionService.closeSession(sessionHandle);
  }
 catch (  LensException e) {
    return new APIResult(Status.FAILED,e.getMessage());
  }
  return new APIResult(Status.SUCCEEDED,"String_Node_Str" + sessionHandle + "String_Node_Str");
}
Program: 25326
Project: 25326
Buggy source:
/** 
 * Close a Lens server session.
 * @param publicId Session's public id of the session to be closed
 * @return APIResult object indicating if the operation was successful (check result.getStatus())
 */
@DELETE @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML,MediaType.TEXT_PLAIN}) public APIResult closeSession(@QueryParam("String_Node_Str") UUID publicId){
  LensSessionHandle sessionHandle=openSessions.get(publicId);
  checkSessionHandle(sessionHandle);
  openSessions.remove(publicId);
  try {
    sessionService.closeSession(sessionHandle);
  }
 catch (  LensException e) {
    return new APIResult(Status.FAILED,e.getMessage());
  }
  return new APIResult(Status.SUCCEEDED,"String_Node_Str" + sessionHandle + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Close a Lens server session.
 * @param publicId Session's public id of the session to be closed
 * @return APIResult object indicating if the operation was successful (check result.getStatus())
 */
@DELETE @Path("String_Node_Str") @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML,MediaType.TEXT_PLAIN}) public APIResult closeSession(@PathParam("String_Node_Str") UUID publicId){
  LOG.info("String_Node_Str" + publicId);
  LensSessionHandle sessionHandle=openSessions.get(publicId);
  checkSessionHandle(sessionHandle);
  openSessions.remove(publicId);
  try {
    sessionService.closeSession(sessionHandle);
  }
 catch (  LensException e) {
    return new APIResult(Status.FAILED,e.getMessage());
  }
  return new APIResult(Status.SUCCEEDED,"String_Node_Str" + sessionHandle + "String_Node_Str");
}
Program: 25327
Project: 25327
Buggy source:
@Override public void stop(){
  List<Runnable> pending=eventHandlerPool.shutdownNow();
  if (pending != null && !pending.isEmpty()) {
    StringBuilder pendingMsg=new StringBuilder("String_Node_Str");
    for (    Runnable handler : pending) {
      if (handler instanceof EventHandler) {
        pendingMsg.append(((EventHandler)handler).event.getEventId()).append("String_Node_Str");
      }
    }
    LOG.info("String_Node_Str" + pending.size() + "String_Node_Str");
    LOG.info(pendingMsg.toString());
  }
  super.stop();
  LOG.info("String_Node_Str");
}

Fixed version (ground truth):
@Override public void stop(){
  if (eventHandlerPool != null) {
    List<Runnable> pending=eventHandlerPool.shutdownNow();
    if (pending != null && !pending.isEmpty()) {
      StringBuilder pendingMsg=new StringBuilder("String_Node_Str");
      for (      Runnable handler : pending) {
        if (handler instanceof EventHandler) {
          pendingMsg.append(((EventHandler)handler).event.getEventId()).append("String_Node_Str");
        }
      }
      LOG.info("String_Node_Str" + pending.size() + "String_Node_Str");
      LOG.info(pendingMsg.toString());
    }
  }
  LOG.info("String_Node_Str");
  super.stop();
}
Program: 25328
Project: 25328
Buggy source:
/** 
 * Persist lens service state.
 * @throws IOException Signals that an I/O exception has occurred.
 */
private synchronized void persistLensServiceState() throws IOException {
  if (conf.getBoolean(LensConfConstants.SERVER_RESTART_ENABLED,LensConfConstants.DEFAULT_SERVER_RESTART_ENABLED)) {
    FileSystem fs=persistDir.getFileSystem(conf);
    LOG.info("String_Node_Str" + persistDir);
    for (    LensService service : lensServices) {
      LOG.info("String_Node_Str" + service.getName());
      Path serviceWritePath=new Path(persistDir,service.getName() + "String_Node_Str");
      ObjectOutputStream out=null;
      try {
        out=new ObjectOutputStream(fs.create(serviceWritePath));
        service.writeExternal(out);
      }
  finally {
        if (out != null) {
          out.close();
        }
      }
      Path servicePath=getServicePersistPath(service);
      fs.rename(serviceWritePath,servicePath);
      LOG.info("String_Node_Str" + service.getName() + "String_Node_Str"+ servicePath);
    }
  }
 else {
    LOG.info("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Persist lens service state.
 * @throws IOException Signals that an I/O exception has occurred.
 */
private synchronized void persistLensServiceState() throws IOException {
  if (conf.getBoolean(LensConfConstants.SERVER_RESTART_ENABLED,LensConfConstants.DEFAULT_SERVER_RESTART_ENABLED)) {
    if (persistDir != null) {
      FileSystem fs=persistDir.getFileSystem(conf);
      LOG.info("String_Node_Str" + persistDir);
      for (      LensService service : lensServices) {
        LOG.info("String_Node_Str" + service.getName());
        Path serviceWritePath=new Path(persistDir,service.getName() + "String_Node_Str");
        ObjectOutputStream out=null;
        try {
          out=new ObjectOutputStream(fs.create(serviceWritePath));
          service.writeExternal(out);
        }
  finally {
          if (out != null) {
            out.close();
          }
        }
        Path servicePath=getServicePersistPath(service);
        fs.rename(serviceWritePath,servicePath);
        LOG.info("String_Node_Str" + service.getName() + "String_Node_Str"+ servicePath);
      }
    }
  }
 else {
    LOG.info("String_Node_Str");
  }
}
Program: 25329
Project: 25329
Buggy source:
@Override public synchronized void stop(){
  LensEventService eventService=(LensEventService)LensServices.get().getService(LensEventService.NAME);
  eventService.removeListener(queryStatusListener);
  queryStatusListener.stop();
  for (  ScheduledReporter reporter : reporters) {
    reporter.stop();
  }
  LOG.info("String_Node_Str");
  super.stop();
}

Fixed version (ground truth):
@Override public synchronized void stop(){
  LensEventService eventService=(LensEventService)LensServices.get().getService(LensEventService.NAME);
  if (eventService != null) {
    eventService.removeListener(queryStatusListener);
  }
  if (queryStatusListener != null) {
    queryStatusListener.stop();
  }
  if (reporters != null) {
    for (    ScheduledReporter reporter : reporters) {
      reporter.stop();
    }
  }
  LOG.info("String_Node_Str");
  super.stop();
}
Program: 25330
Project: 25330
Buggy source:
@Test public void testCubeDriverRestart() throws Exception {
  CubeGrillDriver cubeDriver=new CubeGrillDriver(conf);
  String query="String_Node_Str";
  DriverQueryPlan plan=cubeDriver.explain(query,conf);
  String planString=plan.getPlan();
  Assert.assertEquals(query,planString);
  cubeDriver.executePrepareAsync(plan.getHandle(),conf);
  Assert.assertEquals(cubeDriver.getStatus(plan.getHandle()).getStatus(),QueryStatus.Status.SUCCESSFUL);
  ByteArrayOutputStream driverOut=new ByteArrayOutputStream();
  ObjectOutputStream out=new ObjectOutputStream(driverOut);
  cubeDriver.writeExternal(out);
  out.close();
  System.out.println(Arrays.toString(driverOut.toByteArray()));
  ByteArrayInputStream driverIn=new ByteArrayInputStream(driverOut.toByteArray());
  CubeGrillDriver newDriver=new CubeGrillDriver(conf);
  newDriver.readExternal(new ObjectInputStream(driverIn));
  driverIn.close();
  Assert.assertEquals(newDriver.getDrivers().size(),cubeDriver.getDrivers().size());
  Assert.assertEquals(cubeDriver.getStatus(plan.getHandle()).getStatus(),QueryStatus.Status.SUCCESSFUL);
}

Fixed version (ground truth):
@Test public void testCubeDriverRestart() throws Exception {
  CubeGrillDriver cubeDriver=new CubeGrillDriver(conf);
  String query="String_Node_Str";
  QueryHandle handle=cubeDriver.executeAsync(query,conf);
  ByteArrayOutputStream driverOut=new ByteArrayOutputStream();
  ObjectOutputStream out=new ObjectOutputStream(driverOut);
  cubeDriver.writeExternal(out);
  out.close();
  System.out.println(Arrays.toString(driverOut.toByteArray()));
  ByteArrayInputStream driverIn=new ByteArrayInputStream(driverOut.toByteArray());
  CubeGrillDriver newDriver=new CubeGrillDriver(conf);
  newDriver.readExternal(new ObjectInputStream(driverIn));
  driverIn.close();
  Assert.assertEquals(newDriver.getDrivers().size(),cubeDriver.getDrivers().size());
  Assert.assertEquals(cubeDriver.getStatus(handle).getStatus(),QueryStatus.Status.SUCCESSFUL);
}
Program: 25331
Project: 25331
Buggy source:
@Test public void testCubeDriver() throws Exception {
  String addQ="String_Node_Str";
  GrillResultSet result=cubeDriver.execute(addQ,conf);
  Assert.assertNotNull(result);
  Assert.assertEquals(((MockDriver)cubeDriver.getDrivers().get(0)).query,addQ);
  String setQ="String_Node_Str";
  result=cubeDriver.execute(setQ,conf);
  Assert.assertNotNull(result);
  Assert.assertEquals(((MockDriver)cubeDriver.getDrivers().get(0)).query,setQ);
  String query="String_Node_Str";
  DriverQueryPlan plan=cubeDriver.explain(query,conf);
  String planString=plan.getPlan();
  Assert.assertEquals(query,planString);
  cubeDriver.executePrepareAsync(plan.getHandle(),conf);
  Assert.assertEquals(cubeDriver.getStatus(plan.getHandle()).getStatus(),QueryStatus.Status.SUCCESSFUL);
  Assert.assertFalse(cubeDriver.cancelQuery(plan.getHandle()));
  result=cubeDriver.executePrepare(plan.getHandle(),conf);
  Assert.assertNotNull(result);
  Assert.assertNotNull(result.getMetadata());
  Assert.assertEquals(cubeDriver.getStatus(plan.getHandle()).getStatus(),QueryStatus.Status.SUCCESSFUL);
  cubeDriver.closeQuery(plan.getHandle());
  Throwable th=null;
  try {
    cubeDriver.getStatus(plan.getHandle());
  }
 catch (  GrillException e) {
    th=e;
  }
  Assert.assertNotNull(th);
  result=cubeDriver.execute(query,conf);
  Assert.assertNotNull(result);
  Assert.assertNotNull(result.getMetadata());
  QueryHandle handle=cubeDriver.executeAsync(query,conf);
  Assert.assertEquals(cubeDriver.getStatus(handle).getStatus(),QueryStatus.Status.SUCCESSFUL);
  Assert.assertFalse(cubeDriver.cancelQuery(handle));
  cubeDriver.closeQuery(handle);
  th=null;
  try {
    cubeDriver.getStatus(handle);
  }
 catch (  GrillException e) {
    th=e;
  }
  Assert.assertNotNull(th);
}

Fixed version (ground truth):
@Test public void testCubeDriver() throws Exception {
  String addQ="String_Node_Str";
  GrillResultSet result=cubeDriver.execute(addQ,conf);
  Assert.assertNotNull(result);
  Assert.assertEquals(((MockDriver)cubeDriver.getDrivers().get(0)).query,addQ);
  String setQ="String_Node_Str";
  result=cubeDriver.execute(setQ,conf);
  Assert.assertNotNull(result);
  Assert.assertEquals(((MockDriver)cubeDriver.getDrivers().get(0)).query,setQ);
  String query="String_Node_Str";
  DriverQueryPlan plan=cubeDriver.explain(query,conf);
  String planString=plan.getPlan();
  Assert.assertEquals(query,planString);
  result=cubeDriver.execute(query,conf);
  Assert.assertNotNull(result);
  Assert.assertNotNull(result.getMetadata());
  QueryHandle handle=cubeDriver.executeAsync(query,conf);
  Assert.assertEquals(cubeDriver.getStatus(handle).getStatus(),QueryStatus.Status.SUCCESSFUL);
  Assert.assertFalse(cubeDriver.cancelQuery(handle));
  cubeDriver.closeQuery(handle);
  Throwable th=null;
  try {
    cubeDriver.getStatus(handle);
  }
 catch (  GrillException e) {
    th=e;
  }
  Assert.assertNotNull(th);
}
Program: 25333
Project: 25333
Buggy source:
private SessionHandle getSession(QueryContext ctx) throws GrillException {
  sessionLock.lock();
  try {
    String grillSession=null;
    if (SessionState.get() != null) {
      grillSession=SessionState.get().getSessionId();
    }
    if (grillSession == null) {
      throw new IllegalStateException("String_Node_Str");
    }
    SessionHandle hiveSession;
    if (!grillToHiveSession.containsKey(grillSession)) {
      try {
        hiveSession=getClient().openSession(SessionState.get().getUserName(),"String_Node_Str");
        grillToHiveSession.put(grillSession,hiveSession);
        LOG.info("String_Node_Str" + SessionState.get().getUserName() + "String_Node_Str"+ grillSession+ "String_Node_Str"+ hiveSession.getHandleIdentifier());
        for (        GrillEventListener<DriverEvent> eventListener : driverListeners) {
          try {
            eventListener.onEvent(new DriverSessionStarted(System.currentTimeMillis(),this,grillSession,hiveSession.getSessionId().toString()));
          }
 catch (          Exception exc) {
            LOG.error("String_Node_Str" + eventListener,exc);
          }
        }
      }
 catch (      Exception e) {
        throw new GrillException(e);
      }
    }
 else {
      hiveSession=grillToHiveSession.get(grillSession);
    }
    return hiveSession;
  }
  finally {
    sessionLock.unlock();
  }
}

Fixed version (ground truth):
private SessionHandle getSession(QueryContext ctx) throws GrillException {
  sessionLock.lock();
  try {
    String grillSession=ctx.getGrillSessionIdentifier();
    if (grillSession == null && SessionState.get() != null) {
      grillSession=SessionState.get().getSessionId();
    }
    if (grillSession == null) {
      throw new IllegalStateException("String_Node_Str");
    }
    SessionHandle hiveSession;
    if (!grillToHiveSession.containsKey(grillSession)) {
      try {
        hiveSession=getClient().openSession(ctx.getClusterUser(),"String_Node_Str");
        grillToHiveSession.put(grillSession,hiveSession);
        LOG.info("String_Node_Str" + ctx.getClusterUser() + "String_Node_Str"+ grillSession+ "String_Node_Str"+ hiveSession.getHandleIdentifier());
        for (        GrillEventListener<DriverEvent> eventListener : driverListeners) {
          try {
            eventListener.onEvent(new DriverSessionStarted(System.currentTimeMillis(),this,grillSession,hiveSession.getSessionId().toString()));
          }
 catch (          Exception exc) {
            LOG.error("String_Node_Str" + eventListener,exc);
          }
        }
      }
 catch (      Exception e) {
        throw new GrillException(e);
      }
    }
 else {
      hiveSession=grillToHiveSession.get(grillSession);
    }
    return hiveSession;
  }
  finally {
    sessionLock.unlock();
  }
}
Program: 25334
Project: 25334
Buggy source:
public String getClusterUser(){
  return conf.get(GrillConfConstants.GRILL_SESSION_CLUSTER_USER);
}

Fixed version (ground truth):
public String getClusterUser(){
  return conf.get(GrillConfConstants.GRILL_SESSION_CLUSTER_USER,submittedUser);
}
Program: 25335
Project: 25335
Buggy source:
/** 
 * Acquire a grill session specified by the public UUID
 * @param sessionHandle public UUID of the session
 * @throws GrillException if session cannot be acquired
 */
public void acquire(String sessionHandle) throws GrillException {
  getSession(sessionMap.get(sessionHandle)).acquire();
}

Fixed version (ground truth):
/** 
 * Acquire a grill session specified by the public UUID
 * @param sessionHandle public UUID of the session
 * @throws GrillException if session cannot be acquired
 */
public void acquire(String sessionHandle){
  acquire(sessionMap.get(sessionHandle));
}
Program: 25337
Project: 25337
Buggy source:
public GrillSessionImpl getSession(GrillSessionHandle sessionHandle) throws GrillException {
  try {
    return ((GrillSessionImpl)getSessionManager().getSession(getHiveSessionHandle(sessionHandle)));
  }
 catch (  HiveSQLException exc) {
    LOG.warn("String_Node_Str",exc);
    throw new NotFoundException("String_Node_Str" + sessionHandle);
  }
catch (  Exception e) {
    throw new GrillException(e);
  }
}

Fixed version (ground truth):
public GrillSessionImpl getSession(GrillSessionHandle sessionHandle){
  try {
    return ((GrillSessionImpl)getSessionManager().getSession(getHiveSessionHandle(sessionHandle)));
  }
 catch (  HiveSQLException exc) {
    LOG.warn("String_Node_Str",exc);
    throw new NotFoundException("String_Node_Str" + sessionHandle);
  }
}
Program: 25338
Project: 25338
Buggy source:
protected void handleDriverSessionStart(DriverEvent event){
  DriverSessionStarted sessionStarted=(DriverSessionStarted)event;
  if (!(event.getDriver() instanceof HiveDriver)) {
    return;
  }
  HiveDriver hiveDriver=(HiveDriver)event.getDriver();
  String grillSession=sessionStarted.getGrillSessionID();
  GrillSessionHandle sessionHandle=getSessionHandle(grillSession);
  try {
    GrillSessionImpl session=getSession(sessionHandle);
    acquire(sessionHandle);
    List<GrillSessionImpl.ResourceEntry> resources=session.getGrillSessionPersistInfo().getResources();
    if (resources != null && !resources.isEmpty()) {
      for (      GrillSessionImpl.ResourceEntry resource : resources) {
        LOG.info("String_Node_Str" + resource + "String_Node_Str"+ grillSession);
        try {
          hiveDriver.execute(createAddResourceQuery(sessionHandle,resource.getType(),resource.getLocation()));
          resource.restoredResource();
          LOG.info("String_Node_Str" + resource + "String_Node_Str"+ grillSession);
        }
 catch (        Exception exc) {
          LOG.error("String_Node_Str" + resource + "String_Node_Str"+ grillSession,exc);
        }
      }
    }
 else {
      LOG.info("String_Node_Str" + grillSession);
    }
  }
 catch (  GrillException e) {
    LOG.warn("String_Node_Str" + grillSession + "String_Node_Str"+ ((DriverSessionStarted)event).getDriverSessionID(),e);
  }
 finally {
    try {
      release(sessionHandle);
    }
 catch (    GrillException e) {
      LOG.error("String_Node_Str" + sessionHandle,e);
    }
  }
}

Fixed version (ground truth):
protected void handleDriverSessionStart(DriverEvent event){
  DriverSessionStarted sessionStarted=(DriverSessionStarted)event;
  if (!(event.getDriver() instanceof HiveDriver)) {
    return;
  }
  HiveDriver hiveDriver=(HiveDriver)event.getDriver();
  String grillSession=sessionStarted.getGrillSessionID();
  GrillSessionHandle sessionHandle=getSessionHandle(grillSession);
  if (sessionHandle == null) {
    LOG.warn("String_Node_Str" + grillSession);
    return;
  }
  try {
    GrillSessionImpl session=getSession(sessionHandle);
    acquire(sessionHandle);
    List<GrillSessionImpl.ResourceEntry> resources=session.getGrillSessionPersistInfo().getResources();
    if (resources != null && !resources.isEmpty()) {
      for (      GrillSessionImpl.ResourceEntry resource : resources) {
        LOG.info("String_Node_Str" + resource + "String_Node_Str"+ grillSession);
        try {
          hiveDriver.execute(createAddResourceQuery(sessionHandle,resource.getType(),resource.getLocation()));
          resource.restoredResource();
          LOG.info("String_Node_Str" + resource + "String_Node_Str"+ grillSession);
        }
 catch (        Exception exc) {
          LOG.error("String_Node_Str" + resource + "String_Node_Str"+ grillSession,exc);
        }
      }
    }
 else {
      LOG.info("String_Node_Str" + grillSession);
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str" + grillSession + "String_Node_Str"+ ((DriverSessionStarted)event).getDriverSessionID(),e);
  }
 finally {
    release(sessionHandle);
  }
}
Program: 25339
Project: 25339
Buggy source:
@Override public void writeExternal(ObjectOutput out) throws IOException {
  out.writeInt(sessionMap.size());
  for (  GrillSessionHandle sessionHandle : sessionMap.values()) {
    try {
      GrillSessionImpl session=getSession(sessionHandle);
      session.getGrillSessionPersistInfo().writeExternal(out);
    }
 catch (    GrillException e) {
      throw new IOException(e);
    }
  }
  LOG.info("String_Node_Str" + sessionMap.size() + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void writeExternal(ObjectOutput out) throws IOException {
  out.writeInt(sessionMap.size());
  for (  GrillSessionHandle sessionHandle : sessionMap.values()) {
    GrillSessionImpl session=getSession(sessionHandle);
    session.getGrillSessionPersistInfo().writeExternal(out);
  }
  LOG.info("String_Node_Str" + sessionMap.size() + "String_Node_Str");
}
Program: 25340
Project: 25340
Buggy source:
public void runInternal(){
  List<GrillSessionHandle> sessionsToRemove=new ArrayList<GrillSessionHandle>(sessionMap.values());
  Iterator<GrillSessionHandle> itr=sessionsToRemove.iterator();
  while (itr.hasNext()) {
    GrillSessionHandle sessionHandle=itr.next();
    try {
      GrillSessionImpl session=getSession(sessionHandle);
      if (session.isActive()) {
        itr.remove();
      }
    }
 catch (    NotFoundException nfe) {
      itr.remove();
    }
catch (    GrillException e) {
      itr.remove();
    }
  }
  for (  GrillSessionHandle sessionHandle : sessionsToRemove) {
    try {
      long lastAccessTime=getSession(sessionHandle).getLastAccessTime();
      closeSession(sessionHandle);
      LOG.info("String_Node_Str" + sessionHandle.getPublicId() + "String_Node_Str"+ new Date(lastAccessTime));
    }
 catch (    NotFoundException nfe) {
    }
catch (    GrillException e) {
      LOG.error("String_Node_Str" + sessionHandle.getPublicId() + "String_Node_Str"+ e.getMessage());
    }
  }
}

Fixed version (ground truth):
public void runInternal(){
  List<GrillSessionHandle> sessionsToRemove=new ArrayList<GrillSessionHandle>(sessionMap.values());
  Iterator<GrillSessionHandle> itr=sessionsToRemove.iterator();
  while (itr.hasNext()) {
    GrillSessionHandle sessionHandle=itr.next();
    try {
      GrillSessionImpl session=getSession(sessionHandle);
      if (session.isActive()) {
        itr.remove();
      }
    }
 catch (    NotFoundException nfe) {
      itr.remove();
    }
  }
  for (  GrillSessionHandle sessionHandle : sessionsToRemove) {
    try {
      long lastAccessTime=getSession(sessionHandle).getLastAccessTime();
      closeSession(sessionHandle);
      LOG.info("String_Node_Str" + sessionHandle.getPublicId() + "String_Node_Str"+ new Date(lastAccessTime));
    }
 catch (    NotFoundException nfe) {
    }
catch (    GrillException e) {
      LOG.error("String_Node_Str" + sessionHandle.getPublicId() + "String_Node_Str"+ e.getMessage());
    }
  }
}