nus-yam/ex-repair huggingface dataset:
Program: 90166
Project: 90166
Buggy source:
/** 
 * @param stopReason The stopReason to set.
 * @throws dk.netarkivet.common.exceptions.ArgumentNotValid If argument is null
 */
public void setStopReason(StopReason stopReason){
  ArgumentNotValid.checkNotNull(stopReason,"String_Node_Str");
  this.stopReason=stopReason;
}

Fixed version (ground truth):
/** 
 * Set stopreason to something new.
 * @param stopReason The stopReason to set.
 * @throws ArgumentNotValid If argument is null
 */
public void setStopReason(StopReason stopReason){
  ArgumentNotValid.checkNotNull(stopReason,"String_Node_Str");
  this.stopReason=stopReason;
}
Program: 90167
Project: 90167
Buggy source:
private void rescheduleJobs(){
  final JobDAO dao=JobDAO.getInstance();
  final Iterator<Long> jobs=dao.getAllJobIds(JobStatus.SUBMITTED);
  int resubmitcount=0;
  while (jobs.hasNext()) {
    long oldID=jobs.next();
    long newID=dao.rescheduleJob(oldID);
    log.info("String_Node_Str" + oldID + "String_Node_Str"+ newID);
    resubmitcount++;
  }
  log.info(resubmitcount + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Reschedule all jobs with JobStatus SUBMITTED.
 */
private void rescheduleJobs(){
  final JobDAO dao=JobDAO.getInstance();
  final Iterator<Long> jobs=dao.getAllJobIds(JobStatus.SUBMITTED);
  int resubmitcount=0;
  while (jobs.hasNext()) {
    long oldID=jobs.next();
    long newID=dao.rescheduleJob(oldID);
    log.info("String_Node_Str" + oldID + "String_Node_Str"+ newID);
    resubmitcount++;
  }
  log.info(resubmitcount + "String_Node_Str");
}
Program: 90168
Project: 90168
Buggy source:
/** 
 * Create new instance of the HarvestScheduler.
 */
private HarvestScheduler(){
  log.info("String_Node_Str");
  hcc=HarvestControllerClient.getInstance();
  hsmon=HarvestSchedulerMonitorServer.getInstance();
  backupInitHour=Settings.getInt(Settings.DB_BACKUP_INIT_HOUR);
  if (backupInitHour < 0 || backupInitHour > 23) {
    log.warn("String_Node_Str" + backupInitHour);
    log.info("String_Node_Str");
    backupInitHour=0;
  }
 else {
    log.info("String_Node_Str" + backupInitHour);
  }
}

Fixed version (ground truth):
/** 
 * Create new instance of the HarvestScheduler.
 */
private HarvestScheduler(){
  log.info("String_Node_Str");
  hcc=HarvestControllerClient.getInstance();
  hsmon=HarvestSchedulerMonitorServer.getInstance();
  backupInitHour=Settings.getInt(Settings.DB_BACKUP_INIT_HOUR);
  if (backupInitHour < 0 || backupInitHour > 23) {
    log.warn("String_Node_Str" + "String_Node_Str" + backupInitHour);
    log.info("String_Node_Str");
    backupInitHour=0;
  }
 else {
    log.info("String_Node_Str" + backupInitHour);
  }
}
Program: 90169
Project: 90169
Buggy source:
/** 
 * Schedule all jobs ready for execution and perform backup if required. 
 */
private void scheduleJobs(){
synchronized (this) {
    if (running) {
      log.debug("String_Node_Str" + "String_Node_Str");
      return;
    }
    running=true;
  }
  if (backupNow()) {
    File backupDir=new File("String_Node_Str" + System.currentTimeMillis());
    try {
      DBSpecifics.getInstance().backupDatabase(backupDir);
      lastBackupDate=new Date();
    }
 catch (    SQLException e) {
      log.warn("String_Node_Str" + backupDir,e);
    }
  }
  try {
    final HarvestDefinitionDAO hddao=HarvestDefinitionDAO.getInstance();
    hddao.generateJobs(new Date());
    submitNewJobs();
  }
  finally {
synchronized (this) {
      running=false;
    }
  }
}

Fixed version (ground truth):
/** 
 * Schedule all jobs ready for execution and perform backup if required. 
 */
private void scheduleJobs(){
synchronized (this) {
    if (running) {
      log.debug("String_Node_Str" + "String_Node_Str");
      return;
    }
    running=true;
  }
  if (backupNow()) {
    File backupDir=new File("String_Node_Str" + System.currentTimeMillis());
    try {
      DBSpecifics.getInstance().backupDatabase(backupDir);
      lastBackupDate=new Date();
    }
 catch (    SQLException e) {
      String errMsg="String_Node_Str" + backupDir;
      log.warn(errMsg,e);
      NotificationsFactory.getInstance().errorEvent(errMsg,e);
    }
  }
  try {
    final HarvestDefinitionDAO hddao=HarvestDefinitionDAO.getInstance();
    hddao.generateJobs(new Date());
    submitNewJobs();
  }
  finally {
synchronized (this) {
      running=false;
    }
  }
}
Program: 90170
Project: 90170
Buggy source:
/** 
 * Constructor for the JMXStatusEntry. 
 * @param mBeanName The ObjectName to be assigned to the MBean representing this JMXStatusEntry.
 */
public JMXStatusEntry(ObjectName mBeanName){
  ArgumentNotValid.checkNotNull(mBeanName,"String_Node_Str");
  this.mBeanName=mBeanName;
}

Fixed version (ground truth):
/** 
 * Constructor for the JMXStatusEntry. 
 * @param mBeanName The ObjectName to be assigned to the MBean representingthis JMXStatusEntry.
 */
public JMXStatusEntry(ObjectName mBeanName){
  ArgumentNotValid.checkNotNull(mBeanName,"String_Node_Str");
  this.mBeanName=mBeanName;
}
Program: 90171
Project: 90171
Buggy source:
/** 
 * Update a security policy file with required permissions. Known code already has permission to do anything, while third-party code (submitted for batch) must be allowed to read bitarchive files.
 * @param securityFile File to add permissions to.
 */
public void updateSecurityFile(File securityFile){
  ArgumentNotValid.checkNotNull(securityFile,"String_Node_Str");
  if (isType(Type.bitarchive) && properties.get(Constants.BITARCHIVE_FILEDIR_PROPERTY) != null) {
    FileUtils.appendToFile(securityFile,"String_Node_Str");
    List<String> fileDirs=properties.get(Constants.BITARCHIVE_FILEDIR_PROPERTY);
    String dirSep="String_Node_Str";
    if (getOS() == OS.WINDOWS) {
      dirSep="String_Node_Str";
    }
    for (    String dir : fileDirs) {
      final String archivePath=StringUtils.conjoin(dirSep,dir,"String_Node_Str","String_Node_Str");
      FileUtils.appendToFile(securityFile,"String_Node_Str" + archivePath + "String_Node_Str");
    }
    FileUtils.appendToFile(securityFile,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Update a security policy file with required permissions. Known code already has permission to do anything, while third-party code (submitted for batch) must be allowed to read bitarchive files.
 * @see http://java.sun.com/j2se/1.5.0/docs/guide/security/PolicyFiles.html
 * @param securityFile File to add permissions to.
 */
public void updateSecurityFile(File securityFile){
  ArgumentNotValid.checkNotNull(securityFile,"String_Node_Str");
  if (isType(Type.bitarchive) && properties.get(Constants.BITARCHIVE_FILEDIR_PROPERTY) != null) {
    FileUtils.appendToFile(securityFile,"String_Node_Str");
    List<String> fileDirs=properties.get(Constants.BITARCHIVE_FILEDIR_PROPERTY);
    for (    String dir : fileDirs) {
      String archivePath=StringUtils.conjoin("String_Node_Str",dir,"String_Node_Str","String_Node_Str");
      archivePath=archivePath.replaceAll("String_Node_Str","String_Node_Str");
      FileUtils.appendToFile(securityFile,"String_Node_Str" + archivePath + "String_Node_Str");
    }
    FileUtils.appendToFile(securityFile,"String_Node_Str");
  }
}
Program: 90172
Project: 90172
Buggy source:
/** 
 * Update a security policy file with required permissions. Known code already has permission to do anything, while third-party code (submitted for batch) must be allowed to read bitarchive files.
 * @param securityFile File to add permissions to.
 */
public void updateSecurityFile(File securityFile){
  ArgumentNotValid.checkNotNull(securityFile,"String_Node_Str");
  if (isType(Type.bitarchive) && properties.get(Constants.BITARCHIVE_FILEDIR_PROPERTY) != null) {
    FileUtils.appendToFile(securityFile,"String_Node_Str");
    List<String> fileDirs=properties.get(Constants.BITARCHIVE_FILEDIR_PROPERTY);
    for (    String dir : fileDirs) {
      FileUtils.appendToFile(securityFile,"String_Node_Str" + "String_Node_Str" + dir + "String_Node_Str");
    }
    FileUtils.appendToFile(securityFile,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Update a security policy file with required permissions. Known code already has permission to do anything, while third-party code (submitted for batch) must be allowed to read bitarchive files.
 * @param securityFile File to add permissions to.
 */
public void updateSecurityFile(File securityFile){
  ArgumentNotValid.checkNotNull(securityFile,"String_Node_Str");
  if (isType(Type.bitarchive) && properties.get(Constants.BITARCHIVE_FILEDIR_PROPERTY) != null) {
    FileUtils.appendToFile(securityFile,"String_Node_Str");
    List<String> fileDirs=properties.get(Constants.BITARCHIVE_FILEDIR_PROPERTY);
    String dirSep="String_Node_Str";
    if (getOS() == OS.WINDOWS) {
      dirSep="String_Node_Str";
    }
    for (    String dir : fileDirs) {
      final String archivePath=StringUtils.conjoin(dirSep,dir,"String_Node_Str","String_Node_Str");
      FileUtils.appendToFile(securityFile,"String_Node_Str" + archivePath + "String_Node_Str");
    }
    FileUtils.appendToFile(securityFile,"String_Node_Str");
  }
}
Program: 90175
Project: 90175
Buggy source:
/** 
 * Generate a map of checksums for this file in the bitarchive.
 * @return Map containing the output of checksum jobs from the bitarchives.
 * @param filename
 */
private Map<Location,List<String>> getChecksumMap(String filename){
  Map<Location,List<String>> baname2checksum=new HashMap<Location,List<String>>();
  for (  Location ba : Location.getKnown()) {
    List<String> checksum=getChecksums(ba,filename);
    log.debug("String_Node_Str" + checksum + "String_Node_Str"+ ba);
    baname2checksum.put(ba,checksum);
  }
  return baname2checksum;
}

Fixed version (ground truth):
/** 
 * Generate a map of checksums for this file in the bitarchive.
 * @return Map containing the output of checksum jobs from the bitarchives.
 * @param filename
 */
static Map<Location,List<String>> getChecksumMap(String filename){
  Map<Location,List<String>> baname2checksum=new HashMap<Location,List<String>>();
  for (  Location ba : Location.getKnown()) {
    List<String> checksum=getChecksums(ba,filename);
    log.debug("String_Node_Str" + checksum + "String_Node_Str"+ ba);
    baname2checksum.put(ba,checksum);
  }
  return baname2checksum;
}
Program: 90176
Project: 90176
Buggy source:
public void run(){
synchronized (waitThread) {
    waitThread.interrupt();
  }
}

Fixed version (ground truth):
public void run(){
synchronized (waitThread) {
    if (!doneWaiting.get()) {
      waitThread.interrupt();
    }
  }
}
Program: 90177
Project: 90177
Buggy source:
/** 
 * Wait for the end of a process, but only for a limited time.  This method takes care of the ways waitFor can get interrupted.
 * @param p Process to wait for
 * @param maxWait
 * @return Exit value for process, or null if the process didn't exitwithin the expected time.
 */
public static Integer waitFor(Process p,long maxWait){
  long startTime=System.currentTimeMillis();
  Timer timer=new Timer(true);
  final Thread waitThread=Thread.currentThread();
  boolean wakeupScheduled=false;
  while (System.currentTimeMillis() < startTime + maxWait) {
    try {
      if (!wakeupScheduled) {
synchronized (waitThread) {
          timer.schedule(new TimerTask(){
            public void run(){
synchronized (waitThread) {
                waitThread.interrupt();
              }
            }
          }
,maxWait);
          wakeupScheduled=true;
          return p.waitFor();
        }
      }
 else {
        return p.waitFor();
      }
    }
 catch (    InterruptedException e) {
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Wait for the end of a process, but only for a limited time.  This method takes care of the ways waitFor can get interrupted.
 * @param p Process to wait for
 * @param maxWait
 * @return Exit value for process, or null if the process didn't exitwithin the expected time.
 */
public static Integer waitFor(final Process p,long maxWait){
  long startTime=System.currentTimeMillis();
  Timer timer=new Timer(true);
  final Thread waitThread=Thread.currentThread();
  boolean wakeupScheduled=false;
  final AtomicBoolean doneWaiting=new AtomicBoolean(false);
  while (System.currentTimeMillis() < startTime + maxWait) {
    try {
      if (!wakeupScheduled) {
synchronized (waitThread) {
          timer.schedule(new TimerTask(){
            public void run(){
synchronized (waitThread) {
                if (!doneWaiting.get()) {
                  waitThread.interrupt();
                }
              }
            }
          }
,maxWait);
          wakeupScheduled=true;
        }
      }
      p.waitFor();
      break;
    }
 catch (    InterruptedException e) {
    }
  }
synchronized (waitThread) {
    timer.cancel();
    doneWaiting.set(true);
    Thread.interrupted();
  }
  try {
    return p.exitValue();
  }
 catch (  IllegalThreadStateException e) {
    log.warn("String_Node_Str" + p + "String_Node_Str"+ (System.currentTimeMillis() - startTime)+ "String_Node_Str");
    return null;
  }
}
Program: 90178
Project: 90178
Buggy source:
public static void addToSuite(TestSuite suite){
  suite.addTestSuite(ApplicationUtilsTester.class);
  suite.addTestSuite(ExceptionUtilsTester.class);
  suite.addTestSuite(FileUtilsTester.class);
  suite.addTestSuite(FilterIteratorTester.class);
  suite.addTestSuite(MD5Tester.class);
  suite.addTestSuite(SimpleXmlTester.class);
  suite.addTestSuite(StringUtilsTester.class);
  suite.addTestSuite(SystemUtilsTester.class);
  suite.addTestSuite(XmlUtilsTester.class);
  suite.addTestSuite(ZipUtilsTester.class);
  suite.addTestSuite(LargeFileGZIPInputStreamTester.class);
}

Fixed version (ground truth):
public static void addToSuite(TestSuite suite){
  suite.addTestSuite(ApplicationUtilsTester.class);
  suite.addTestSuite(ExceptionUtilsTester.class);
  suite.addTestSuite(FileUtilsTester.class);
  suite.addTestSuite(FilterIteratorTester.class);
  suite.addTestSuite(LargeFileGZIPInputStreamTester.class);
  suite.addTestSuite(MD5Tester.class);
  suite.addTestSuite(ProcessUtilsTester.class);
  suite.addTestSuite(SettingsFactoryTester.class);
  suite.addTestSuite(SimpleXmlTester.class);
  suite.addTestSuite(StreamUtilsTester.class);
  suite.addTestSuite(StringUtilsTester.class);
  suite.addTestSuite(SystemUtilsTester.class);
  suite.addTestSuite(XmlTreeTester.class);
  suite.addTestSuite(XmlUtilsTester.class);
  suite.addTestSuite(ZipUtilsTester.class);
}
Program: 90179
Project: 90179
Buggy source:
/** 
 * Submit an ObjectMessage to the destination channel.
 * @param nMsg the NetarkivetMessage to be wrapped and send as an ObjectMessage
 * @param to the destination channel
 * @throws IOFailure if message failed to be sent.
 */
protected void sendMessage(NetarkivetMessage nMsg,ChannelID to) throws IOFailure {
  JMSException lastException=null;
  boolean operationSuccessful=false;
  int tries=0;
  while (!operationSuccessful || tries < JMS_MAXTRIES) {
    tries++;
    try {
      if (to.isTopic()) {
        sendToTopic(nMsg,to);
      }
 else {
        sendToQueue(nMsg,to);
      }
      operationSuccessful=true;
    }
 catch (    JMSException e) {
      log.warn("String_Node_Str" + tries + "String_Node_Str"+ e);
      lastException=e;
    }
  }
  if (!operationSuccessful) {
    throw new IOFailure("String_Node_Str",lastException);
  }
}

Fixed version (ground truth):
/** 
 * Submit an ObjectMessage to the destination channel.
 * @param nMsg the NetarkivetMessage to be wrapped and send as an ObjectMessage
 * @param to the destination channel
 * @throws IOFailure if message failed to be sent.
 */
protected void sendMessage(NetarkivetMessage nMsg,ChannelID to) throws IOFailure {
  JMSException lastException=null;
  boolean operationSuccessful=false;
  int tries=0;
  while (!operationSuccessful && tries < JMS_MAXTRIES) {
    tries++;
    while (reconnectInProgress.get() != false) {
      log.warn("String_Node_Str");
      exponentialBackoffSleep(tries);
    }
    try {
      if (to.isTopic()) {
        sendToTopic(nMsg,to);
      }
 else {
        sendToQueue(nMsg,to);
      }
      operationSuccessful=true;
    }
 catch (    JMSException e) {
      log.warn("String_Node_Str" + tries + "String_Node_Str"+ e);
      lastException=e;
    }
  }
  if (!operationSuccessful) {
    throw new IOFailure("String_Node_Str",lastException);
  }
}
Program: 90180
Project: 90180
Buggy source:
/** 
 * 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);
  }
}

Fixed version (ground truth):
/** 
 * Clean up.
 */
public void cleanup(){
  while (reconnectInProgress.get() != false) {
    log.warn("String_Node_Str");
    exponentialBackoffSleep(1);
  }
  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: 90181
Project: 90181
Buggy source:
/** 
 * Remove all messages waiting in a queue/topic. When this method ends, there are no messages on the queue/topic (though some can still arrive afterwards). For a queue, this does not ensure that all messages disappear, other processes could still make it in and take some. For a topic, this does not ensure that nobody will receive these messages.
 * @param mq The queue/topic to remove messages from
 * @return A list of all messages removed from the queue/topic.
 */
public List<Message> removeAllMessages(ChannelID mq){
  throw new NotImplementedException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Remove all messages waiting in a queue/topic. When this method ends, there are no messages on the queue/topic (though some can still arrive afterwards). For a queue, this does not ensure that all messages disappear, other processes could still make it in and take some. For a topic, this does not ensure that nobody will receive these messages.
 * @param mq The queue/topic to remove messages from
 * @return A list of all messages removed from the queue/topic.
 */
public List<Message> removeAllMessages(ChannelID mq){
  ArgumentNotValid.checkNotNull(mq,"String_Node_Str");
  log.info("String_Node_Str" + mq);
  MessageConsumer consumer=null;
  List<Message> messages=null;
  String message="String_Node_Str" + mq + "String_Node_Str";
  int tries=0;
  JMSException lastException=null;
  boolean operationSuccessful=false;
  while (!operationSuccessful && tries < JMS_MAXTRIES) {
    tries++;
    while (reconnectInProgress.get() != false) {
      log.warn("String_Node_Str");
      exponentialBackoffSleep(1);
    }
    try {
      messages=new ArrayList<Message>();
      if (mq.isTopic()) {
        consumer=myTSess.createSubscriber(getTopic(mq.getName()));
      }
 else {
        consumer=myQSess.createReceiver(getQueue(mq.getName()));
      }
      Message msg;
      while ((msg=consumer.receiveNoWait()) != null) {
        messages.add(msg);
      }
      consumer.close();
      operationSuccessful=true;
    }
 catch (    JMSException e) {
      lastException=e;
      if (consumer != null) {
        try {
          consumer.close();
        }
 catch (        JMSException e1) {
        }
      }
      log.warn(message,e);
      exponentialBackoffSleep(tries);
    }
  }
  if (!operationSuccessful) {
    throw new IOFailure(message,lastException);
  }
  return messages;
}
Program: 90182
Project: 90182
Buggy source:
/** 
 * Method adds a listener to the given queue or topic.
 * @param mq the messagequeue to listen to
 * @param ml the messagelistener
 * @throws IOFailure if the operation failed.
 */
public void setListener(ChannelID mq,MessageListener ml) throws IOFailure {
  ArgumentNotValid.checkNotNull(mq,"String_Node_Str");
  ArgumentNotValid.checkNotNull(ml,"String_Node_Str");
  log.debug("String_Node_Str" + ml.toString() + "String_Node_Str"+ mq.toString());
  String errMsg="String_Node_Str" + mq.getName();
  String key=getConsumerKey(mq,ml);
  int tries=0;
  boolean operationSuccessful=false;
  JMSException lastException=null;
  while (!operationSuccessful || tries < JMS_MAXTRIES) {
    tries++;
    try {
      if (mq.isTopic()) {
        TopicSubscriber myTopicSubscriber=myTSess.createSubscriber(getTopic(mq.getName()));
        myTopicSubscriber.setMessageListener(ml);
        if (consumers.get(key) == null) {
          consumers.put(key,myTopicSubscriber);
        }
      }
 else {
        Queue queue=getQueue(mq.getName());
        QueueReceiver myQueueReceiver=myQSess.createReceiver(queue);
        myQueueReceiver.setMessageListener(ml);
        if (consumers.get(key) == null) {
          consumers.put(key,myQueueReceiver);
        }
      }
      operationSuccessful=true;
    }
 catch (    JMSException e) {
      lastException=e;
      log.warn(errMsg,e);
    }
  }
  if (!operationSuccessful) {
    throw new IOFailure(errMsg,lastException);
  }
}

Fixed version (ground truth):
/** 
 * Method adds a listener to the given queue or topic.
 * @param mq the messagequeue to listen to
 * @param ml the messagelistener
 * @throws IOFailure if the operation failed.
 */
public void setListener(ChannelID mq,MessageListener ml) throws IOFailure {
  ArgumentNotValid.checkNotNull(mq,"String_Node_Str");
  ArgumentNotValid.checkNotNull(ml,"String_Node_Str");
  log.debug("String_Node_Str" + ml.toString() + "String_Node_Str"+ mq.toString());
  String errMsg="String_Node_Str" + mq.getName();
  String key=getConsumerKey(mq,ml);
  int tries=0;
  boolean operationSuccessful=false;
  JMSException lastException=null;
  while (!operationSuccessful && tries < JMS_MAXTRIES) {
    tries++;
    while (reconnectInProgress.get() != false) {
      log.warn("String_Node_Str");
      exponentialBackoffSleep(tries);
    }
    try {
      if (mq.isTopic()) {
        TopicSubscriber myTopicSubscriber=myTSess.createSubscriber(getTopic(mq.getName()));
        myTopicSubscriber.setMessageListener(ml);
        if (consumers.get(key) == null) {
          consumers.put(key,myTopicSubscriber);
        }
      }
 else {
        Queue queue=getQueue(mq.getName());
        QueueReceiver myQueueReceiver=myQSess.createReceiver(queue);
        myQueueReceiver.setMessageListener(ml);
        if (consumers.get(key) == null) {
          consumers.put(key,myQueueReceiver);
        }
      }
      operationSuccessful=true;
    }
 catch (    JMSException e) {
      lastException=e;
      log.warn(errMsg,e);
      exponentialBackoffSleep(tries);
    }
  }
  if (!operationSuccessful) {
    throw new IOFailure(errMsg,lastException);
  }
}
Program: 90183
Project: 90183
Buggy source:
/** 
 * Submit an object to the reply queue. We try to do it JMX_MAXTRIES times before giving up.
 * @param nMsg The NetarkivetMessage to send to the reply queue (null not allowed)
 * @throws ArgumentNotValid if nMsg is null.
 * @throws IOFailure if the operation failed.
 */
public void reply(NetarkivetMessage nMsg){
  ArgumentNotValid.checkNotNull(nMsg,"String_Node_Str");
  JMSException lastException=null;
  boolean operationSuccessful=false;
  int tries=0;
  while (!operationSuccessful || tries < JMS_MAXTRIES) {
    tries++;
    try {
      tries++;
      ObjectMessage msg=myQSess.createObjectMessage(nMsg);
      String queueName=nMsg.getReplyTo().getName();
      QueueSender queueSender=senders.get(queueName);
      if (queueSender == null) {
        queueSender=myQSess.createSender(getQueue(queueName));
        senders.put(queueName,queueSender);
      }
synchronized (nMsg) {
        log.debug("String_Node_Str" + queueName + "String_Node_Str"+ nMsg.replyOfId);
        queueSender.send(msg);
        log.debug("String_Node_Str" + queueSender.getQueue().getQueueName());
        nMsg.updateId(msg.getJMSMessageID());
      }
      operationSuccessful=true;
    }
 catch (    JMSException e) {
      log.warn("String_Node_Str" + tries + "String_Node_Str"+ e);
      lastException=e;
    }
  }
  if (!operationSuccessful) {
    throw new IOFailure("String_Node_Str",lastException);
  }
}

Fixed version (ground truth):
/** 
 * Submit an object to the reply queue. We try to do it JMX_MAXTRIES times before giving up.
 * @param nMsg The NetarkivetMessage to send to the reply queue (null not allowed)
 * @throws ArgumentNotValid if nMsg is null.
 * @throws IOFailure if the operation failed.
 */
public void reply(NetarkivetMessage nMsg){
  ArgumentNotValid.checkNotNull(nMsg,"String_Node_Str");
  JMSException lastException=null;
  boolean operationSuccessful=false;
  int tries=0;
  while (!operationSuccessful && tries < JMS_MAXTRIES) {
    if (reconnectInProgress.get() != true) {
      try {
        tries++;
        ObjectMessage msg=myQSess.createObjectMessage(nMsg);
        String queueName=nMsg.getReplyTo().getName();
        QueueSender queueSender=senders.get(queueName);
        if (queueSender == null) {
          queueSender=myQSess.createSender(getQueue(queueName));
          senders.put(queueName,queueSender);
        }
synchronized (nMsg) {
          log.debug("String_Node_Str" + queueName + "String_Node_Str"+ nMsg.replyOfId);
          queueSender.send(msg);
          log.debug("String_Node_Str" + queueSender.getQueue().getQueueName());
          nMsg.updateId(msg.getJMSMessageID());
        }
        operationSuccessful=true;
      }
 catch (      JMSException e) {
        log.warn("String_Node_Str" + tries + "String_Node_Str"+ e);
        lastException=e;
      }
    }
  }
  if (!operationSuccessful) {
    throw new IOFailure("String_Node_Str",lastException);
  }
}
Program: 90184
Project: 90184
Buggy source:
/** 
 * Exceptionhandler for the JMSConnection. Only handles exceptions, if reconnectInProgress is false. Only handles exceptions with errorcode PACKET_ACK_FAILED or SESSION_IS_CLOSED.
 * @param e an JMSException
 */
public void onException(JMSException e){
  ArgumentNotValid.checkNotNull(e,"String_Node_Str");
  final String errorcode=e.getErrorCode();
  log.warn("String_Node_Str" + errorcode + "String_Node_Str"+ e);
  if (!reconnectInProgress) {
    handleJMSException(e);
  }
}

Fixed version (ground truth):
/** 
 * Exceptionhandler for the JMSConnection. Only handles exceptions, if reconnectInProgress is false. Only handles exceptions with errorcode PACKET_ACK_FAILED or SESSION_IS_CLOSED.
 * @param e an JMSException
 */
public void onException(JMSException e){
  ArgumentNotValid.checkNotNull(e,"String_Node_Str");
  final String errorcode=e.getErrorCode();
  log.warn("String_Node_Str" + errorcode + "String_Node_Str"+ e);
  if (errorcode.equals(PACKET_ACK_FAILED) || errorcode.equals(SESSION_IS_CLOSED) || errorcode.equals(RECEIVED_GOODBYE_FROM_BROKER)) {
    if (reconnectInProgress.compareAndSet(false,true)) {
      performReconnect(e);
    }
 else {
      log.warn("String_Node_Str" + e);
    }
  }
 else {
    log.warn("String_Node_Str" + errorcode);
  }
}
Program: 90186
Project: 90186
Buggy source:
/** 
 * Given a list of domain configurations and a list of domains, add the default configurations for the domains to the configuration list. If any of the domains are unknown, their names are instead appended to the argument unknownDomains (with newline separation)
 * @param dc the initial list of configurations
 * @param extraDomains the domains to be added to dc with defaultconfigurations
 * @param unknownDomains a list to add unknonw, legal domains to
 * @param illegalDomains a list to add illegal domains to
 */
private static void addDomainsToConfigurations(List<DomainConfiguration> dc,String extraDomains,List<String> unknownDomains,List<String> illegalDomains){
  String[] domains=extraDomains.split("String_Node_Str");
  DomainDAO ddao=DomainDAO.getInstance();
  for (  String domain : domains) {
    domain=domain.trim();
    if (domain.length() > 0) {
      if (ddao.exists(domain)) {
        Domain d=ddao.read(domain);
        if (!dc.contains(d.getDefaultConfiguration())) {
          dc.add(d.getDefaultConfiguration());
        }
      }
 else {
        if (Domain.isValidDomainName(domain)) {
          unknownDomains.add(domain);
        }
 else {
          illegalDomains.add(domain);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Given a list of domain configurations and a list of domains, add the default configurations for the domains to the configuration list. If any of the domains are unknown, their names are instead appended to the argument unknownDomains (with newline separation)
 * @param dc the initial list of configurations
 * @param extraDomains the domains to be added to dc with defaultconfigurations
 * @param unknownDomains a list to add unknown, legal domains to
 * @param illegalDomains a list to add illegal domains to
 */
private static void addDomainsToConfigurations(List<DomainConfiguration> dc,String extraDomains,List<String> unknownDomains,List<String> illegalDomains){
  String[] domains=extraDomains.split("String_Node_Str");
  DomainDAO ddao=DomainDAO.getInstance();
  for (  String domain : domains) {
    domain=domain.trim();
    if (domain.length() > 0) {
      if (ddao.exists(domain)) {
        Domain d=ddao.read(domain);
        if (!dc.contains(d.getDefaultConfiguration())) {
          dc.add(d.getDefaultConfiguration());
        }
      }
 else {
        if (Domain.isValidDomainName(domain)) {
          unknownDomains.add(domain);
        }
 else {
          illegalDomains.add(domain);
        }
      }
    }
  }
}
Program: 90187
Project: 90187
Buggy source:
/** 
 * Constructs a channel name according to the specifications in distributed_architecture.doc.
 * @param app The name of the applications listening to the channel.
 * @param locationName Name of the location, or ChannelID.COMMON ifchannel common to both locations.
 * @param useNodeId Whether that IP address of the local node shouldbe included in the channel name.
 * @param useProcId Whether process identifier (= IP port# used for communication) should be included in the channel name.
 * @return The properly concatenated channel name.
 * @throws UnknownID if looking up the local IP number failed.
 */
private static String constructName(String app,String locationName,boolean useNodeId,boolean useProcId){
  String userId=environmentName;
  String id="String_Node_Str";
  if (useNodeId) {
    id=SystemUtils.getLocalIP().replace('.','_');
    if (useProcId) {
      id+=("String_Node_Str" + httpPortNumber);
    }
  }
  return userId + "String_Node_Str" + locationName+ "String_Node_Str"+ app+ (id.equals("String_Node_Str") ? "String_Node_Str" : ("String_Node_Str" + id));
}

Fixed version (ground truth):
/** 
 * Constructs a channel name according to the specifications in distributed_architecture.doc.
 * @param app The name of the applications listening to the channel.
 * @param locationName Name of the location, or ChannelID.COMMON ifchannel common to both locations.
 * @param useNodeId Whether that IP address of the local node shouldbe included in the channel name.
 * @param useProcId Whether process identifier (= IP port# used for communication) should be included in the channel name.
 * @return The properly concatenated channel name.
 * @throws UnknownID if looking up the local IP number failed.
 */
private String constructName(String app,String locationName,boolean useNodeId,boolean useProcId){
  String userId=environmentName;
  String id="String_Node_Str";
  if (useNodeId) {
    id=SystemUtils.getLocalIP().replace('.','_');
    if (useProcId) {
      id+=("String_Node_Str" + httpPortNumber);
    }
  }
  return userId + "String_Node_Str" + locationName+ "String_Node_Str"+ app+ (id.equals("String_Node_Str") ? "String_Node_Str" : ("String_Node_Str" + id));
}
Program: 90188
Project: 90188
Buggy source:
/** 
 * Given an location, returns the BAMON queue to which batch jobs must be sent in order to run them on that locations bitarchive.
 * @param location the location
 * @return the channel
 * @throws ArgumentNotValid if the location is null, unknown, or empty string
 */
public static ChannelID getBaMonForLocation(String location) throws ArgumentNotValid {
  ArgumentNotValid.checkNotNullOrEmpty(location,"String_Node_Str");
  ChannelID[] bamons=getAllArchives_BAMONs();
  for (  ChannelID bamon : bamons) {
    if ((bamon.getName().split("String_Node_Str")[1]).equals(location)) {
      return bamon;
    }
  }
  throw new ArgumentNotValid("String_Node_Str" + location);
}

Fixed version (ground truth):
/** 
 * Given an location, returns the BAMON queue to which batch jobs must be sent in order to run them on that locations bitarchive.
 * @param location the location
 * @return the channel
 * @throws ArgumentNotValid if the location is null, unknown, or empty string
 */
public static ChannelID getBaMonForLocation(String location) throws ArgumentNotValid {
  ArgumentNotValid.checkNotNullOrEmpty(location,"String_Node_Str");
  ChannelID[] bamons=getAllArchives_BAMONs();
  for (  ChannelID bamon : bamons) {
    if (bamon.getName().equals(Settings.get(Settings.ENVIRONMENT_NAME) + "String_Node_Str" + location+ "String_Node_Str")) {
      return bamon;
    }
  }
  throw new ArgumentNotValid("String_Node_Str" + location);
}
Program: 90189
Project: 90189
Buggy source:
/** 
 * Test method to get BAMOn channel for a particular location.
 */
public void testGetBAMONForLocation(){
  ChannelID ch1=Channels.getBaMonForLocation("String_Node_Str");
  assertFalse("String_Node_Str" + ch1.getName(),ch1.getName().lastIndexOf("String_Node_Str") == -1);
  ChannelID ch2=Channels.getBaMonForLocation("String_Node_Str");
  assertFalse("String_Node_Str" + ch2.getName(),ch2.getName().lastIndexOf("String_Node_Str") == -1);
  try {
    ChannelID ch3=Channels.getBaMonForLocation("String_Node_Str");
    fail("String_Node_Str" + ch3.getName());
  }
 catch (  ArgumentNotValid e) {
  }
}

Fixed version (ground truth):
/** 
 * Test method to get BAMOn channel for a particular location.
 */
public void testGetBAMONForLocation(){
  ChannelID ch1=Channels.getBaMonForLocation("String_Node_Str");
  assertFalse("String_Node_Str" + ch1.getName(),ch1.getName().lastIndexOf("String_Node_Str") == -1);
  ChannelID ch2=Channels.getBaMonForLocation("String_Node_Str");
  assertFalse("String_Node_Str" + ch2.getName(),ch2.getName().lastIndexOf("String_Node_Str") == -1);
  try {
    ChannelID ch3=Channels.getBaMonForLocation("String_Node_Str");
    fail("String_Node_Str" + ch3.getName());
  }
 catch (  ArgumentNotValid e) {
  }
  Settings.set(Settings.ENVIRONMENT_NAME,"String_Node_Str");
  Channels.reset();
  ChannelID ch=Channels.getBaMonForLocation("String_Node_Str");
  StringAsserts.assertStringContains("String_Node_Str","String_Node_Str",ch.getName());
}
Program: 90190
Project: 90190
Buggy source:
/** 
 * Strips a path prefix from a file name.
 * @param dir The path prefix to remove from the given file's name.
 * @param f   The file to remove the path prefix from.
 * @return The name of the file without the specified path prefix.
 */
private static String removePrefixDir(File dir,File f){
  String key=f.getAbsolutePath().replaceAll(dir.getAbsolutePath(),"String_Node_Str");
  return key;
}

Fixed version (ground truth):
/** 
 * Strips a path prefix from a file name.
 * @param dir The path prefix to remove from the given file's name.
 * @param f   The file to remove the path prefix from.
 * @return The name of the file without the specified path prefix.
 */
private static String removePrefixDir(File dir,File f){
  return f.getAbsolutePath().replaceAll(dir.getAbsolutePath(),"String_Node_Str");
}
Program: 90191
Project: 90191
Buggy source:
/** 
 * Copy an entire directory from one location to another, skipping CVS directories. Note that this will silently overwrite old files, just like copyFile().
 * @param from Original directory (or file, for that matter) to copy.
 * @param to   Destination directory, i.e. the 'new name' of the copy of thefrom directory.
 * @throws IOFailure
 */
public static final void copyDirectoryNonCVS(File from,File to) throws IOFailure {
  if (from.isFile()) {
    try {
      FileUtils.copyFile(from,to);
    }
 catch (    Exception e) {
      throw new IOFailure("String_Node_Str" + from.getAbsolutePath() + "String_Node_Str"+ to.getAbsolutePath());
    }
  }
 else {
    if (from.getName().equals("String_Node_Str")) {
      return;
    }
    if (from.getName().equals("String_Node_Str")) {
      return;
    }
    if (!from.exists()) {
      throw new IOFailure("String_Node_Str" + from);
    }
    if (!from.isDirectory()) {
      throw new IOFailure("String_Node_Str" + from);
    }
    to.mkdir();
    if (!to.exists()) {
      throw new IOFailure("String_Node_Str" + to);
    }
    File[] subfiles=from.listFiles();
    for (int i=0; i < subfiles.length; i++) {
      copyDirectoryNonCVS(subfiles[i],new File(to,subfiles[i].getName()));
    }
  }
}

Fixed version (ground truth):
/** 
 * Copy an entire directory from one location to another, skipping CVS directories. Note that this will silently overwrite old files, just like copyFile().
 * @param from Original directory (or file, for that matter) to copy.
 * @param to   Destination directory, i.e. the 'new name' of the copy of thefrom directory.
 * @throws IOFailure
 */
public static final void copyDirectoryNonCVS(File from,File to) throws IOFailure {
  if (from.isFile()) {
    try {
      FileUtils.copyFile(from,to);
    }
 catch (    Exception e) {
      throw new IOFailure("String_Node_Str" + from.getAbsolutePath() + "String_Node_Str"+ to.getAbsolutePath(),e);
    }
  }
 else {
    if (from.getName().equals("String_Node_Str")) {
      return;
    }
    if (from.getName().equals("String_Node_Str")) {
      return;
    }
    if (!from.exists()) {
      throw new IOFailure("String_Node_Str" + from);
    }
    if (!from.isDirectory()) {
      throw new IOFailure("String_Node_Str" + from);
    }
    to.mkdir();
    if (!to.exists()) {
      throw new IOFailure("String_Node_Str" + to);
    }
    File[] subfiles=from.listFiles();
    for (    File subfile : subfiles) {
      copyDirectoryNonCVS(subfile,new File(to,subfile.getName()));
    }
  }
}
Program: 90194
Project: 90194
Buggy source:
/** 
 * Auxiliary method to modify the orderXMLdoc Document with respect to setting the maximum number of bytes to retrieve per domain. This method updates 'group-max-all-kb' element of the 'QuotaEnforcer' node, which again is a subelement of 'pre-fetch-processors' node. with the value of the argument forceMaxBytesPerDomain
 * @param forceMaxBytesPerDomain The maximum number of byte to retrieve per domain, or -1 for no limit. Note that the number is divided by 1024 before being inserted into the orderXml, as Heritrix expects KB.
 * @throws PermissionDenied If unable to replace the QuotaEnforcer node of the orderXMLdoc Document
 * @throws IOFailure If the group-max-all-kb element cannot be found. TODO: This group-max-all-kb check also be performed in  TemplateDAO.create, TemplateDAO.update
 */
private void editOrderXML_maxBytesPerDomain(long forceMaxBytesPerDomain){
  String xpath=HeritrixTemplate.GroupMaxAllKbXpath;
  Node groupMaxSuccessKbNode=orderXMLdoc.selectSingleNode(xpath);
  if (groupMaxSuccessKbNode != null) {
    if (forceMaxBytesPerDomain != Constants.HERITRIX_MAXBYTES_INFINITY) {
      groupMaxSuccessKbNode.setText(Long.toString((forceMaxBytesPerDomain / BYTES_PER_HERITRIX_BYTELIMIT_UNIT) + 1));
    }
 else {
      groupMaxSuccessKbNode.setText(String.valueOf(Constants.HERITRIX_MAXBYTES_INFINITY));
    }
  }
 else {
    throw new IOFailure("String_Node_Str" + orderXMLdoc.asXML());
  }
}

Fixed version (ground truth):
/** 
 * Auxiliary method to modify the orderXMLdoc Document with respect to setting the maximum number of bytes to retrieve per domain. This method updates 'group-max-all-kb' element of the 'QuotaEnforcer' node, which again is a subelement of 'pre-fetch-processors' node. with the value of the argument forceMaxBytesPerDomain
 * @param forceMaxBytesPerDomain The maximum number of byte to retrieve per domain, or -1 for no limit. Note that the number is divided by 1024 before being inserted into the orderXml, as Heritrix expects KB.
 * @throws PermissionDenied If unable to replace the QuotaEnforcer node of the orderXMLdoc Document
 * @throws IOFailure If the group-max-all-kb element cannot be found. TODO: This group-max-all-kb check also be performed in TemplateDAO.create, TemplateDAO.update
 */
private void editOrderXML_maxBytesPerDomain(long forceMaxBytesPerDomain){
  String xpath=HeritrixTemplate.GROUP_MAX_ALL_KB_XPATH;
  Node groupMaxSuccessKbNode=orderXMLdoc.selectSingleNode(xpath);
  if (groupMaxSuccessKbNode != null) {
    if (forceMaxBytesPerDomain != Constants.HERITRIX_MAXBYTES_INFINITY) {
      groupMaxSuccessKbNode.setText(Long.toString((forceMaxBytesPerDomain / BYTES_PER_HERITRIX_BYTELIMIT_UNIT) + 1));
    }
 else {
      groupMaxSuccessKbNode.setText(String.valueOf(Constants.HERITRIX_MAXBYTES_INFINITY));
    }
  }
 else {
    throw new IOFailure("String_Node_Str" + orderXMLdoc.asXML());
  }
}
Program: 90195
Project: 90195
Buggy source:
/** 
 * Auxiliary method to modify the orderXMLdoc Document with respect to setting the maximum number of objects to be retrieved per domain. This method updates 'queue-total-budget' element of the frontier node (org.archive.crawler.frontier.BdbFrontier) with the value of the argument forceMaxObjectsPerDomain
 * @param forceMaxObjectsPerDomain The maximum number of objects to retrieve per domain, or 0 for no limit.
 * @throws PermissionDenied If unable to replace the frontier node of the orderXMLdoc Document
 * @throws IOFailure If the queue-total-budget element is not found in the orderXml. TODO: The queue-total-budget check should also be performed in TemplateDAO.create, TemplateDAO.update
 */
private void editOrderXML_maxObjectsPerDomain(long forceMaxObjectsPerDomain){
  String xpath=HeritrixTemplate.QueueTotalBudgetXpath;
  Node queueTotalBudgetNode=orderXMLdoc.selectSingleNode(xpath);
  if (queueTotalBudgetNode != null) {
    queueTotalBudgetNode.setText(String.valueOf(forceMaxObjectsPerDomain));
  }
 else {
    throw new IOFailure("String_Node_Str" + orderXMLdoc.asXML());
  }
}

Fixed version (ground truth):
/** 
 * Auxiliary method to modify the orderXMLdoc Document with respect to setting the maximum number of objects to be retrieved per domain. This method updates 'queue-total-budget' element of the frontier node (org.archive.crawler.frontier.BdbFrontier) with the value of the argument forceMaxObjectsPerDomain
 * @param forceMaxObjectsPerDomain The maximum number of objects to retrieve per domain, or 0 for no limit.
 * @throws PermissionDenied If unable to replace the frontier node of the orderXMLdoc Document
 * @throws IOFailure If the queue-total-budget element is not found in the orderXml. TODO: The queue-total-budget check should also be performed in TemplateDAO.create, TemplateDAO.update
 */
private void editOrderXML_maxObjectsPerDomain(long forceMaxObjectsPerDomain){
  String xpath=HeritrixTemplate.QUEUE_TOTAL_BUDGET_XPATH;
  Node queueTotalBudgetNode=orderXMLdoc.selectSingleNode(xpath);
  if (queueTotalBudgetNode != null) {
    queueTotalBudgetNode.setText(String.valueOf(forceMaxObjectsPerDomain));
  }
 else {
    throw new IOFailure("String_Node_Str" + orderXMLdoc.asXML());
  }
}
Program: 90197
Project: 90197
Buggy source:
/** 
 * Returns a set of sorted seeds for this job. The sorting is done by domain. 
 * @return a set of sorted seeds for this job.
 */
public List<String> getSortedSeedList(){
  Map<String,Set> urlMap=new HashMap<String,Set>();
  for (  String seed : seedListSet) {
    String url;
    if (!seed.matches(Constants.NO_PROTOCOL_REGEXP)) {
      url="String_Node_Str" + seed;
    }
 else {
      url=seed;
    }
    String domain=getDomain(url);
    TreeSet set;
    if (urlMap.containsKey(domain)) {
      set=(TreeSet)urlMap.get(domain);
    }
 else {
      set=new TreeSet();
    }
    set.add(seed);
    urlMap.put(domain,set);
  }
  List<String> resultSet=new ArrayList<String>();
  for (  Set set : urlMap.values()) {
    resultSet.addAll(set);
  }
  return resultSet;
}

Fixed version (ground truth):
/** 
 * Returns a set of sorted seeds for this job. The sorting is done by domain.
 * @return a set of sorted seeds for this job.
 */
public List<String> getSortedSeedList(){
  Map<String,Set> urlMap=new HashMap<String,Set>();
  for (  String seed : seedListSet) {
    String url;
    if (!seed.matches(Constants.NO_PROTOCOL_REGEXP)) {
      url="String_Node_Str" + seed;
    }
 else {
      url=seed;
    }
    String domain=getDomain(url);
    TreeSet set;
    if (urlMap.containsKey(domain)) {
      set=(TreeSet)urlMap.get(domain);
    }
 else {
      set=new TreeSet();
    }
    set.add(seed);
    urlMap.put(domain,set);
  }
  List<String> resultSet=new ArrayList<String>();
  for (  Set set : urlMap.values()) {
    resultSet.addAll(set);
  }
  return resultSet;
}
Program: 90198
Project: 90198
Buggy source:
/** 
 * Get the list of harvest error details for this job. If no harvest error details, null is returned This value is not meaningful until the job is finished (FAILED,DONE, RESUBMITTED)
 * @return the list of harvest error details for this job or null if no harvest error details.
 */
public String getHarvestErrorDetails(){
  return harvestErrorDetails;
}

Fixed version (ground truth):
/** 
 * Get the list of harvest error details for this job. If no harvest error details, null is returned This value is not meaningful until the job is finished (FAILED,DONE, RESUBMITTED)
 * @return the list of harvest error details for this jobor null if no harvest error details.
 */
public String getHarvestErrorDetails(){
  return harvestErrorDetails;
}
Program: 90199
Project: 90199
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 + "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;
}

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) {
    log.debug("String_Node_Str" + arcFileID + "String_Node_Str");
    return null;
  }
  File path=barc.getFilePath();
  log.info("String_Node_Str" + path + "String_Node_Str");
  return path;
}
Program: 90200
Project: 90200
Buggy source:
/** 
 */
public void setUp(){
  job=new TestBatchJob();
}

Fixed version (ground truth):
/** 
 */
public void setUp() throws Exception {
  job=new TestBatchJob();
  super.setUp();
}
Program: 90201
Project: 90201
Buggy source:
/** 
 * Create Bitarchive
 * @throws Exception
 */
protected void setUp() throws Exception {
  super.setUp();
  FileUtils.removeRecursively(ARCHIVE_DIR);
  try {
    Settings.set(Settings.BITARCHIVE_SERVER_FILEDIR,ARCHIVE_DIR.getAbsolutePath());
    archive=Bitarchive.getInstance();
  }
 catch (  PermissionDenied e) {
    fail("String_Node_Str" + e);
  }
  rf.setUp();
}

Fixed version (ground truth):
/** 
 * Create Bitarchive
 * @throws Exception
 */
public void setUp() throws Exception {
  super.setUp();
}