nus-yam/ex-repair huggingface dataset:
Program: 90202
Project: 90202
Buggy source:
/** 
 * Verify that uploading a file adds the appropriate record to admin data.
 * @throws FileNotFoundException
 * @throws PermissionDenied
 * @throws IOException
 */
public void testUploadAdminAdded() throws PermissionDenied, FileNotFoundException, IOException {
  BitarchiveAdmin admin=BitarchiveAdmin.getInstance();
  assertNotNull("String_Node_Str",admin);
  BitarchiveARCFile arcfile=admin.lookup(ARC_FILE_NAME);
  assertNull("String_Node_Str",arcfile);
  archive.upload(new TestRemoteFile(ARC_FILE,false,false,false),ARC_FILE_NAME);
  archive.close();
  arcfile=admin.lookup(ARC_FILE_NAME);
  assertNotNull("String_Node_Str",arcfile);
}

Fixed version (ground truth):
/** 
 * Verify that uploading a file adds the appropriate record to admin data.
 * @throws FileNotFoundException
 * @throws PermissionDenied
 * @throws IOException
 */
public void testUploadAdminAdded() throws PermissionDenied, IOException {
  BitarchiveAdmin admin=BitarchiveAdmin.getInstance();
  assertNotNull("String_Node_Str",admin);
  BitarchiveARCFile arcfile=admin.lookup(ARC_FILE_NAME);
  assertNull("String_Node_Str",arcfile);
  archive.upload(new TestRemoteFile(ARC_FILE,false,false,false),ARC_FILE_NAME);
  archive.close();
  arcfile=admin.lookup(ARC_FILE_NAME);
  assertNotNull("String_Node_Str",arcfile);
}
Program: 90203
Project: 90203
Buggy source:
protected void tearDown() throws Exception {
  super.tearDown();
  if (archive != null) {
    archive.close();
  }
  FileUtils.removeRecursively(ARCHIVE_DIR);
  rf.tearDown();
  Settings.reload();
}

Fixed version (ground truth):
public void tearDown() throws Exception {
  super.tearDown();
}
Program: 90204
Project: 90204
Buggy source:
/** 
 * est that the batch code actually runs, that it enters each of the initialize() and finish() methods, and that process() is called at least once.
 */
public void testBatchCodeRuns(){
  TestFileBatchJob job=new TestFileBatchJob();
  BatchStatus lbs=archive.batch(TestInfo.baAppId,job);
  assertTrue("String_Node_Str",job.initialized);
  assertEquals("String_Node_Str",TestInfo.arcFiles.size(),job.processedFileList.size());
  assertTrue("String_Node_Str",job.finished);
  lbs.getResultFile().copyTo(TestInfo.BATCH_OUTPUT_FILE);
  FileAsserts.assertFileContains("String_Node_Str","String_Node_Str",TestInfo.BATCH_OUTPUT_FILE);
  FileAsserts.assertFileContains("String_Node_Str","String_Node_Str",TestInfo.BATCH_OUTPUT_FILE);
  FileAsserts.assertFileContains("String_Node_Str","String_Node_Str",TestInfo.BATCH_OUTPUT_FILE);
}

Fixed version (ground truth):
/** 
 * est that the batch code actually runs, that it enters each of the initialize() and finish() methods, and that process() is called at least once.
 */
public void testBatchCodeRuns(){
  TestFileBatchJob job=new TestFileBatchJob();
  BatchStatus lbs=archive.batch(TestInfo.baAppId,job);
  assertTrue("String_Node_Str",job.initialized);
  assertEquals("String_Node_Str",arcFiles.size(),job.processedFileList.size());
  assertTrue("String_Node_Str",job.finished);
  lbs.getResultFile().copyTo(TestInfo.BATCH_OUTPUT_FILE);
  FileAsserts.assertFileContains("String_Node_Str","String_Node_Str",TestInfo.BATCH_OUTPUT_FILE);
  FileAsserts.assertFileContains("String_Node_Str","String_Node_Str",TestInfo.BATCH_OUTPUT_FILE);
  FileAsserts.assertFileContains("String_Node_Str","String_Node_Str",TestInfo.BATCH_OUTPUT_FILE);
}
Program: 90205
Project: 90205
Buggy source:
/** 
 * At end of test, remove any files we managed to upload.
 */
public void tearDown(){
  archive.close();
  FileUtils.removeRecursively(TestInfo.ARCHIVE_DIR);
  rf.tearDown();
  Settings.reload();
}

Fixed version (ground truth):
/** 
 * At end of test, remove any files we managed to upload.
 */
public void tearDown() throws Exception {
  super.tearDown();
}
Program: 90206
Project: 90206
Buggy source:
/** 
 * Test that the batch code runs once for each entry. Both for multiple entries in a file and in several files.
 */
public void testBatchCodeRunsAll(){
  TestFileBatchJob job=new TestFileBatchJob();
  archive.batch(TestInfo.baAppId,job);
  assertEquals("String_Node_Str",TestInfo.ARCHIVE_SIZE,job.processedFileList.size());
}

Fixed version (ground truth):
/** 
 * Test that the batch code runs once for each entry. Both for multiple entries in a file and in several files.
 */
public void testBatchCodeRunsAll(){
  TestFileBatchJob job=new TestFileBatchJob();
  archive.batch(TestInfo.baAppId,job);
  assertEquals("String_Node_Str",ARCHIVE_SIZE,job.processedFileList.size());
}
Program: 90207
Project: 90207
Buggy source:
/** 
 * At start of test, set up an archive we can run against.
 */
public void setUp() throws PermissionDenied {
  FileUtils.removeRecursively(TestInfo.ARCHIVE_DIR);
  try {
    FileInputStream fis=new FileInputStream(TestInfo.TESTLOGPROP);
    LogManager.getLogManager().readConfiguration(fis);
    fis.close();
  }
 catch (  IOException e) {
    fail("String_Node_Str" + e);
  }
  FileUtils.createDir(TestInfo.ARCHIVE_DIR);
  Settings.set(Settings.REMOTE_FILE_CLASS,TestRemoteFile.class.getName());
  Settings.set(Settings.BITARCHIVE_SERVER_FILEDIR,TestInfo.ARCHIVE_DIR.getAbsolutePath());
  archive=Bitarchive.getInstance();
  for (  String filename : TestInfo.arcFiles) {
    FileUtils.copyFile(new File(TestInfo.ORIGINALS_DIR,filename),new File(new File(TestInfo.ARCHIVE_DIR,"String_Node_Str"),filename));
  }
  rf.setUp();
}

