nus-yam/ex-repair huggingface dataset:
Program: 55103
Project: 55103
Buggy source:
public BufferedReader[] getResultReader(String resultPath) throws IOException {
  File[] files=getAllInvolvedFiles(resultPath);
  BufferedReader[] readers=new BufferedReader[files.length];
  for (int i=0; i < files.length; i++) {
    readers[i]=new BufferedReader(new FileReader(files[i]));
  }
  return readers;
}

Fixed version (ground truth):
public BufferedReader[] getResultReader(String resultPath,boolean inOrderOfFiles) throws IOException {
  File[] files=getAllInvolvedFiles(resultPath);
  if (inOrderOfFiles) {
    Arrays.sort(files,new Comparator<File>(){
      @Override public int compare(      File o1,      File o2){
        try {
          int f1=Integer.parseInt(o1.getName());
          int f2=Integer.parseInt(o2.getName());
          return f1 < f2 ? -1 : (f1 > f2 ? 1 : 0);
        }
 catch (        NumberFormatException e) {
          throw new RuntimeException("String_Node_Str" + o1.getName() + "String_Node_Str"+ o2.getName());
        }
      }
    }
);
  }
  BufferedReader[] readers=new BufferedReader[files.length];
  for (int i=0; i < files.length; i++) {
    readers[i]=new BufferedReader(new FileReader(files[i]));
  }
  return readers;
}
Program: 55104
Project: 55104
Buggy source:
@Override protected void postSubmit() throws Exception {
  Collections.sort(this.records);
  compareResultsByLinesInMemoryStrictOrder(this.records,this.resultPath);
}