Fixed version (ground truth):
/** 
 * At start of test, set up an archive we can run against.
 */
public void setUp() throws Exception {
  super.setUp();
  File fileDir=new File(TestInfo.WORKING_DIR,"String_Node_Str");
  for (  String filename : arcFiles) {
    FileUtils.copyFile(new File(getOriginalsDir(),filename),new File(fileDir,filename));
  }
}
Program: 90208
Project: 90208
Buggy source:
private Constants(){
}

Fixed version (ground truth):
/** 
 * The contructor for this class. Making the constructor private prevents the class from being instantiated.
 */
private Constants(){
}
Program: 90209
Project: 90209
Buggy source:
/** 
 * Return the path used to store files that are removed by RemoveAndGetFileMessage.
 * @param existingFile
 * @return The full path of the file in the attic dir
 */
public File getAtticPath(File existingFile){
  String arcFileName=existingFile.getName();
  File parentDir=existingFile.getParentFile().getParentFile();
  if (!isBitarchiveDirectory(parentDir)) {
    log.warn("String_Node_Str" + existingFile + "String_Node_Str");
    throw new ArgumentNotValid("String_Node_Str" + "String_Node_Str" + existingFile + "String_Node_Str");
  }
  File atticdir=new File(parentDir,ATTIC_DIRECTORY_NAME);
  ApplicationUtils.dirMustExist(atticdir);
  return new File(atticdir,arcFileName);
}

Fixed version (ground truth):
/** 
 * Return the path used to store files that are removed by RemoveAndGetFileMessage.
 * @param existingFile
 * @return The full path of the file in the attic dir
 */
public File getAtticPath(File existingFile){
  existingFile=existingFile.getAbsoluteFile();
  String arcFileName=existingFile.getName();
  File parentDir=existingFile.getParentFile().getParentFile();
  if (!isBitarchiveDirectory(parentDir)) {
    log.warn("String_Node_Str" + existingFile + "String_Node_Str");
    throw new ArgumentNotValid("String_Node_Str" + "String_Node_Str" + existingFile + "String_Node_Str");
  }
  File atticdir=new File(parentDir,ATTIC_DIRECTORY_NAME);
  ApplicationUtils.dirMustExist(atticdir);
  return new File(atticdir,arcFileName);
}
Program: 90210
Project: 90210
Buggy source:
/** 
 * Moves a file from temporary storage to file storage. Note: It is checked, if tempLocation resides in directory TEMPORARY_DIRECTORY_NAME and whether the parent of tempLocation is a Bitarchive directory.
 * @param tempLocation The temporary location where the file was stored.This must be a path returned from getTemporaryPath
 * @return The location where the file is now stored
 * @throws IOFailure if tempLocation is not created from getTemporaryPathor file cannot be moved to Storage location.
 */
public File moveToStorage(File tempLocation){
  ArgumentNotValid.checkNotNull(tempLocation,"String_Node_Str");
  String arcFileName=tempLocation.getName();
  File arcFilePath=tempLocation.getParentFile();
  if (arcFilePath == null || !arcFilePath.getName().equals(TEMPORARY_DIRECTORY_NAME)) {
    throw new IOFailure("String_Node_Str" + tempLocation + "String_Node_Str"+ "String_Node_Str"+ TEMPORARY_DIRECTORY_NAME+ "String_Node_Str");
  }
  File archivedir=arcFilePath.getParentFile();
  if (archivedir == null || !isBitarchiveDirectory(archivedir)) {
    throw new IOFailure("String_Node_Str" + tempLocation + "String_Node_Str"+ "String_Node_Str");
  }
  File storagePath=new File(archivedir,FILE_DIRECTORY_NAME);
  File storageFile=new File(storagePath,arcFileName);
  if (!tempLocation.renameTo(storageFile)) {
    throw new IOFailure("String_Node_Str" + tempLocation.getPath() + "String_Node_Str"+ storageFile.getPath()+ "String_Node_Str");
  }
  return storageFile;
}

Fixed version (ground truth):
/** 
 * Moves a file from temporary storage to file storage. Note: It is checked, if tempLocation resides in directory TEMPORARY_DIRECTORY_NAME and whether the parent of tempLocation is a Bitarchive directory.
 * @param tempLocation The temporary location where the file was stored.This must be a path returned from getTemporaryPath
 * @return The location where the file is now stored
 * @throws IOFailure if tempLocation is not created from getTemporaryPathor file cannot be moved to Storage location.
 */
public File moveToStorage(File tempLocation){
  ArgumentNotValid.checkNotNull(tempLocation,"String_Node_Str");
  tempLocation=tempLocation.getAbsoluteFile();
  String arcFileName=tempLocation.getName();
  File arcFilePath=tempLocation.getParentFile();
  if (arcFilePath == null || !arcFilePath.getName().equals(TEMPORARY_DIRECTORY_NAME)) {
    throw new IOFailure("String_Node_Str" + tempLocation + "String_Node_Str"+ "String_Node_Str"+ TEMPORARY_DIRECTORY_NAME+ "String_Node_Str");
  }
  File archivedir=arcFilePath.getParentFile();
  if (archivedir == null || !isBitarchiveDirectory(archivedir)) {
    throw new IOFailure("String_Node_Str" + tempLocation + "String_Node_Str"+ "String_Node_Str");
  }
  File storagePath=new File(archivedir,FILE_DIRECTORY_NAME);
  File storageFile=new File(storagePath,arcFileName);
  if (!tempLocation.renameTo(storageFile)) {
    throw new IOFailure("String_Node_Str" + tempLocation.getPath() + "String_Node_Str"+ storageFile.getPath()+ "String_Node_Str");
  }
  return storageFile;
}
Program: 90211
Project: 90211
Buggy source:
/** 
 * Creates a new FileBasedCache object.  This creates a directory under the main cache directory holding cached files.
 * @param cacheName Name of this cache (enabling sharing among processes).The directoriy creating in the cachedir will have this name.
 */
public FileBasedCache(String cacheName){
  ArgumentNotValid.checkNotNullOrEmpty(cacheName,"String_Node_Str");
  this.cacheDir=new File(new File(Settings.get(Settings.CACHE_DIR)),cacheName);
  log.info("String_Node_Str" + cacheName + "String_Node_Str"+ getCacheDir().getAbsolutePath()+ "String_Node_Str");
  FileUtils.createDir(getCacheDir());
}