Fixed version (ground truth):
@Override protected void postSubmit() throws Exception {
  compareResultsByLinesInMemoryWithStrictOrder(this.sortedRecords,this.resultPath);
}
Program: 55105
Project: 55105
Buggy source:
@Override protected void preSubmit() throws Exception {
  recordsPath=getFilesystemProvider().getTempDirPath() + "String_Node_Str";
  resultPath=getFilesystemProvider().getTempDirPath() + "String_Node_Str";
  records=new ArrayList<Integer>();
  Random rnd=new Random(1988);
  int numRecordsPerSplit=1000;
  getFilesystemProvider().createDir(recordsPath);
  int numSplits=4;
  for (int i=0; i < numSplits; i++) {
    StringBuilder sb=new StringBuilder(numSplits * 2);
    for (int j=0; j < numRecordsPerSplit; j++) {
      int number=rnd.nextInt();
      records.add(number);
      sb.append(number);
      sb.append('\n');
    }
    getFilesystemProvider().createFile(recordsPath + "String_Node_Str" + i+ "String_Node_Str",sb.toString());
    if (LOG.isDebugEnabled())     LOG.debug("String_Node_Str" + (i + 1) + "String_Node_Str"+ sb.toString()+ "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override protected void preSubmit() throws Exception {
  ArrayList<Integer> records=new ArrayList<Integer>();
  Random rnd=new Random(1988);
  StringBuilder sb=new StringBuilder(NUM_RECORDS * 7);
  for (int i=0; i < NUM_RECORDS; i++) {
    int number=rnd.nextInt();
    records.add(number);
    sb.append(number);
    sb.append('\n');
  }
  recordsPath=createTempFile("String_Node_Str",sb.toString());
  resultPath=getTempDirPath("String_Node_Str");
  Collections.sort(records);
  sb.setLength(0);
  for (  Integer i : records) {
    sb.append(i.intValue());
    sb.append('\n');
  }
  this.sortedRecords=sb.toString();
}
Program: 55107
Project: 55107
Buggy source:
@Override protected void preSubmit() throws Exception {
  orders1Path=getFilesystemProvider().getTempDirPath() + "String_Node_Str";
  orders2Path=getFilesystemProvider().getTempDirPath() + "String_Node_Str";
  partJoin1Path=getFilesystemProvider().getTempDirPath() + "String_Node_Str";
  partJoin2Path=getFilesystemProvider().getTempDirPath() + "String_Node_Str";
  lineitemsPath=getFilesystemProvider().getTempDirPath() + "String_Node_Str";
  resultPath=getFilesystemProvider().getTempDirPath() + "String_Node_Str";
  String[] splits=splitInputString(ORDERS1,'\n',4);
  getFilesystemProvider().createDir(orders1Path);
  for (int i=0; i < splits.length; i++) {
    getFilesystemProvider().createFile(orders1Path + "String_Node_Str" + i+ "String_Node_Str",splits[i]);
    LOG.debug("String_Node_Str" + (i + 1) + "String_Node_Str"+ splits[i]+ "String_Node_Str");
  }
  splits=splitInputString(ORDERS2,'\n',4);
  getFilesystemProvider().createDir(orders2Path);
  for (int i=0; i < splits.length; i++) {
    getFilesystemProvider().createFile(orders2Path + "String_Node_Str" + i+ "String_Node_Str",splits[i]);
    LOG.debug("String_Node_Str" + (i + 1) + "String_Node_Str"+ splits[i]+ "String_Node_Str");
  }
  splits=splitInputString(PART_JOIN_1,'\n',4);
  getFilesystemProvider().createDir(partJoin1Path);
  for (int i=0; i < splits.length; i++) {
    getFilesystemProvider().createFile(partJoin1Path + "String_Node_Str" + i+ "String_Node_Str",splits[i]);
    LOG.debug("String_Node_Str" + (i + 1) + "String_Node_Str"+ splits[i]+ "String_Node_Str");
  }
  splits=splitInputString(PART_JOIN_2,'\n',4);
  getFilesystemProvider().createDir(partJoin2Path);
  for (int i=0; i < splits.length; i++) {
    getFilesystemProvider().createFile(partJoin2Path + "String_Node_Str" + i+ "String_Node_Str",splits[i]);
    LOG.debug("String_Node_Str" + (i + 1) + "String_Node_Str"+ splits[i]+ "String_Node_Str");
  }
  splits=splitInputString(LINEITEMS,'\n',4);
  getFilesystemProvider().createDir(lineitemsPath);
  for (int i=0; i < splits.length; i++) {
    getFilesystemProvider().createFile(lineitemsPath + "String_Node_Str" + i+ "String_Node_Str",splits[i]);
    LOG.debug("String_Node_Str" + (i + 1) + "String_Node_Str"+ splits[i]+ "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override protected void preSubmit() throws Exception {
  orders1Path=createTempFile("String_Node_Str",ORDERS1);
  orders2Path=createTempFile("String_Node_Str",ORDERS2);
  partJoin1Path=createTempFile("String_Node_Str",PART_JOIN_1);
  partJoin2Path=createTempFile("String_Node_Str",PART_JOIN_2);
  lineitemsPath=createTempFile("String_Node_Str",LINEITEMS);
  resultPath=getTempDirPath("String_Node_Str");
}
Program: 55108
Project: 55108
Buggy source:
@Override public void setItemCount(long itemCount) throws IOException {
  writeVarLongCount(out,itemCount);
}

Fixed version (ground truth):
@Override public void setItemCount(long itemCount) throws IOException {
  if (itemCount > 0) {
    writeVarLongCount(out,itemCount);
  }
}
Program: 55109
Project: 55109
Buggy source:
@Test public void testObjects(){
  testObjectSerialization(new Book(976243875L,"String_Node_Str",42));
{
    ArrayList<String> list=new ArrayList<String>();
    list.add("String_Node_Str");
    list.add("String_Node_Str");
    list.add("String_Node_Str");
    list.add("String_Node_Str");
    list.add("String_Node_Str");
    testObjectSerialization(new BookAuthor(976243875L,list,"String_Node_Str"));
  }
}

Fixed version (ground truth):
@Test public void testObjects(){
{
    testObjectSerialization(new Book(976243875L,"String_Node_Str",42));
  }
{
    ArrayList<String> list=new ArrayList<String>();
    list.add("String_Node_Str");
    list.add("String_Node_Str");
    list.add("String_Node_Str");
    list.add("String_Node_Str");
    list.add("String_Node_Str");
    testObjectSerialization(new BookAuthor(976243875L,list,"String_Node_Str"));
  }
{
    ArrayList<String> list=new ArrayList<String>();
    testObjectSerialization(new BookAuthor(987654321L,list,"String_Node_Str"));
  }
}
Program: 55110
Project: 55110
Buggy source:
public static void main(String[] args) throws Exception {
  WordCountOptimized wc=new WordCountOptimized();
  Plan plan=wc.getPlan("String_Node_Str","String_Node_Str","String_Node_Str");
  LocalExecutor.execute(plan);
  System.exit(0);
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  WordCountOptimized wc=new WordCountOptimized();
  Plan plan=wc.getPlan("String_Node_Str","String_Node_Str","String_Node_Str");
  LocalExecutor.execute(plan);
}
Program: 55112
Project: 55112
Buggy source:
@Override public void teardown(){
  this.hashJoin.close();
}

Fixed version (ground truth):
@Override public void teardown(){
  MutableHashTable<?,?> ht=this.hashJoin;
  if (ht != null) {
    ht.close();
  }
}
Program: 55113
Project: 55113
Buggy source:
@Override protected JobGraph getJobGraph() throws Exception {
  return createJobGraph(dataPath,clusterPath,this.resultPath,1,20);
}

Fixed version (ground truth):
@Override protected JobGraph getJobGraph() throws Exception {
  return createJobGraph(dataPath,clusterPath,this.resultPath,4,20);
}
Program: 55114
Project: 55114
Buggy source:
public KMeansIterativeNepheleITCase(){
  LogUtils.initializeDefaultConsoleLogger();
}

Fixed version (ground truth):
public KMeansIterativeNepheleITCase(){
  LogUtils.initializeDefaultTestConsoleLogger();
}
Program: 55115
Project: 55115
Buggy source:
@Test public void testLocalExecutorWithWordCount(){
  try {
    File inFile=File.createTempFile("String_Node_Str","String_Node_Str");
    File outFile=File.createTempFile("String_Node_Str","String_Node_Str");
    inFile.deleteOnExit();
    outFile.deleteOnExit();
    FileWriter fw=new FileWriter(inFile);
    fw.write(WordCountITCase.TEXT);
    fw.close();
    WordCount wc=new WordCount();
    LocalExecutor.execute(wc,"String_Node_Str",inFile.toURI().toString(),outFile.toURI().toString());
  }
 catch (  Exception e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testLocalExecutorWithWordCount(){
  try {
    File inFile=File.createTempFile("String_Node_Str","String_Node_Str");
    File outFile=File.createTempFile("String_Node_Str","String_Node_Str");
    inFile.deleteOnExit();
    outFile.deleteOnExit();
    FileWriter fw=new FileWriter(inFile);
    fw.write(WordCountData.TEXT);
    fw.close();
    WordCount wc=new WordCount();
    LocalExecutor executor=new LocalExecutor();
    LogUtils.initializeDefaultConsoleLogger(Level.ERROR);
    executor.start();
    executor.executePlan(wc.getPlan("String_Node_Str",inFile.toURI().toString(),outFile.toURI().toString()));
    executor.stop();
  }
 catch (  Exception e) {
    e.printStackTrace();
    Assert.fail(e.getMessage());
  }
}
Program: 55117
Project: 55117
Buggy source:
private JobTaskVertex createDualInputVertex(DualInputPlanNode node) throws CompilerException {
  final String taskName=node.getNodeName();
  final DriverStrategy ds=node.getDriverStrategy();
  final JobTaskVertex vertex=new JobTaskVertex(taskName,this.jobGraph);
  final TaskConfig config=new TaskConfig(vertex.getConfiguration());
  vertex.setTaskClass(this.currentIteration == null ? RegularPactTask.class : IterationIntermediatePactTask.class);
  config.setStubWrapper(node.getPactContract().getUserCodeWrapper());
  config.setStubParameters(node.getPactContract().getParameters());
  config.setDriver(ds.getDriverClass());
  config.setDriverStrategy(ds);
  if (node.getComparator1() != null) {
    config.setDriverComparator(node.getComparator1(),0);
  }
  if (node.getComparator2() != null) {
    config.setDriverComparator(node.getComparator2(),1);
  }
  if (node.getPairComparator() != null) {
    config.setDriverPairComparator(node.getPairComparator());
  }
  assignDriverResources(node,config);
  return vertex;
}

Fixed version (ground truth):
private JobTaskVertex createDualInputVertex(DualInputPlanNode node) throws CompilerException {
  final String taskName=node.getNodeName();
  final DriverStrategy ds=node.getDriverStrategy();
  final JobTaskVertex vertex=new JobTaskVertex(taskName,this.jobGraph);
  final TaskConfig config=new TaskConfig(vertex.getConfiguration());
  vertex.setTaskClass((this.currentIteration != null && node.isOnDynamicPath()) ? IterationIntermediatePactTask.class : RegularPactTask.class);
  config.setStubWrapper(node.getPactContract().getUserCodeWrapper());
  config.setStubParameters(node.getPactContract().getParameters());
  config.setDriver(ds.getDriverClass());
  config.setDriverStrategy(ds);
  if (node.getComparator1() != null) {
    config.setDriverComparator(node.getComparator1(),0);
  }
  if (node.getComparator2() != null) {
    config.setDriverComparator(node.getComparator2(),1);
  }
  if (node.getPairComparator() != null) {
    config.setDriverPairComparator(node.getPairComparator());
  }
  assignDriverResources(node,config);
  return vertex;
}
Program: 55118
Project: 55118
Buggy source:
@Override public void read(DataInput in) throws IOException {
  wrappedType=in.readUTF();
  try {
    Class wrClass=Class.forName(wrappedType);
    wrapped=InstantiationUtil.instantiate(wrClass,Writable.class);
  }
 catch (  ClassNotFoundException e) {
    throw new RuntimeException("String_Node_Str");
  }
  wrapped.readFields(in);
}

Fixed version (ground truth):
@Override public void read(DataInput in) throws IOException {
  wrappedType=in.readUTF();
  try {
    Class wrClass=Class.forName(wrappedType);
    wrapped=(Writable)InstantiationUtil.instantiate(wrClass,Writable.class);
  }
 catch (  ClassNotFoundException e) {
    throw new RuntimeException("String_Node_Str");
  }
  wrapped.readFields(in);
}
Program: 55119
Project: 55119
Buggy source:
/** 
 * Configures this JDBCOutputFormat.
 * @param parameters Configuration containing all parameters.
 */
@Override public void configure(Configuration parameters){
  this.driverName=parameters.getString(DRIVER_KEY,null);
  this.username=parameters.getString(USERNAME_KEY,null);
  this.password=parameters.getString(PASSWORD_KEY,null);
  this.dbURL=parameters.getString(URL_KEY,null);
  this.query=parameters.getString(QUERY_KEY,null);
  this.fieldCount=parameters.getInteger(FIELD_COUNT_KEY,0);
  @SuppressWarnings("String_Node_Str") Class<Value>[] classes=new Class[this.fieldCount];
  this.fieldClasses=classes;
  for (int i=0; i < this.fieldCount; i++) {
    @SuppressWarnings("String_Node_Str") Class<? extends Value> clazz=(Class<? extends Value>)parameters.getClass(FIELD_TYPE_KEY + i,null);
    if (clazz == null) {
      throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + i);
    }
    this.fieldClasses[i]=clazz;
  }
}

Fixed version (ground truth):
/** 
 * Configures this JDBCOutputFormat.
 * @param parameters Configuration containing all parameters.
 */
@Override public void configure(Configuration parameters){
  this.driverName=parameters.getString(DRIVER_KEY,null);
  this.username=parameters.getString(USERNAME_KEY,null);
  this.password=parameters.getString(PASSWORD_KEY,null);
  this.dbURL=parameters.getString(URL_KEY,null);
  this.query=parameters.getString(QUERY_KEY,null);
  this.fieldCount=parameters.getInteger(FIELD_COUNT_KEY,0);
  this.batchInterval=parameters.getInteger(BATCH_INTERVAL,DEFAULT_BATCH_INTERVERAL);
  @SuppressWarnings("String_Node_Str") Class<Value>[] classes=new Class[this.fieldCount];
  this.fieldClasses=classes;
  for (int i=0; i < this.fieldCount; i++) {
    @SuppressWarnings("String_Node_Str") Class<? extends Value> clazz=(Class<? extends Value>)parameters.getClass(FIELD_TYPE_KEY + i,null);
    if (clazz == null) {
      throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str" + i);
    }
    this.fieldClasses[i]=clazz;
  }
}
Program: 55120
Project: 55120
Buggy source:
/** 
 * Adds a record to the prepared statement. <p> When this method is called, the output format is guaranteed to be opened.
 * @param record The records to add to the output.
 * @throws IOException Thrown, if the records could not be added due to anI/O problem.
 */
@Override public void writeRecord(Record record) throws IOException {
  try {
    for (int x=0; x < record.getNumFields(); x++) {
      Value temp=record.getField(x,fieldClasses[x]);
      addValue(x + 1,temp);
    }
    upload.addBatch();
  }
 catch (  SQLException sqe) {
    throw new IllegalArgumentException("String_Node_Str",sqe);
  }
catch (  IllegalArgumentException iae) {
    throw new IllegalArgumentException("String_Node_Str",iae);
  }
}

Fixed version (ground truth):
/** 
 * Adds a record to the prepared statement. <p> When this method is called, the output format is guaranteed to be opened.
 * @param record The records to add to the output.
 * @throws IOException Thrown, if the records could not be added due to anI/O problem.
 */
@Override public void writeRecord(Record record) throws IOException {
  try {
    for (int x=0; x < record.getNumFields(); x++) {
      Value temp=record.getField(x,fieldClasses[x]);
      addValue(x + 1,temp);
    }
    upload.addBatch();
    batchCount++;
    if (batchCount >= batchInterval) {
      upload.executeBatch();
      batchCount=0;
    }
  }
 catch (  SQLException sqe) {
    throw new IllegalArgumentException("String_Node_Str",sqe);
  }
catch (  IllegalArgumentException iae) {
    throw new IllegalArgumentException("String_Node_Str",iae);
  }
}
Program: 55121
Project: 55121
Buggy source:
/** 
 * Executes prepared statement and closes all resources of this instance.
 * @throws IOException Thrown, if the input could not be closed properly.
 */
@Override public void close() throws IOException {
  try {
    upload.executeBatch();
    upload.close();
    dbConn.close();
  }
 catch (  SQLException sqe) {
    throw new IllegalArgumentException("String_Node_Str",sqe);
  }
}

Fixed version (ground truth):
/** 
 * Executes prepared statement and closes all resources of this instance.
 * @throws IOException Thrown, if the input could not be closed properly.
 */
@Override public void close() throws IOException {
  try {
    upload.executeBatch();
    batchCount=0;
    upload.close();
    dbConn.close();
  }
 catch (  SQLException sqe) {
    throw new IllegalArgumentException("String_Node_Str",sqe);
  }
}
Program: 55122
Project: 55122
Buggy source:
@BeforeClass public static void setUpClass(){
  try {
    prepareDerbyDatabase();
  }
 catch (  ClassNotFoundException e) {
    e.printStackTrace();
    Assert.fail();
  }
}

Fixed version (ground truth):
@BeforeClass public static void setUpClass(){
  try {
    prepareDerbyDatabase();
  }
 catch (  Exception e) {
    e.printStackTrace();
    Assert.fail();
  }
}
Program: 55123
Project: 55123
Buggy source:
private static void createConnection(String dbURL){
  try {
    Class.forName("String_Node_Str");
    conn=DriverManager.getConnection(dbURL);
    createTable();
    insertDataToSQLTables();
    conn.close();
  }
 catch (  ClassNotFoundException e) {
    e.printStackTrace();
    Assert.fail();
  }
catch (  SQLException e) {
    e.printStackTrace();
    Assert.fail();
  }
}

Fixed version (ground truth):
private static void createConnection(String dbURL){
  try {
    Class.forName("String_Node_Str");
    conn=DriverManager.getConnection(dbURL);
    createTable();
    insertDataToSQLTables();
    conn.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
    Assert.fail();
  }
}
Program: 55124
Project: 55124
Buggy source:
@Test public void testJDBCInputFormat() throws IOException {
  jdbcInputFormat=new JDBCInputFormat("String_Node_Str","String_Node_Str","String_Node_Str");
  jdbcInputFormat.configure(null);
  Record record=new Record();
  int recordCount=0;
  while (!jdbcInputFormat.reachedEnd()) {
    jdbcInputFormat.nextRecord(record);
    Assert.assertEquals(5,record.getNumFields());
    Assert.assertEquals("String_Node_Str",IntValue.class,record.getField(0,IntValue.class).getClass());
    Assert.assertEquals("String_Node_Str",StringValue.class,record.getField(1,StringValue.class).getClass());
    Assert.assertEquals("String_Node_Str",StringValue.class,record.getField(2,StringValue.class).getClass());
    Assert.assertEquals("String_Node_Str",DoubleValue.class,record.getField(3,DoubleValue.class).getClass());
    Assert.assertEquals("String_Node_Str",IntValue.class,record.getField(4,IntValue.class).getClass());
    int[] pos={0,1,2,3,4};
    Value[] values={new IntValue(),new StringValue(),new StringValue(),new DoubleValue(),new IntValue()};
    Assert.assertTrue(record.equalsFields(pos,dbData[recordCount],values));
    recordCount++;
  }
  Assert.assertEquals(5,recordCount);
}

Fixed version (ground truth):
@Test public void testJDBCInputFormat() throws IOException {
  jdbcInputFormat=new JDBCInputFormat("String_Node_Str","String_Node_Str","String_Node_Str");
  jdbcInputFormat.configure(null);
  Record record=new Record();
  int recordCount=0;
  while (!jdbcInputFormat.reachedEnd()) {
    jdbcInputFormat.nextRecord(record);
    Assert.assertEquals(5,record.getNumFields());
    Assert.assertEquals("String_Node_Str",IntValue.class,record.getField(0,IntValue.class).getClass());
    Assert.assertEquals("String_Node_Str",StringValue.class,record.getField(1,StringValue.class).getClass());
    Assert.assertEquals("String_Node_Str",StringValue.class,record.getField(2,StringValue.class).getClass());
    Assert.assertEquals("String_Node_Str",DoubleValue.class,record.getField(3,DoubleValue.class).getClass());
    Assert.assertEquals("String_Node_Str",IntValue.class,record.getField(4,IntValue.class).getClass());
    int[] pos={0,1,2,3,4};
    Value[] values={new IntValue(),new StringValue(),new StringValue(),new DoubleValue(),new IntValue()};
    Assert.assertTrue(record.equalsFields(pos,dbData[recordCount],values));
    recordCount++;
  }
  Assert.assertEquals(5,recordCount);
  cleanUpDerbyDatabases();
}
Program: 55125
Project: 55125
Buggy source:
@BeforeClass public static void setUpClass(){
  try {
    System.setProperty("String_Node_Str","String_Node_Str");
    prepareDerbyInputDatabase();
    prepareDerbyOutputDatabase();
  }
 catch (  ClassNotFoundException e) {
    Assert.fail();
  }
}

Fixed version (ground truth):
@BeforeClass public static void setUpClass(){
  try {
    System.setProperty("String_Node_Str","String_Node_Str");
    prepareDerbyInputDatabase();
    prepareDerbyOutputDatabase();
  }
 catch (  ClassNotFoundException e) {
    e.printStackTrace();
    Assert.fail();
  }
}
Program: 55126
Project: 55126
Buggy source:
private static void prepareDerbyInputDatabase() throws ClassNotFoundException {
  try {
    String dbURL="String_Node_Str";
    Class.forName("String_Node_Str");
    conn=DriverManager.getConnection(dbURL);
    createTableBooks();
    insertDataToSQLTables();
    conn.close();
  }
 catch (  ClassNotFoundException e) {
    Assert.fail();
  }
catch (  SQLException e) {
    Assert.fail();
  }
}

Fixed version (ground truth):
private static void prepareDerbyInputDatabase() throws ClassNotFoundException {
  try {
    String dbURL="String_Node_Str";
    Class.forName("String_Node_Str");
    conn=DriverManager.getConnection(dbURL);
    createTableBooks();
    insertDataToSQLTables();
    conn.close();
  }
 catch (  ClassNotFoundException e) {
    e.printStackTrace();
    Assert.fail();
  }
catch (  SQLException e) {
    e.printStackTrace();
    Assert.fail();
  }
}
Program: 55127
Project: 55127
Buggy source:
private static void prepareDerbyOutputDatabase() throws ClassNotFoundException {
  try {
    String dbURL="String_Node_Str";
    Class.forName("String_Node_Str");
    conn=DriverManager.getConnection(dbURL);
    createTableNewBooks();
    conn.close();
  }
 catch (  ClassNotFoundException e) {
    Assert.fail();
  }
catch (  SQLException e) {
    Assert.fail();
  }
}

Fixed version (ground truth):
private static void prepareDerbyOutputDatabase() throws ClassNotFoundException {
  try {
    String dbURL="String_Node_Str";
    Class.forName("String_Node_Str");
    conn=DriverManager.getConnection(dbURL);
    createTableNewBooks();
    conn.close();
  }
 catch (  ClassNotFoundException e) {
    e.printStackTrace();
    Assert.fail();
  }
catch (  SQLException e) {
    e.printStackTrace();
    Assert.fail();
  }
}
Program: 55128
Project: 55128
Buggy source:
@After public void tearDown(){
  jdbcOutputFormat=null;
}

Fixed version (ground truth):
@After public void tearDown(){
  jdbcOutputFormat=null;
  cleanUpDerbyDatabases();
}
Program: 55129
Project: 55129
Buggy source:
public void setConsoleStreamForReporting(PrintStream stream){
  if (stream == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.console=stream;
}

Fixed version (ground truth):
public void setConsoleStreamForReporting(PrintStream stream){
  this.console=stream;
}
Program: 55130
Project: 55130
Buggy source:
@Test public void dumpWorksetConnectedComponents(){
  dump(new WorksetConnectedComponents().getPlan("String_Node_Str",IN_FILE,IN_FILE,OUT_FILE));
}

Fixed version (ground truth):
@Test public void dumpWorksetConnectedComponents(){
  dump(new WorksetConnectedComponents().getPlan("String_Node_Str",IN_FILE,IN_FILE,OUT_FILE));
  dump(new WorksetConnectedComponents().getPlan(NO_ARGS));
}
Program: 55131
Project: 55131
Buggy source:
@Test public void dumpTPCH3(){
  dump(new TPCHQuery3().getPlan("String_Node_Str",IN_FILE,IN_FILE,OUT_FILE));
}

Fixed version (ground truth):
@Test public void dumpTPCH3(){
  dump(new TPCHQuery3().getPlan("String_Node_Str",IN_FILE,IN_FILE,OUT_FILE));
  dump(new TPCHQuery3().getPlan(NO_ARGS));
}
Program: 55132
Project: 55132
Buggy source:
@Test public void dumpWordCount(){
  dump(new WordCount().getPlan("String_Node_Str",IN_FILE,OUT_FILE));
}

Fixed version (ground truth):
@Test public void dumpWordCount(){
  dump(new WordCount().getPlan("String_Node_Str",IN_FILE,OUT_FILE));
  dump(new WordCount().getPlan(NO_ARGS));
}
Program: 55133
Project: 55133
Buggy source:
@Test public void dumpBulkIterationKMeans(){
  dump(new KMeansIterative().getPlan("String_Node_Str",IN_FILE,OUT_FILE));
}

Fixed version (ground truth):
@Test public void dumpBulkIterationKMeans(){
  dump(new KMeansIterative().getPlan("String_Node_Str",IN_FILE,OUT_FILE));
  dump(new KMeansIterative().getPlan(NO_ARGS));
}
Program: 55134
Project: 55134
Buggy source:
@Test public void dumpWebLogAnalysis(){
  dump(new WebLogAnalysis().getPlan("String_Node_Str",IN_FILE,IN_FILE,IN_FILE,OUT_FILE));
}

Fixed version (ground truth):
@Test public void dumpWebLogAnalysis(){
  dump(new WebLogAnalysis().getPlan("String_Node_Str",IN_FILE,IN_FILE,IN_FILE,OUT_FILE));
  dump(new WebLogAnalysis().getPlan(NO_ARGS));
}
Program: 55135
Project: 55135
Buggy source:
@Test public void dumpKMeans(){
  dump(new KMeansSingleStep().getPlan("String_Node_Str",IN_FILE,IN_FILE,OUT_FILE));
}

Fixed version (ground truth):
@Test public void dumpKMeans(){
  dump(new KMeansSingleStep().getPlan("String_Node_Str",IN_FILE,IN_FILE,OUT_FILE));
  dump(new KMeansSingleStep().getPlan(NO_ARGS));
}
Program: 55137
Project: 55137
Buggy source:
/** 
 * Returns a reference to the   {@link FileSystem} instance for accessing thelocal file system.
 * @return a reference to the {@link FileSystem} instance for accessing thelocal file system.
 * @throws IOException thrown if a reference to the file system instance could not be obtained
 */
public static FileSystem getLocalFileSystem() throws IOException {
  URI localUri;
  try {
    localUri=new URI("String_Node_Str");
  }
 catch (  URISyntaxException e) {
    throw new IOException("String_Node_Str");
  }
  return get(localUri);
}

Fixed version (ground truth):
/** 
 * Returns a reference to the   {@link FileSystem} instance for accessing thelocal file system.
 * @return a reference to the {@link FileSystem} instance for accessing thelocal file system.
 * @throws IOException thrown if a reference to the file system instance could not be obtained
 */
public static FileSystem getLocalFileSystem() throws IOException {
  URI localUri;
  try {
    localUri=isWindows() ? new URI("String_Node_Str") : new URI("String_Node_Str");
  }
 catch (  URISyntaxException e) {
    throw new IOException("String_Node_Str");
  }
  return get(localUri);
}
Program: 55140
Project: 55140
Buggy source:
@Test public void testOpen(){
  Configuration config=new Configuration();
  config.setInteger(ExternalProcessFixedLengthInputFormat.RECORDLENGTH_PARAMETER_KEY,8);
  ExternalProcessInputSplit split=new ExternalProcessInputSplit(1,this.neverEndingCommand);
  boolean processDestroyed=false;
  try {
    format.configure(config);
    format.open(split);
    String[] cmd={"String_Node_Str","String_Node_Str","String_Node_Str"};
    byte[] wcOut=new byte[128];
    Process p=Runtime.getRuntime().exec(cmd);
    p.getInputStream().read(wcOut);
    int pCnt=Integer.parseInt(new String(wcOut).trim());
    Assert.assertTrue(pCnt > 0);
    format.close();
  }
 catch (  IOException e) {
    Assert.fail();
  }
catch (  RuntimeException e) {
    if (e.getMessage().equals("String_Node_Str")) {
      processDestroyed=true;
    }
  }
 finally {
    Assert.assertTrue(processDestroyed);
  }
}

Fixed version (ground truth):
@Test public void testOpen(){
  if (FileSystem.isWindows())   return;
  Configuration config=new Configuration();
  config.setInteger(ExternalProcessFixedLengthInputFormat.RECORDLENGTH_PARAMETER_KEY,8);
  ExternalProcessInputSplit split=new ExternalProcessInputSplit(1,this.neverEndingCommand);
  boolean processDestroyed=false;
  try {
    format.configure(config);
    format.open(split);
    String[] cmd={"String_Node_Str","String_Node_Str","String_Node_Str"};
    byte[] wcOut=new byte[128];
    Process p=Runtime.getRuntime().exec(cmd);
    p.getInputStream().read(wcOut);
    int pCnt=Integer.parseInt(new String(wcOut).trim());
    Assert.assertTrue(pCnt > 0);
    format.close();
  }
 catch (  IOException e) {
    Assert.fail();
  }
catch (  RuntimeException e) {
    if (e.getMessage().equals("String_Node_Str")) {
      processDestroyed=true;
    }
  }
 finally {
    Assert.assertTrue(processDestroyed);
  }
}
Program: 55141
Project: 55141
Buggy source:
@Test public void testOpen(){
  Configuration config=new Configuration();
  ExternalProcessInputSplit split=new ExternalProcessInputSplit(1,this.neverEndingCommand);
  boolean processDestroyed=false;
  try {
    format.configure(config);
    format.open(split);
    String[] cmd={"String_Node_Str","String_Node_Str","String_Node_Str"};
    byte[] wcOut=new byte[128];
    Process p=Runtime.getRuntime().exec(cmd);
    p.getInputStream().read(wcOut);
    int pCnt=Integer.parseInt(new String(wcOut).trim());
    Assert.assertTrue(pCnt > 0);
    format.close();
  }
 catch (  IOException e) {
    Assert.fail();
  }
catch (  RuntimeException e) {
    if (e.getMessage().equals("String_Node_Str")) {
      processDestroyed=true;
    }
  }
 finally {
    Assert.assertTrue(processDestroyed);
  }
}

Fixed version (ground truth):
@Test public void testOpen(){
  if (FileSystem.isWindows())   return;
  Configuration config=new Configuration();
  ExternalProcessInputSplit split=new ExternalProcessInputSplit(1,this.neverEndingCommand);
  boolean processDestroyed=false;
  try {
    format.configure(config);
    format.open(split);
    String[] cmd={"String_Node_Str","String_Node_Str","String_Node_Str"};
    byte[] wcOut=new byte[128];
    Process p=Runtime.getRuntime().exec(cmd);
    p.getInputStream().read(wcOut);
    int pCnt=Integer.parseInt(new String(wcOut).trim());
    Assert.assertTrue(pCnt > 0);
    format.close();
  }
 catch (  IOException e) {
    Assert.fail();
  }
catch (  RuntimeException e) {
    if (e.getMessage().equals("String_Node_Str")) {
      processDestroyed=true;
    }
  }
 finally {
    Assert.assertTrue(processDestroyed);
  }
}
Program: 55142
Project: 55142
Buggy source:
private FileInputSplit createTempFile(int[] contents) throws IOException {
  this.tempFile=File.createTempFile("String_Node_Str","String_Node_Str");
  DataOutputStream dos=new DataOutputStream(new FileOutputStream(tempFile));
  for (  int i : contents) {
    dos.writeInt(i);
  }
  dos.close();
  return new FileInputSplit(0,new Path("String_Node_Str" + this.tempFile.getAbsolutePath()),0,this.tempFile.length(),new String[]{"String_Node_Str"});
}

Fixed version (ground truth):
private FileInputSplit createTempFile(int[] contents) throws IOException {
  this.tempFile=File.createTempFile("String_Node_Str","String_Node_Str");
  DataOutputStream dos=new DataOutputStream(new FileOutputStream(tempFile));
  for (  int i : contents) {
    dos.writeInt(i);
  }
  dos.close();
  return new FileInputSplit(0,new Path(this.tempFile.toURI().toString()),0,this.tempFile.length(),new String[]{"String_Node_Str"});
}
Program: 55143
Project: 55143
Buggy source:
private FileInputSplit createTempFile(String content) throws IOException {
  this.tempFile=File.createTempFile("String_Node_Str","String_Node_Str");
  this.tempFile.deleteOnExit();
  DataOutputStream dos=new DataOutputStream(new FileOutputStream(tempFile));
  dos.writeBytes(content);
  dos.close();
  return new FileInputSplit(0,new Path("String_Node_Str" + this.tempFile.getAbsolutePath()),0,this.tempFile.length(),new String[]{"String_Node_Str"});
}

Fixed version (ground truth):
private FileInputSplit createTempFile(String content) throws IOException {
  this.tempFile=File.createTempFile("String_Node_Str","String_Node_Str");
  this.tempFile.deleteOnExit();
  DataOutputStream dos=new DataOutputStream(new FileOutputStream(tempFile));
  dos.writeBytes(content);
  dos.close();
  return new FileInputSplit(0,new Path(this.tempFile.toURI().toString()),0,this.tempFile.length(),new String[]{"String_Node_Str"});
}
Program: 55144
Project: 55144
Buggy source:
@Test public void testWriteNoRecPosNoLenient(){
  try {
    Configuration config=new Configuration();
    config.setString(RecordOutputFormat.FILE_PARAMETER_KEY,"String_Node_Str" + this.tempFile.getAbsolutePath());
    config.setString(RecordOutputFormat.FIELD_DELIMITER_PARAMETER,"String_Node_Str");
    config.setInteger(RecordOutputFormat.NUM_FIELDS_PARAMETER,2);
    config.setClass(RecordOutputFormat.FIELD_TYPE_PARAMETER_PREFIX + 0,PactString.class);
    config.setClass(RecordOutputFormat.FIELD_TYPE_PARAMETER_PREFIX + 1,PactInteger.class);
    format.configure(config);
    try {
      format.open(0);
    }
 catch (    IOException e) {
      fail(e.getMessage());
    }
    PactRecord r=new PactRecord(2);
    try {
      r.setField(0,new PactString("String_Node_Str"));
      r.setField(1,new PactInteger(42));
      format.writeRecord(r);
      r.setField(0,new PactString("String_Node_Str"));
      r.setField(1,new PactInteger(13));
      format.writeRecord(r);
      format.close();
      BufferedReader dis=new BufferedReader(new FileReader(tempFile));
      assertTrue((dis.readLine() + "String_Node_Str").equals("String_Node_Str"));
      assertTrue((dis.readLine() + "String_Node_Str").equals("String_Node_Str"));
      dis.close();
    }
 catch (    IOException e) {
      fail(e.getMessage());
    }
  }
 catch (  Exception ex) {
    Assert.fail("String_Node_Str" + ex.getClass().getSimpleName() + "String_Node_Str"+ ex.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testWriteNoRecPosNoLenient(){
  try {
    Configuration config=new Configuration();
    config.setString(RecordOutputFormat.FILE_PARAMETER_KEY,this.tempFile.toURI().toString());
    config.setString(RecordOutputFormat.FIELD_DELIMITER_PARAMETER,"String_Node_Str");
    config.setInteger(RecordOutputFormat.NUM_FIELDS_PARAMETER,2);
    config.setClass(RecordOutputFormat.FIELD_TYPE_PARAMETER_PREFIX + 0,PactString.class);
    config.setClass(RecordOutputFormat.FIELD_TYPE_PARAMETER_PREFIX + 1,PactInteger.class);
    format.configure(config);
    try {
      format.open(0);
    }
 catch (    IOException e) {
      fail(e.getMessage());
    }
    PactRecord r=new PactRecord(2);
    try {
      r.setField(0,new PactString("String_Node_Str"));
      r.setField(1,new PactInteger(42));
      format.writeRecord(r);
      r.setField(0,new PactString("String_Node_Str"));
      r.setField(1,new PactInteger(13));
      format.writeRecord(r);
      format.close();
      BufferedReader dis=new BufferedReader(new FileReader(tempFile));
      assertTrue((dis.readLine() + "String_Node_Str").equals("String_Node_Str"));
      assertTrue((dis.readLine() + "String_Node_Str").equals("String_Node_Str"));
      dis.close();
    }
 catch (    IOException e) {
      fail(e.getMessage());
    }
  }
 catch (  Exception ex) {
    Assert.fail("String_Node_Str" + ex.getClass().getSimpleName() + "String_Node_Str"+ ex.getMessage());
  }
}
Program: 55146
Project: 55146
Buggy source:
@Test public void testWriteRecPosNoLenientFail(){
  try {
    Configuration config=new Configuration();
    config.setString(RecordOutputFormat.FILE_PARAMETER_KEY,"String_Node_Str" + this.tempFile.getAbsolutePath());
    config.setString(RecordOutputFormat.FIELD_DELIMITER_PARAMETER,"String_Node_Str");
    config.setInteger(RecordOutputFormat.NUM_FIELDS_PARAMETER,2);
    config.setClass(RecordOutputFormat.FIELD_TYPE_PARAMETER_PREFIX + 0,PactString.class);
    config.setInteger(RecordOutputFormat.RECORD_POSITION_PARAMETER_PREFIX + 0,2);
    config.setClass(RecordOutputFormat.FIELD_TYPE_PARAMETER_PREFIX + 1,PactString.class);
    config.setInteger(RecordOutputFormat.RECORD_POSITION_PARAMETER_PREFIX + 1,0);
    format.configure(config);
    try {
      format.open(0);
    }
 catch (    IOException e) {
      fail(e.getMessage());
    }
    PactRecord r=new PactRecord(2);
    boolean success=true;
    try {
      r.setField(0,new PactString("String_Node_Str"));
      r.setField(1,new PactInteger(42));
      r.setField(2,new PactString("String_Node_Str"));
      format.writeRecord(r);
      r=new PactRecord();
      r.setField(0,new PactString("String_Node_Str"));
      r.setField(1,new PactInteger(13));
      format.writeRecord(r);
      format.close();
    }
 catch (    IOException e) {
      success=false;
    }
catch (    RuntimeException re) {
      success=false;
    }
    assertFalse(success);
  }
 catch (  Exception ex) {
    Assert.fail("String_Node_Str" + ex.getClass().getSimpleName() + "String_Node_Str"+ ex.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testWriteRecPosNoLenientFail(){
  try {
    Configuration config=new Configuration();
    config.setString(RecordOutputFormat.FILE_PARAMETER_KEY,this.tempFile.toURI().toString());
    config.setString(RecordOutputFormat.FIELD_DELIMITER_PARAMETER,"String_Node_Str");
    config.setInteger(RecordOutputFormat.NUM_FIELDS_PARAMETER,2);
    config.setClass(RecordOutputFormat.FIELD_TYPE_PARAMETER_PREFIX + 0,PactString.class);
    config.setInteger(RecordOutputFormat.RECORD_POSITION_PARAMETER_PREFIX + 0,2);
    config.setClass(RecordOutputFormat.FIELD_TYPE_PARAMETER_PREFIX + 1,PactString.class);
    config.setInteger(RecordOutputFormat.RECORD_POSITION_PARAMETER_PREFIX + 1,0);
    format.configure(config);
    try {
      format.open(0);
    }
 catch (    IOException e) {
      fail(e.getMessage());
    }
    PactRecord r=new PactRecord(2);
    boolean success=true;
    try {
      r.setField(0,new PactString("String_Node_Str"));
      r.setField(1,new PactInteger(42));
      r.setField(2,new PactString("String_Node_Str"));
      format.writeRecord(r);
      r=new PactRecord();
      r.setField(0,new PactString("String_Node_Str"));
      r.setField(1,new PactInteger(13));
      format.writeRecord(r);
      format.close();
    }
 catch (    IOException e) {
      success=false;
    }
catch (    RuntimeException re) {
      success=false;
    }
    assertFalse(success);
  }
 catch (  Exception ex) {
    Assert.fail("String_Node_Str" + ex.getClass().getSimpleName() + "String_Node_Str"+ ex.getMessage());
  }
}
Program: 55147
Project: 55147
Buggy source:
@Test public void testWriteNoRecPosNoLenientFail(){
  try {
    Configuration config=new Configuration();
    config.setString(RecordOutputFormat.FILE_PARAMETER_KEY,"String_Node_Str" + this.tempFile.getAbsolutePath());
    config.setString(RecordOutputFormat.FIELD_DELIMITER_PARAMETER,"String_Node_Str");
    config.setInteger(RecordOutputFormat.NUM_FIELDS_PARAMETER,2);
    config.setClass(RecordOutputFormat.FIELD_TYPE_PARAMETER_PREFIX + 0,PactString.class);
    config.setClass(RecordOutputFormat.FIELD_TYPE_PARAMETER_PREFIX + 1,PactInteger.class);
    format.configure(config);
    try {
      format.open(0);
    }
 catch (    IOException e) {
      fail(e.getMessage());
    }
    PactRecord r=new PactRecord(2);
    boolean success=true;
    try {
      r.setField(0,new PactString("String_Node_Str"));
      r.setField(1,new PactInteger(42));
      format.writeRecord(r);
      r.setNull(0);
      r.setField(1,new PactInteger(13));
      format.writeRecord(r);
      format.close();
    }
 catch (    IOException e) {
      success=false;
    }
catch (    RuntimeException re) {
      success=false;
    }
    assertFalse(success);
  }
 catch (  Exception ex) {
    Assert.fail("String_Node_Str" + ex.getClass().getSimpleName() + "String_Node_Str"+ ex.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testWriteNoRecPosNoLenientFail(){
  try {
    Configuration config=new Configuration();
    config.setString(RecordOutputFormat.FILE_PARAMETER_KEY,this.tempFile.toURI().toString());
    config.setString(RecordOutputFormat.FIELD_DELIMITER_PARAMETER,"String_Node_Str");
    config.setInteger(RecordOutputFormat.NUM_FIELDS_PARAMETER,2);
    config.setClass(RecordOutputFormat.FIELD_TYPE_PARAMETER_PREFIX + 0,PactString.class);
    config.setClass(RecordOutputFormat.FIELD_TYPE_PARAMETER_PREFIX + 1,PactInteger.class);
    format.configure(config);
    try {
      format.open(0);
    }
 catch (    IOException e) {
      fail(e.getMessage());
    }
    PactRecord r=new PactRecord(2);
    boolean success=true;
    try {
      r.setField(0,new PactString("String_Node_Str"));
      r.setField(1,new PactInteger(42));
      format.writeRecord(r);
      r.setNull(0);
      r.setField(1,new PactInteger(13));
      format.writeRecord(r);
      format.close();
    }
 catch (    IOException e) {
      success=false;
    }
catch (    RuntimeException re) {
      success=false;
    }
    assertFalse(success);
  }
 catch (  Exception ex) {
    Assert.fail("String_Node_Str" + ex.getClass().getSimpleName() + "String_Node_Str"+ ex.getMessage());
  }
}
Program: 55148
Project: 55148
Buggy source:
@Test public void testWriteNoRecPosLenient(){
  try {
    Configuration config=new Configuration();
    config.setString(RecordOutputFormat.FILE_PARAMETER_KEY,"String_Node_Str" + this.tempFile.getAbsolutePath());
    config.setString(RecordOutputFormat.FIELD_DELIMITER_PARAMETER,"String_Node_Str");
    config.setInteger(RecordOutputFormat.NUM_FIELDS_PARAMETER,2);
    config.setClass(RecordOutputFormat.FIELD_TYPE_PARAMETER_PREFIX + 0,PactString.class);
    config.setClass(RecordOutputFormat.FIELD_TYPE_PARAMETER_PREFIX + 1,PactInteger.class);
    config.setBoolean(RecordOutputFormat.LENIENT_PARSING,true);
    format.configure(config);
    try {
      format.open(0);
    }
 catch (    IOException e) {
      fail(e.getMessage());
    }
    PactRecord r=new PactRecord(2);
    try {
      r.setField(0,new PactString("String_Node_Str"));
      r.setField(1,new PactInteger(42));
      format.writeRecord(r);
      r.setNull(0);
      r.setField(1,new PactInteger(13));
      format.writeRecord(r);
      format.close();
      BufferedReader dis=new BufferedReader(new FileReader(tempFile));
      assertTrue((dis.readLine() + "String_Node_Str").equals("String_Node_Str"));
      assertTrue((dis.readLine() + "String_Node_Str").equals("String_Node_Str"));
      dis.close();
    }
 catch (    IOException e) {
      fail(e.getMessage());
    }
  }
 catch (  Exception ex) {
    Assert.fail("String_Node_Str" + ex.getClass().getSimpleName() + "String_Node_Str"+ ex.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testWriteNoRecPosLenient(){
  try {
    Configuration config=new Configuration();
    config.setString(RecordOutputFormat.FILE_PARAMETER_KEY,this.tempFile.toURI().toString());
    config.setString(RecordOutputFormat.FIELD_DELIMITER_PARAMETER,"String_Node_Str");
    config.setInteger(RecordOutputFormat.NUM_FIELDS_PARAMETER,2);
    config.setClass(RecordOutputFormat.FIELD_TYPE_PARAMETER_PREFIX + 0,PactString.class);
    config.setClass(RecordOutputFormat.FIELD_TYPE_PARAMETER_PREFIX + 1,PactInteger.class);
    config.setBoolean(RecordOutputFormat.LENIENT_PARSING,true);
    format.configure(config);
    try {
      format.open(0);
    }
 catch (    IOException e) {
      fail(e.getMessage());
    }
    PactRecord r=new PactRecord(2);
    try {
      r.setField(0,new PactString("String_Node_Str"));
      r.setField(1,new PactInteger(42));
      format.writeRecord(r);
      r.setNull(0);
      r.setField(1,new PactInteger(13));
      format.writeRecord(r);
      format.close();
      BufferedReader dis=new BufferedReader(new FileReader(tempFile));
      assertTrue((dis.readLine() + "String_Node_Str").equals("String_Node_Str"));
      assertTrue((dis.readLine() + "String_Node_Str").equals("String_Node_Str"));
      dis.close();
    }
 catch (    IOException e) {
      fail(e.getMessage());
    }
  }
 catch (  Exception ex) {
    Assert.fail("String_Node_Str" + ex.getClass().getSimpleName() + "String_Node_Str"+ ex.getMessage());
  }
}
Program: 55151
Project: 55151
Buggy source:
/** 
 * The TextInputFormat seems to fail reading more than one record. I guess its an off by one error. The easiest workaround is to setParameter(TextInputFormat.CHARSET_NAME, "ASCII");
 * @throws IOException
 */
@Test public void testPositionBug() throws IOException {
  File tempFile=File.createTempFile("String_Node_Str",null);
  tempFile.setWritable(true);
  PrintStream ps=new PrintStream(tempFile);
  ps.println("String_Node_Str");
  ps.println("String_Node_Str");
  ps.close();
  tempFile.deleteOnExit();
  TextInputFormat inputFormat=new TextInputFormat();
  Configuration parameters=new Configuration();
  parameters.setString(FileInputFormat.FILE_PARAMETER_KEY,"String_Node_Str" + tempFile.getAbsolutePath());
  inputFormat.configure(parameters);
  FileInputSplit[] splits=inputFormat.createInputSplits(1);
  assertTrue("String_Node_Str",splits.length >= 1);
  inputFormat.open(splits[0]);
  PactRecord r=new PactRecord();
  assertTrue("String_Node_Str",inputFormat.nextRecord(r));
  try {
    assertTrue("String_Node_Str",inputFormat.nextRecord(r));
  }
 catch (  IllegalArgumentException iae) {
    iae.printStackTrace();
    fail("String_Node_Str");
  }
  assertFalse("String_Node_Str",inputFormat.nextRecord(r));
}

Fixed version (ground truth):
/** 
 * The TextInputFormat seems to fail reading more than one record. I guess its an off by one error. The easiest workaround is to setParameter(TextInputFormat.CHARSET_NAME, "ASCII");
 * @throws IOException
 */
@Test public void testPositionBug() throws IOException {
  File tempFile=File.createTempFile("String_Node_Str",null);
  tempFile.setWritable(true);
  PrintStream ps=new PrintStream(tempFile);
  ps.println("String_Node_Str");
  ps.println("String_Node_Str");
  ps.close();
  tempFile.deleteOnExit();
  TextInputFormat inputFormat=new TextInputFormat();
  Configuration parameters=new Configuration();
  parameters.setString(FileInputFormat.FILE_PARAMETER_KEY,tempFile.toURI().toString());
  inputFormat.configure(parameters);
  FileInputSplit[] splits=inputFormat.createInputSplits(1);
  assertTrue("String_Node_Str",splits.length >= 1);
  inputFormat.open(splits[0]);
  PactRecord r=new PactRecord();
  assertTrue("String_Node_Str",inputFormat.nextRecord(r));
  try {
    assertTrue("String_Node_Str",inputFormat.nextRecord(r));
  }
 catch (  IllegalArgumentException iae) {
    iae.printStackTrace();
    fail("String_Node_Str");
  }
  assertFalse("String_Node_Str",inputFormat.nextRecord(r));
}
Program: 55152
Project: 55152
Buggy source:
public static String createTempFileDir(String... contents) throws IOException {
  File tempDir=new File(System.getProperty("String_Node_Str"));
  File f=null;
  do {
    f=new File(tempDir,randomFileName());
  }
 while (f.exists());
  f.mkdirs();
  f.deleteOnExit();
  for (  String s : contents) {
    File child=new File(f,randomFileName());
    child.deleteOnExit();
    BufferedWriter out=new BufferedWriter(new FileWriter(child));
    try {
      out.write(s);
    }
  finally {
      out.close();
    }
  }
  return f.getAbsolutePath();
}

Fixed version (ground truth):
public static String createTempFileDir(String... contents) throws IOException {
  File tempDir=new File(System.getProperty("String_Node_Str"));
  File f=null;
  do {
    f=new File(tempDir,randomFileName());
  }
 while (f.exists());
  f.mkdirs();
  f.deleteOnExit();
  for (  String s : contents) {
    File child=new File(f,randomFileName());
    child.deleteOnExit();
    BufferedWriter out=new BufferedWriter(new FileWriter(child));
    try {
      out.write(s);
    }
  finally {
      out.close();
    }
  }
  return f.toURI().toString();
}