Fixed version (ground truth):
/** 
 * Creates a new FileBasedCache object.  This creates a directory under the main cache directory holding cached files.
 * @param cacheName Name of this cache (enabling sharing among processes).The directoriy creating in the cachedir will have this name.
 */
public FileBasedCache(String cacheName){
  ArgumentNotValid.checkNotNullOrEmpty(cacheName,"String_Node_Str");
  this.cacheDir=new File(new File(Settings.get(Settings.CACHE_DIR)),cacheName).getAbsoluteFile();
  log.info("String_Node_Str" + cacheName + "String_Node_Str"+ getCacheDir().getAbsolutePath()+ "String_Node_Str");
  FileUtils.createDir(getCacheDir());
}
Program: 90213
Project: 90213
Buggy source:
/** 
 * Copy this remote file to the given file. This method will make a fileoutputstream, and use appendTo to write the remote file to this stream.
 * @param destFile The file to write the remote file to.
 * @throws ArgumentNotValid on null destFile, or parent to destfile is nota writeable directory, or destfile exists and cannot be overwritten.
 * @throws IOFailure on I/O trouble writing remote file to destination.
 */
public void copyTo(File destFile){
  ArgumentNotValid.checkNotNull(destFile,"String_Node_Str");
  if ((!destFile.isFile() || !destFile.canWrite()) && (!destFile.getParentFile().isDirectory() || !destFile.getParentFile().canWrite())) {
    throw new ArgumentNotValid("String_Node_Str" + destFile + "String_Node_Str"+ file+ "String_Node_Str");
  }
  FileOutputStream fos=null;
  try {
    try {
      fos=new FileOutputStream(destFile);
      appendTo(fos);
    }
  finally {
      if (fos != null) {
        fos.close();
      }
    }
  }
 catch (  Exception e) {
    try {
      FileUtils.remove(destFile);
    }
 catch (    IOFailure e1) {
    }
    throw new IOFailure("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Copy this remote file to the given file. This method will make a fileoutputstream, and use appendTo to write the remote file to this stream.
 * @param destFile The file to write the remote file to.
 * @throws ArgumentNotValid on null destFile, or parent to destfile is nota writeable directory, or destfile exists and cannot be overwritten.
 * @throws IOFailure on I/O trouble writing remote file to destination.
 */
public void copyTo(File destFile){
  ArgumentNotValid.checkNotNull(destFile,"String_Node_Str");
  destFile=destFile.getAbsoluteFile();
  if ((!destFile.isFile() || !destFile.canWrite()) && (!destFile.getParentFile().isDirectory() || !destFile.getParentFile().canWrite())) {
    throw new ArgumentNotValid("String_Node_Str" + destFile + "String_Node_Str"+ file+ "String_Node_Str");
  }
  FileOutputStream fos=null;
  try {
    try {
      fos=new FileOutputStream(destFile);
      appendTo(fos);
    }
  finally {
      if (fos != null) {
        fos.close();
      }
    }
  }
 catch (  Exception e) {
    try {
      FileUtils.remove(destFile);
    }
 catch (    IOFailure e1) {
    }
    throw new IOFailure("String_Node_Str",e);
  }
}
Program: 90214
Project: 90214
Buggy source:
/** 
 * Copy this remote file to the given file. If the file resides on the current machine, remote file transfer is done locally. Otherwise, the remote file is transferred over http. If the file is not set to be able to be transferred multiple times, it is cleaned up after the transfer.
 * @param destFile The file to write the remote file to.
 * @throws ArgumentNotValid on null destFile, or parent to destfile is nota writeable directory, or destfile exists and cannot be overwritten.
 * @throws IOFailure on I/O trouble writing remote file to destination.
 */
public void copyTo(File destFile){
  ArgumentNotValid.checkNotNull(destFile,"String_Node_Str");
  if ((!destFile.isFile() || !destFile.canWrite()) && (!destFile.getParentFile().isDirectory() || !destFile.getParentFile().canWrite())) {
    throw new ArgumentNotValid("String_Node_Str" + destFile + "String_Node_Str"+ file+ "String_Node_Str");
  }
  if (isLocal() && fileDeletable && !multipleDownloads&& !useChecksums) {
    if (file.renameTo(destFile)) {
      cleanup();
      return;
    }
  }
  super.copyTo(destFile);
}

Fixed version (ground truth):
/** 
 * Copy this remote file to the given file. If the file resides on the current machine, remote file transfer is done locally. Otherwise, the remote file is transferred over http. If the file is not set to be able to be transferred multiple times, it is cleaned up after the transfer.
 * @param destFile The file to write the remote file to.
 * @throws ArgumentNotValid on null destFile, or parent to destfile is nota writeable directory, or destfile exists and cannot be overwritten.
 * @throws IOFailure on I/O trouble writing remote file to destination.
 */
public void copyTo(File destFile){
  ArgumentNotValid.checkNotNull(destFile,"String_Node_Str");
  destFile=destFile.getAbsoluteFile();
  if ((!destFile.isFile() || !destFile.canWrite()) && (!destFile.getParentFile().isDirectory() || !destFile.getParentFile().canWrite())) {
    throw new ArgumentNotValid("String_Node_Str" + destFile + "String_Node_Str"+ file+ "String_Node_Str");
  }
  if (isLocal() && fileDeletable && !multipleDownloads&& !useChecksums) {
    if (file.renameTo(destFile)) {
      cleanup();
      return;
    }
  }
  super.copyTo(destFile);
}
Program: 90216
Project: 90216
Buggy source:
/** 
 * Create a new ARCLookup object.
 * @param arcRepositoryClient The interface to the ArcRepository
 * @param indexDir Where the index will be placed.  This directoryshould be unique to this instance.
 * @throws ArgumentNotValid if arcRepositoryClient is null.
 */
public ARCLookup(ViewerArcRepositoryClient arcRepositoryClient,File indexDir){
  ArgumentNotValid.checkNotNull(arcRepositoryClient,"String_Node_Str");
  this.arcRepositoryClient=arcRepositoryClient;
  this.luceneIndexDir=indexDir;
  FileUtils.createDir(luceneIndexDir.getParentFile());
  luceneSearcher=null;
}

Fixed version (ground truth):
/** 
 * Create a new ARCLookup object.
 * @param arcRepositoryClient The interface to the ArcRepository
 * @param indexDir Where the index will be placed.  This directoryshould be unique to this instance.
 * @throws ArgumentNotValid if arcRepositoryClient is null.
 */
public ARCLookup(ViewerArcRepositoryClient arcRepositoryClient,File indexDir){
  ArgumentNotValid.checkNotNull(arcRepositoryClient,"String_Node_Str");
  this.arcRepositoryClient=arcRepositoryClient;
  this.luceneIndexDir=indexDir.getAbsoluteFile();
  FileUtils.createDir(luceneIndexDir.getParentFile());
  luceneSearcher=null;
}
Program: 90217
Project: 90217
Buggy source:
/** 
 * Verifies that the filename (absolute path) points to an existing file and that it is an arc file.
 * @param filename The filename to verify.
 * @return The arc file, as a File.
 */
private static File toArcFile(String filename){
  File f;
  try {
    f=FileUtils.makeValidFileFromExisting(filename);
    if (!FileUtils.ARCS_FILTER.accept(f.getParentFile(),f.getName())) {
      dieWithError("String_Node_Str" + filename + "String_Node_Str");
    }
    return f;
  }
 catch (  IOFailure e) {
    dieWithError("String_Node_Str" + filename + "String_Node_Str"+ e);
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Verifies that the filename (absolute path) points to an existing file and that it is an arc file.
 * @param filename The filename to verify.
 * @return The arc file, as a File.
 */
private static File toArcFile(String filename){
  File f;
  try {
    f=FileUtils.makeValidFileFromExisting(filename).getAbsoluteFile();
    if (!FileUtils.ARCS_FILTER.accept(f.getParentFile(),f.getName())) {
      dieWithError("String_Node_Str" + filename + "String_Node_Str");
    }
    return f;
  }
 catch (  IOFailure e) {
    dieWithError("String_Node_Str" + filename + "String_Node_Str"+ e);
    return null;
  }
}
Program: 90218
Project: 90218
Buggy source:
/** 
 * @param theFile A file to make relative
 * @param crawlDir A directory
 * @return the filepath of the theFile relative to crawldir. null, iftheFile is not relative to crawldir. null, if crawldir is not a directory.
 */
public static String relativeTo(File theFile,File crawlDir){
  if (!crawlDir.isDirectory()) {
    return null;
  }
  List<String> filePathList=new ArrayList<String>();
  List<String> crawlDirPath=new ArrayList<String>();
  File tempFile=theFile;
  filePathList.add(tempFile.getName());
  while ((tempFile=tempFile.getParentFile()) != null) {
    filePathList.add(tempFile.getName());
  }
  tempFile=crawlDir;
  crawlDirPath.add(tempFile.getName());
  while ((tempFile=tempFile.getParentFile()) != null) {
    crawlDirPath.add(tempFile.getName());
  }
  List sublist=filePathList.subList(crawlDirPath.size() - 2,filePathList.size());
  if (!crawlDirPath.equals(sublist)) {
    return null;
  }
  List<String> relativeList=filePathList.subList(0,crawlDirPath.size() - 2);
  StringBuffer sb=new StringBuffer();
  Collections.reverse(relativeList);
  for (  String aRelativeList : relativeList) {
    sb.append(aRelativeList);
    sb.append(File.separatorChar);
  }
  sb.deleteCharAt(sb.length() - 1);
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * @param theFile A file to make relative
 * @param crawlDir A directory
 * @return the filepath of the theFile relative to crawldir. null, iftheFile is not relative to crawldir. null, if crawldir is not a directory.
 */
public static String relativeTo(File theFile,File crawlDir){
  if (!crawlDir.isDirectory()) {
    return null;
  }
  List<String> filePathList=new ArrayList<String>();
  List<String> crawlDirPath=new ArrayList<String>();
  File tempFile=theFile.getAbsoluteFile();
  filePathList.add(tempFile.getName());
  while ((tempFile=tempFile.getParentFile()) != null) {
    filePathList.add(tempFile.getName());
  }
  tempFile=crawlDir.getAbsoluteFile();
  crawlDirPath.add(tempFile.getName());
  while ((tempFile=tempFile.getParentFile()) != null) {
    crawlDirPath.add(tempFile.getName());
  }
  List sublist=filePathList.subList(crawlDirPath.size() - 2,filePathList.size());
  if (!crawlDirPath.equals(sublist)) {
    return null;
  }
  List<String> relativeList=filePathList.subList(0,crawlDirPath.size() - 2);
  StringBuffer sb=new StringBuffer();
  Collections.reverse(relativeList);
  for (  String aRelativeList : relativeList) {
    sb.append(aRelativeList);
    sb.append(File.separatorChar);
  }
  sb.deleteCharAt(sb.length() - 1);
  return sb.toString();
}
Program: 90219
Project: 90219
Buggy source:
/** 
 * Return the number of bytes free on the disk that the given file resides on. This method only works on Linux. Assumes that df -B 1 <filename> gives output of the format Filesystem 1-blocks Used Available Use% Mounted on /dev/sda3 9852805120 5572796416 3779502080 60% / <p/> Method is slow - starts an external process.
 * @param f A file.
 * @return Number of bytes free on the disk that the file is on
 */
private static long getBytesFreeLinux(File f){
  try {
    if (!f.isDirectory()) {
      f=f.getParentFile();
    }
    Process p=Runtime.getRuntime().exec(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",f.getAbsolutePath()});
    final int exitValue=p.waitFor();
    String outputText=readProcessOutput(p.getInputStream());
    String errorText=readProcessOutput(p.getErrorStream());
    if (exitValue != 0) {
      throw new IOFailure("String_Node_Str" + exitValue + "String_Node_Str"+ errorText+ "String_Node_Str");
    }
    BufferedReader lines=new BufferedReader(new StringReader(outputText));
    lines.readLine();
    String kline=lines.readLine();
    String[] lineparts=kline.split("String_Node_Str");
    if (lineparts.length < 6) {
      throw new IOFailure("String_Node_Str" + kline);
    }
    return Long.parseLong(lineparts[3]);
  }
 catch (  NumberFormatException e) {
    throw new IOFailure("String_Node_Str",e);
  }
catch (  IOException e) {
    throw new IOFailure("String_Node_Str",e);
  }
catch (  InterruptedException e) {
    throw new IOFailure("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Return the number of bytes free on the disk that the given file resides on. This method only works on Linux. Assumes that df -B 1 <filename> gives output of the format Filesystem 1-blocks Used Available Use% Mounted on /dev/sda3 9852805120 5572796416 3779502080 60% / <p/> Method is slow - starts an external process.
 * @param f A file.
 * @return Number of bytes free on the disk that the file is on
 */
private static long getBytesFreeLinux(File f){
  try {
    if (!f.isDirectory()) {
      f=f.getAbsoluteFile().getParentFile();
    }
    Process p=Runtime.getRuntime().exec(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",f.getAbsolutePath()});
    final int exitValue=p.waitFor();
    String outputText=readProcessOutput(p.getInputStream());
    String errorText=readProcessOutput(p.getErrorStream());
    if (exitValue != 0) {
      throw new IOFailure("String_Node_Str" + exitValue + "String_Node_Str"+ errorText+ "String_Node_Str");
    }
    BufferedReader lines=new BufferedReader(new StringReader(outputText));
    lines.readLine();
    String kline=lines.readLine();
    String[] lineparts=kline.split("String_Node_Str");
    if (lineparts.length < 6) {
      throw new IOFailure("String_Node_Str" + kline);
    }
    return Long.parseLong(lineparts[3]);
  }
 catch (  NumberFormatException e) {
    throw new IOFailure("String_Node_Str",e);
  }
catch (  IOException e) {
    throw new IOFailure("String_Node_Str",e);
  }
catch (  InterruptedException e) {
    throw new IOFailure("String_Node_Str",e);
  }
}
Program: 90221
Project: 90221
Buggy source:
/** 
 * Gunzip all .gz files in a given directory into another.  Files in fromDir not ending in .gz or not real files will be skipped with a log entry.
 * @param fromDir The directory containing .gz files
 * @param toDir The directory to place the unzipped files in.  Thisdirectory must not exist beforehand.
 * @throws IOFailure if there are problems creating the output directoryor gunzipping the files.
 */
public static void gunzipFiles(File fromDir,File toDir){
  ArgumentNotValid.checkNotNull(fromDir,"String_Node_Str");
  ArgumentNotValid.checkNotNull(toDir,"String_Node_Str");
  ArgumentNotValid.checkTrue(fromDir.isDirectory(),"String_Node_Str" + fromDir + "String_Node_Str");
  ArgumentNotValid.checkTrue(!toDir.exists(),"String_Node_Str" + toDir + "String_Node_Str");
  File tempDir=FileUtils.createUniqueTempDir(toDir.getParentFile(),toDir.getName());
  try {
    File[] gzippedFiles=fromDir.listFiles();
    for (    File f : gzippedFiles) {
      if (f.isFile() && f.getName().endsWith(GZIP_SUFFIX)) {
        gunzipInto(f,tempDir);
      }
 else {
        log.trace("String_Node_Str" + f + "String_Node_Str");
      }
    }
    if (!tempDir.renameTo(toDir)) {
      throw new IOFailure("String_Node_Str" + tempDir + "String_Node_Str"+ toDir);
    }
  }
  finally {
    FileUtils.removeRecursively(tempDir);
  }
}

Fixed version (ground truth):
/** 
 * Gunzip all .gz files in a given directory into another.  Files in fromDir not ending in .gz or not real files will be skipped with a log entry.
 * @param fromDir The directory containing .gz files
 * @param toDir The directory to place the unzipped files in.  Thisdirectory must not exist beforehand.
 * @throws IOFailure if there are problems creating the output directoryor gunzipping the files.
 */
public static void gunzipFiles(File fromDir,File toDir){
  ArgumentNotValid.checkNotNull(fromDir,"String_Node_Str");
  ArgumentNotValid.checkNotNull(toDir,"String_Node_Str");
  ArgumentNotValid.checkTrue(fromDir.isDirectory(),"String_Node_Str" + fromDir + "String_Node_Str");
  ArgumentNotValid.checkTrue(!toDir.exists(),"String_Node_Str" + toDir + "String_Node_Str");
  File tempDir=FileUtils.createUniqueTempDir(toDir.getAbsoluteFile().getParentFile(),toDir.getName());
  try {
    File[] gzippedFiles=fromDir.listFiles();
    for (    File f : gzippedFiles) {
      if (f.isFile() && f.getName().endsWith(GZIP_SUFFIX)) {
        gunzipInto(f,tempDir);
      }
 else {
        log.trace("String_Node_Str" + f + "String_Node_Str");
      }
    }
    if (!tempDir.renameTo(toDir)) {
      throw new IOFailure("String_Node_Str" + tempDir + "String_Node_Str"+ toDir);
    }
  }
  finally {
    FileUtils.removeRecursively(tempDir);
  }
}
Program: 90224
Project: 90224
Buggy source:
/** 
 * Run the application.
 * @param args Command-line arguments:First arg is the it-conf.xml file to base the installation on. Second arg is the settings.xml file to use as base. Third arg is the name of the environment this will be used in, e.g. test or prod. Fourth (optional) arg is the directory to output files to.  If not given, files will be placed in a subdirectory of the current directory named the same as the envorinment arg.
 */
public static void main(String[] args){
  if (args.length < 3) {
    System.out.println("String_Node_Str" + "String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    System.exit(0);
  }
  String fname=args[0];
  String fnNameSettings=args[1];
  String environmentName=args[2];
  String outputdir="String_Node_Str" + environmentName + "String_Node_Str";
  if (args.length == 4) {
    outputdir=args[3];
  }
  ItConfiguration itConfig=new ItConfiguration(new File(fname));
  itConfig.setEnvironment(environmentName);
  itConfig.calculateDefaultSettings(new File(fnNameSettings).getParentFile());
  itConfig.loadDefaultSettings(new File(fnNameSettings),environmentName);
  File subdir=new File(outputdir);
  itConfig.writeSettings(subdir);
  for (  String loc : itConfig.locations) {
    itConfig.writeInstallAllSSH(new File(subdir,"String_Node_Str" + loc + "String_Node_Str"),new File(subdir,"String_Node_Str" + loc + "String_Node_Str"),new File(subdir,"String_Node_Str" + loc + "String_Node_Str"),loc);
  }
}

Fixed version (ground truth):
/** 
 * Run the application.
 * @param args Command-line arguments:First arg is the it-conf.xml file to base the installation on. Second arg is the settings.xml file to use as base. Third arg is the name of the environment this will be used in, e.g. test or prod. Fourth (optional) arg is the directory to output files to.  If not given, files will be placed in a subdirectory of the current directory named the same as the envorinment arg.
 */
public static void main(String[] args){
  if (args.length < 3) {
    System.out.println("String_Node_Str" + "String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    System.exit(0);
  }
  String fname=args[0];
  String fnNameSettings=args[1];
  String environmentName=args[2];
  String outputdir="String_Node_Str" + environmentName + "String_Node_Str";
  if (args.length == 4) {
    outputdir=args[3];
  }
  ItConfiguration itConfig=new ItConfiguration(new File(fname));
  itConfig.setEnvironment(environmentName);
  itConfig.calculateDefaultSettings(new File(fnNameSettings).getAbsoluteFile().getParentFile());
  itConfig.loadDefaultSettings(new File(fnNameSettings),environmentName);
  File subdir=new File(outputdir);
  itConfig.writeSettings(subdir);
  for (  String loc : itConfig.locations) {
    itConfig.writeInstallAllSSH(new File(subdir,"String_Node_Str" + loc + "String_Node_Str"),new File(subdir,"String_Node_Str" + loc + "String_Node_Str"),new File(subdir,"String_Node_Str" + loc + "String_Node_Str"),loc);
  }
}
Program: 90225
Project: 90225
Buggy source:
/** 
 * Create the start scripts for the harvester applications. Expected to be called once for each harvester instance.
 * @param res   The file to write the harvester script to. Note that thisfilename, with "harvester" replaced by "sidekick" will also be used to write the sidekick start script.
 * @param setfn the name of the settings file to use.
 */
public void writeStartHarvesterApps(File res,String setfn){
  File logdir=new File(installDir + "String_Node_Str");
  String settingsfn=installDir + "String_Node_Str" + setfn;
  writeStart(res,HarvestControllerApplication.class.getName(),settingsfn,logdir,logProperties,getHeritrixUiPortArgs() + "String_Node_Str" + getHeritrixJmxPortArgs());
  String sidekick=SideKick.class.getName() + "String_Node_Str" + HarvestControllerServerMonitorHook.class.getName()+ "String_Node_Str"+ res.getName()+ "String_Node_Str";
  File dir=res.getParentFile();
  String fn=res.getName().replaceAll("String_Node_Str","String_Node_Str");
  writeStart(new File(dir,fn),sidekick,settingsfn,logdir,logProperties,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Create the start scripts for the harvester applications. Expected to be called once for each harvester instance.
 * @param res   The file to write the harvester script to. Note that thisfilename, with "harvester" replaced by "sidekick" will also be used to write the sidekick start script.
 * @param setfn the name of the settings file to use.
 */
public void writeStartHarvesterApps(File res,String setfn){
  File logdir=new File(installDir + "String_Node_Str");
  String settingsfn=installDir + "String_Node_Str" + setfn;
  writeStart(res,HarvestControllerApplication.class.getName(),settingsfn,logdir,logProperties,getHeritrixUiPortArgs() + "String_Node_Str" + getHeritrixJmxPortArgs());
  String sidekick=SideKick.class.getName() + "String_Node_Str" + HarvestControllerServerMonitorHook.class.getName()+ "String_Node_Str"+ res.getName()+ "String_Node_Str";
  File dir=res.getAbsoluteFile().getParentFile();
  String fn=res.getName().replaceAll("String_Node_Str","String_Node_Str");
  writeStart(new File(dir,fn),sidekick,settingsfn,logdir,logProperties,"String_Node_Str");
}
Program: 90227
Project: 90227
Buggy source:
/** 
 * @see HeritrixController#getProgressStats() 
 */
public String getProgressStats(){
  String statistics=(String)executeCrawlJobCommand(PROGRESS_STATISTICS_COMMAND);
  if (statistics == null) {
    return "String_Node_Str";
  }
  return statistics;
}

Fixed version (ground truth):
/** 
 * @see HeritrixController#getProgressStats() 
 */
public String getProgressStats(){
  String status=(String)getCrawlJobAttribute(STATUS_ATTRIBUTE);
  if (status == null) {
    status="String_Node_Str";
  }
  String progressStatistics=(String)executeCrawlJobCommand(PROGRESS_STATISTICS_COMMAND);
  if (progressStatistics == null) {
    return "String_Node_Str";
  }
  return status + "String_Node_Str" + progressStatistics;
}
Program: 90228
Project: 90228
Buggy source:
/** 
 * Return status information for all jobs for a given harvest definition.
 * @param harvestId The ID of a harvest definition.
 * @param numEvent The harvest run number
 * @return A list of status objects with the pertinent information forall jobs for a given harvest definition.
 */
public abstract List<JobStatusInfo> getStatusInfo(long harvestId,long numEvent);

Fixed version (ground truth):
/** 
 * /** Return status information for all jobs with given job status.
 * @param status The status asked for.
 * @return  A list of status objects with the pertinent information for all jobs with given job status.
 */
public abstract List<JobStatusInfo> getStatusInfo(JobStatus status);
Program: 90229
Project: 90229
Buggy source:
/** 
 * Change an environment to be suitable for running Heritrix. At the moment, this involves the following: Use Jar files from the lib/heritrix/lib dir. Make sure the Heritrix jar file is at the front.
 * @param environment The environment from a process builder
 */
private void updateEnvironment(Map<String,String> environment){
  final String[] pathArray=environment.get("String_Node_Str").split("String_Node_Str");
  List<String> pathParts=new ArrayList<String>(Arrays.asList(pathArray));
  File heritrixLibDir=new File("String_Node_Str");
  File[] jars=heritrixLibDir.listFiles(new FilenameFilter(){
    public boolean accept(    File file,    String string){
      return string.endsWith("String_Node_Str");
    }
  }
);
  Arrays.sort(jars,new Comparator<File>(){
    public int compare(    File file,    File file1){
      return file1.compareTo(file);
    }
  }
);
  String heritixJar=null;
  for (  File lib : jars) {
    final String jarPath=new File(heritrixLibDir,lib.getName()).getAbsolutePath();
    if (lib.getName().startsWith("String_Node_Str")) {
      heritixJar=jarPath;
    }
 else {
      pathParts.add(0,jarPath);
    }
  }
  if (heritixJar != null) {
    pathParts.add(0,heritixJar);
  }
 else {
    throw new IOFailure("String_Node_Str");
  }
  environment.put("String_Node_Str",StringUtils.conjoin(pathParts,"String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Change an environment to be suitable for running Heritrix. At the moment, this involves the following: Use Jar files from the lib/heritrix/lib dir. Make sure the Heritrix jar file is at the front.
 * @param environment The environment from a process builder
 */
private void updateEnvironment(Map<String,String> environment){
  List<String> pathParts=SystemUtils.getCurrentClasspath();
  File heritrixLibDir=new File("String_Node_Str");
  File[] jars=heritrixLibDir.listFiles(new FilenameFilter(){
    public boolean accept(    File file,    String string){
      return string.endsWith("String_Node_Str");
    }
  }
);
  Arrays.sort(jars,new Comparator<File>(){
    public int compare(    File file,    File file1){
      return file1.compareTo(file);
    }
  }
);
  String heritixJar=null;
  for (  File lib : jars) {
    final String jarPath=new File(heritrixLibDir,lib.getName()).getAbsolutePath();
    if (lib.getName().startsWith("String_Node_Str")) {
      heritixJar=jarPath;
    }
 else {
      pathParts.add(0,jarPath);
    }
  }
  if (heritixJar != null) {
    pathParts.add(0,heritixJar);
  }
 else {
    throw new IOFailure("String_Node_Str");
  }
  environment.put("String_Node_Str",StringUtils.conjoin(pathParts,"String_Node_Str"));
}
Program: 90230
Project: 90230
Buggy source:
/** 
 * This method sets the current Lucene index this object works on, replacing and closing the current index if one is already set.
 * @param indexDir The new index, a directory containing Lucene files.
 * @throws ArgumentNotValid If argument is null, or the indexDir argumentisn't a directory
 */
public void setIndex(File indexDir){
  ArgumentNotValid.checkNotNull(indexDir,"String_Node_Str");
  ArgumentNotValid.checkTrue(indexDir.isDirectory(),"String_Node_Str" + indexDir + "String_Node_Str");
  if (luceneSearcher != null) {
    try {
      luceneSearcher.close();
    }
 catch (    IOException e) {
      throw new IOFailure("String_Node_Str" + luceneSearcher,e);
    }
 finally {
      luceneSearcher=null;
    }
  }
  try {
    luceneSearcher=new IndexSearcher(indexDir.getAbsolutePath());
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str" + indexDir,e);
  }
}

Fixed version (ground truth):
/** 
 * This method sets the current Lucene index this object works on, replacing and closing the current index if one is already set.
 * @param indexDir The new index, a directory containing Lucene files.
 * @throws ArgumentNotValid If argument is null
 */
public void setIndex(File indexDir){
  ArgumentNotValid.checkNotNull(indexDir,"String_Node_Str");
  ArgumentNotValid.checkTrue(indexDir.isDirectory(),"String_Node_Str" + indexDir + "String_Node_Str");
  if (luceneSearcher != null) {
    try {
      luceneSearcher.close();
    }
 catch (    IOException e) {
      throw new IOFailure("String_Node_Str" + luceneSearcher,e);
    }
 finally {
      luceneSearcher=null;
    }
  }
  try {
    luceneSearcher=new IndexSearcher(indexDir.getAbsolutePath());
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str" + indexDir,e);
  }
}
Program: 90231
Project: 90231
Buggy source:
/** 
 * Looks up a URI in our lucene index and extracts a key.
 * @param uri A URI to look for.
 * @return The file and offset where that URI can be found, or null if itdoesn't exist.
 * @throws IllegalState If a URL is found with a malformed origin field.
 * @throws IOFailure if no index is set or Lucene gives problems.
 */
private ARCKey luceneLookup(String uri){
  if (luceneSearcher == null) {
    throw new IOFailure("String_Node_Str" + uri + "String_Node_Str");
  }
  Query query=new TermQuery(new Term(DigestIndexer.FIELD_URL,uri));
  try {
    Hits hits=luceneSearcher.search(query);
    Document doc=null;
    if (hits != null) {
      log.debug("String_Node_Str" + hits.length() + "String_Node_Str"+ uri+ "String_Node_Str");
      for (int i=0; i < hits.length(); i++) {
        Document nextDoc=hits.doc(i);
        String origin=nextDoc.get(DigestIndexer.FIELD_ORIGIN);
        if (origin == null) {
          log.debug("String_Node_Str" + uri + "String_Node_Str"+ i);
          continue;
        }
 else {
          doc=chooseBestPotentialCandidate(doc,nextDoc,uri);
        }
      }
      if (doc != null) {
        return makeARCKey(doc.get(DigestIndexer.FIELD_ORIGIN),uri);
      }
    }
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str" + uri + "String_Node_Str",e);
  }
  log.debug("String_Node_Str" + uri + "String_Node_Str");
  return null;
}

Fixed version (ground truth):
/** 
 * Looks up a URI in our lucene index and extracts a key.
 * @param uri A URI to look for.
 * @return The file and offset where that URI can be found, or null if itdoesn't exist.
 * @throws IllegalState If a URL is found with a malformed origin field.
 * @throws IOFailure if no index is set or Lucene gives problems.
 */
private ARCKey luceneLookup(String uri){
  if (luceneSearcher == null) {
    throw new IOFailure("String_Node_Str" + uri + "String_Node_Str");
  }
  Query query=new TermQuery(new Term(DigestIndexer.FIELD_URL,uri));
  try {
    Hits hits=luceneSearcher.search(query);
    Document doc=null;
    if (hits != null) {
      for (int i=0; i < hits.length(); i++) {
        doc=hits.doc(i);
        String origin=doc.get(DigestIndexer.FIELD_ORIGIN);
        if (origin == null) {
          log.debug("String_Node_Str" + uri + "String_Node_Str"+ i);
          continue;
        }
        String[] originParts=origin.split("String_Node_Str");
        if (originParts.length != 2) {
          throw new IllegalState("String_Node_Str" + uri + "String_Node_Str"+ origin+ "String_Node_Str");
        }
        return new ARCKey(originParts[0],Long.parseLong(originParts[1]));
      }
    }
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str" + uri + "String_Node_Str",e);
  }
  return null;
}
Program: 90232
Project: 90232
Buggy source:
/** 
 * Create a new ARCLookup object.
 * @param arcRepositoryClient The interface to the ArcRepository
 * @throws ArgumentNotValid if argument arcRepositoryClient is null.
 */
public ARCLookup(ViewerArcRepositoryClient arcRepositoryClient){
  ArgumentNotValid.checkNotNull(arcRepositoryClient,"String_Node_Str");
  this.arcRepositoryClient=arcRepositoryClient;
  luceneSearcher=null;
}

Fixed version (ground truth):
/** 
 * Create a new ARCLookup object.
 * @param arcRepositoryClient The interface to the ArcRepository
 * @throws ArgumentNotValid if arcRepositoryClient is null.
 */
public ARCLookup(ViewerArcRepositoryClient arcRepositoryClient){
  ArgumentNotValid.checkNotNull(arcRepositoryClient,"String_Node_Str");
  this.arcRepositoryClient=arcRepositoryClient;
  luceneSearcher=null;
}
Program: 90234
Project: 90234
Buggy source:
/** 
 * Get a file for a given arcFileID.
 * @param arcFileID name of the file to be retrieved.
 * @return The file requested or null if not found
 * @throws ArgumentNotValid If arcFileID was null or empty.
 */
public File getFile(String arcFileID) throws ArgumentNotValid {
  log.info("String_Node_Str" + arcFileID);
  ArgumentNotValid.checkNotNullOrEmpty(arcFileID,"String_Node_Str");
  BitarchiveARCFile barc=admin.lookup(arcFileID);
  if (barc == null) {
    return null;
  }
  return barc.getFilePath();
}

Fixed version (ground truth):
/** 
 * Get a file for a given arcFileID.
 * @param arcFileID name of the file to be retrieved.
 * @return The file requested or null if not found
 * @throws ArgumentNotValid If arcFileID was null or empty.
 */
public File getFile(String arcFileID) throws ArgumentNotValid {
  log.info("String_Node_Str" + arcFileID + "String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(arcFileID,"String_Node_Str");
  BitarchiveARCFile barc=admin.lookup(arcFileID);
  if (barc == null) {
    return null;
  }
  File path=barc.getFilePath();
  log.info("String_Node_Str" + path + "String_Node_Str");
  return path;
}
Program: 90235
Project: 90235
Buggy source:
public void testLogBatch(){
  try {
    String logtxt=FileUtils.readFile(LOG_FILE);
    assertNotStringContains("String_Node_Str",logtxt,"String_Node_Str");
    try {
      archive.batch(TestInfo.baAppId,new ARCBatchJob(){
        public BatchFilter getFilter(){
          return BatchFilter.NO_FILTER;
        }
        public void initialize(        OutputStream os){
        }
        public void processRecord(        ARCRecord record,        OutputStream os){
        }
        public void finish(        OutputStream os){
        }
      }
);
    }
 catch (    Exception e) {
      fail("String_Node_Str" + e);
    }
    FileAsserts.assertFileContains("String_Node_Str","String_Node_Str",LOG_FILE);
    FileAsserts.assertFileContains("String_Node_Str","String_Node_Str",LOG_FILE);
  }
 catch (  IOException e) {
    fail("String_Node_Str" + e);
  }
}

Fixed version (ground truth):
public void testLogBatch(){
  try {
    String logtxt=FileUtils.readFile(LOG_FILE);
    assertNotStringContains("String_Node_Str",logtxt,"String_Node_Str");
    try {
      archive.batch(TestInfo.baAppId,new ARCBatchJob(){
        public BatchFilter getFilter(){
          return BatchFilter.NO_FILTER;
        }
        public void initialize(        OutputStream os){
        }
        public void processRecord(        ARCRecord record,        OutputStream os){
        }
        public void finish(        OutputStream os){
        }
      }
);
    }
 catch (    Exception e) {
      fail("String_Node_Str" + e);
    }
    FileAsserts.assertFileContains("String_Node_Str","String_Node_Str",LOG_FILE);
    FileAsserts.assertFileContains("String_Node_Str","String_Node_Str",LOG_FILE);
    FileAsserts.assertFileContains("String_Node_Str","String_Node_Str",LOG_FILE);
    FileAsserts.assertFileContains("String_Node_Str","String_Node_Str",LOG_FILE);
    FileAsserts.assertFileContains("String_Node_Str","String_Node_Str",LOG_FILE);
  }
 catch (  IOException e) {
    fail("String_Node_Str" + e);
  }
}
Program: 90238
Project: 90238
Buggy source:
/** 
 * Clean up.
 */
public void cleanup(){
  try {
    if (myQConn != null) {
      myQConn.close();
    }
    if (myTConn != null) {
      myTConn.close();
    }
    if (consumers != null) {
      consumers.clear();
    }
    if (senders != null) {
      senders.clear();
    }
    if (publishers != null) {
      publishers.clear();
    }
  }
 catch (  JMSException e) {
    throw new IOFailure("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Clean up.
 */
public void cleanup(){
  try {
    if (myQConn != null) {
      myQConn.close();
    }
    myQConn=null;
    if (myTConn != null) {
      myTConn.close();
    }
    myTConn=null;
    if (consumers != null) {
      consumers.clear();
    }
    consumers=null;
    if (senders != null) {
      senders.clear();
    }
    senders=null;
    if (publishers != null) {
      publishers.clear();
    }
  }
 catch (  JMSException e) {
    throw new IOFailure("String_Node_Str",e);
  }
}
Program: 90239
Project: 90239
Buggy source:
/** 
 * Returns a new TopicConnectionFactory. This is an SunMQ implementation of TopicConnectionFactory. Notice: The return type is explicitly defined with package prefix to avoid name collision with javax.jms.TopicConnectionFactory
 * @throws JMSException
 * @return TopicConnectionFactory
 */
protected javax.jms.TopicConnectionFactory getTopicConnectionFactory() throws JMSException {
  TopicConnectionFactory cFactory=new TopicConnectionFactory();
  ((com.sun.messaging.ConnectionFactory)cFactory).setProperty(com.sun.messaging.ConnectionConfiguration.imqBrokerHostName,getHost());
  ((com.sun.messaging.ConnectionFactory)cFactory).setProperty(com.sun.messaging.ConnectionConfiguration.imqBrokerHostPort,String.valueOf(getPort()));
  ((com.sun.messaging.ConnectionFactory)cFactory).setProperty(com.sun.messaging.ConnectionConfiguration.imqConsumerFlowLimit,"String_Node_Str");
  return cFactory;
}

Fixed version (ground truth):
/** 
 * Returns a new TopicConnectionFactory. This is an SunMQ implementation of TopicConnectionFactory. Notice: The return type is explicitly defined with package prefix to avoid name collision with javax.jms.TopicConnectionFactory
 * @throws JMSException
 * @return TopicConnectionFactory
 */
protected TopicConnectionFactory getTopicConnectionFactory() throws JMSException {
  TopicConnectionFactory cFactory=new TopicConnectionFactory();
  ((ConnectionFactory)cFactory).setProperty(ConnectionConfiguration.imqBrokerHostName,getHost());
  ((ConnectionFactory)cFactory).setProperty(ConnectionConfiguration.imqBrokerHostPort,String.valueOf(getPort()));
  ((ConnectionFactory)cFactory).setProperty(ConnectionConfiguration.imqConsumerFlowLimit,"String_Node_Str");
  return cFactory;
}