nus-yam/ex-repair huggingface dataset:
Program: 89702
Project: 89702
Buggy source:
/** 
 * Returns an iterator on the given sort key.
 * @param the cursor (sort key) to iterate on.
 */
ReportIterator(EntityCursor<PersistentLine> cursor){
  this.cursor=cursor;
  iter=cursor.iterator();
}

Fixed version (ground truth):
/** 
 * Returns an iterator on the given sort key.
 * @param cursor The cursor (sort key) to iterate on.
 */
ReportIterator(EntityCursor<PersistentLine> cursor){
  this.cursor=cursor;
  iter=cursor.iterator();
}
Program: 89706
Project: 89706
Buggy source:
/** 
 * Alternate constructor, which does not have the DomainHarvestreport as argument.
 * @param jobID (see description for the other constructor)
 * @param statusCode (see description for the other constructor)
 * @see CrawlStatusMessage#CrawlStatusMessage(long,JobStatus,AbstractHarvestReport)
 */
public CrawlStatusMessage(long jobID,JobStatus statusCode){
  this(jobID,statusCode,null);
}

Fixed version (ground truth):
/** 
 * Alternate constructor, which does not have the DomainHarvestreport as argument.
 * @param jobID (see description for the other constructor)
 * @param statusCode (see description for the other constructor)
 * @see CrawlStatusMessage#CrawlStatusMessage(long,JobStatus,HarvestReport)
 */
public CrawlStatusMessage(long jobID,JobStatus statusCode){
  this(jobID,statusCode,null);
}
Program: 89707
Project: 89707
Buggy source:
@Override public void run(){
  CrawlProgressMessage cpm;
  try {
    cpm=heritrixController.getCrawlProgress();
  }
 catch (  IOFailure iof) {
    log.warn("String_Node_Str",iof);
    return;
  }
  getJMSConnection().send(cpm);
  HeritrixFiles files=getHeritrixFiles();
  if (cpm.crawlIsFinished()) {
    log.info("String_Node_Str" + files.getJobID() + "String_Node_Str");
    crawlIsOver=true;
    return;
  }
  log.info("String_Node_Str" + files.getJobID() + "String_Node_Str"+ files.getHarvestID()+ "String_Node_Str"+ cpm.getHostUrl()+ "String_Node_Str"+ cpm.getProgressStatisticsLegend()+ "String_Node_Str"+ cpm.getJobStatus().getStatus()+ "String_Node_Str"+ cpm.getJobStatus().getProgressStatistics());
}

Fixed version (ground truth):
@Override public void run(){
  CrawlProgressMessage cpm;
  if (crawlIsOver) {
    return;
  }
  try {
    cpm=heritrixController.getCrawlProgress();
  }
 catch (  IOFailure iof) {
    log.warn("String_Node_Str",iof);
    return;
  }
  getJMSConnection().send(cpm);
  HeritrixFiles files=getHeritrixFiles();
  if (cpm.crawlIsFinished()) {
    log.info("String_Node_Str" + files.getJobID() + "String_Node_Str");
    crawlIsOver=true;
    return;
  }
  log.info("String_Node_Str" + files.getJobID() + "String_Node_Str"+ files.getHarvestID()+ "String_Node_Str"+ cpm.getHostUrl()+ "String_Node_Str"+ cpm.getProgressStatisticsLegend()+ "String_Node_Str"+ cpm.getJobStatus().getStatus()+ "String_Node_Str"+ cpm.getJobStatus().getProgressStatistics());
}
Program: 89708
Project: 89708
Buggy source:
/** 
 * Initialise common fields in remote file. Overriding classes should also initalise checksum field.
 * @param file The file to make remote file for.
 * @param useChecksums If true, communications should be checksummed.
 * @param fileDeletable If true, the file may be downloaded multple times.Otherwise, the remote file is invalidated after first transfer.
 * @param multipleDownloads If useChecksums is true, contains the filechecksum.
 */
public AbstractRemoteFile(File file,boolean useChecksums,boolean fileDeletable,boolean multipleDownloads){
  ArgumentNotValid.checkNotNull(file,"String_Node_Str");
  if (!file.isFile() || !file.canRead()) {
    throw new ArgumentNotValid("String_Node_Str" + file.getAbsolutePath() + "String_Node_Str");
  }
  this.file=file;
  this.fileDeletable=fileDeletable;
  this.multipleDownloads=multipleDownloads;
  this.useChecksums=useChecksums;
  this.filesize=file.length();
}

Fixed version (ground truth):
/** 
 * Initialise common fields in remote file. Overriding classes should also initialise checksum field.
 * @param file The file to make remote file for.
 * @param useChecksums If true, communications should be checksummed.
 * @param fileDeletable If true, the file may be downloaded multiple times.Otherwise, the remote file is invalidated after first transfer.
 * @param multipleDownloads If useChecksums is true, contains the filechecksum.
 */
public AbstractRemoteFile(File file,boolean useChecksums,boolean fileDeletable,boolean multipleDownloads){
  ArgumentNotValid.checkNotNull(file,"String_Node_Str");
  if (!file.isFile() || !file.canRead()) {
    throw new ArgumentNotValid("String_Node_Str" + file.getAbsolutePath() + "String_Node_Str");
  }
  this.file=file;
  this.fileDeletable=fileDeletable;
  this.multipleDownloads=multipleDownloads;
  this.useChecksums=useChecksums;
  this.filesize=file.length();
}
Program: 89713
Project: 89713
Buggy source:
/** 
 * Log out from the FTP server.
 * @throws IOFailure if disconnecting fails.
 */
private void logOut(){
  try {
    if (currentFTPClient != null) {
      currentFTPClient.disconnect();
    }
  }
 catch (  IOException e) {
    final String msg="String_Node_Str" + ftpServerName + "String_Node_Str";
    log.warn(msg,e);
    throw new IOFailure(msg,e);
  }
catch (  NullPointerException e) {
  }
}

Fixed version (ground truth):
/** 
 * Log out from the FTP server.
 * @throws IOFailure if disconnecting fails.
 */
private void logOut(){
  try {
    if (currentFTPClient != null) {
      currentFTPClient.disconnect();
    }
  }
 catch (  IOException e) {
    String msg="String_Node_Str" + ftpServerName + "String_Node_Str";
    if (e instanceof CopyStreamException) {
      CopyStreamException realException=(CopyStreamException)e;
      msg+="String_Node_Str" + realException.getIOException() + "String_Node_Str";
    }
    log.warn(msg,e);
    throw new IOFailure(msg,e);
  }
catch (  NullPointerException e) {
  }
}
Program: 89714
Project: 89714
Buggy source:
/** 
 * Creates the operation system specific starting script for this machine. pseudocode: - ssh 'login'@'machine' cmd /c 'environmentName'\\conf\\startall.bat variables: 'login' = machine user name 'machine' = name of the machine 'environmentName' = the environmentName from configuration.
 * @return Operation system specific part of the startscript.
 */
@Override protected String osStartScript(){
  StringBuilder res=new StringBuilder();
  res.append(ScriptConstants.SSH + Constants.SPACE);
  res.append(machineUserLogin());
  res.append(Constants.SPACE + Constants.QUOTE_MARK + ScriptConstants.WINDOWS_COMMAND_RUN+ Constants.SPACE+ Constants.SPACE);
  res.append(getLocalConfDirPath());
  res.append(Constants.SCRIPT_NAME_START_ALL);
  res.append(scriptExtension);
  res.append(Constants.SPACE + Constants.QUOTE_MARK + Constants.SPACE);
  res.append(Constants.NEWLINE);
  return res.toString();
}

Fixed version (ground truth):
/** 
 * Creates the operation system specific starting script for this machine. pseudocode: - ssh 'login'@'machine' cmd /c 'environmentName'\\conf\\startall.bat - sleep 5 - ssh 'login'@'machine' "more 'environmentName'\\start_APP.log variables: 'login' = machine user name 'machine' = name of the machine 'environmentName' = the environmentName from configuration.
 * @return Operation system specific part of the startscript.
 */
@Override protected String osStartScript(){
  StringBuilder res=new StringBuilder();
  res.append(ScriptConstants.SSH + Constants.SPACE);
  res.append(machineUserLogin());
  res.append(Constants.SPACE + Constants.QUOTE_MARK + ScriptConstants.WINDOWS_COMMAND_RUN+ Constants.SPACE+ Constants.SPACE);
  res.append(getLocalConfDirPath());
  res.append(Constants.SCRIPT_NAME_START_ALL);
  res.append(scriptExtension);
  res.append(Constants.SPACE + Constants.QUOTE_MARK + Constants.SPACE);
  res.append(Constants.NEWLINE);
  res.append(ScriptConstants.SLEEP_5);
  res.append(Constants.NEWLINE);
  for (  Application app : applications) {
    res.append(ScriptConstants.SSH + Constants.SPACE);
    res.append(machineUserLogin());
    res.append(Constants.SPACE + Constants.QUOTE_MARK + ScriptConstants.WINDOWS_COMMAND_MORE+ Constants.SPACE);
    res.append(getEnvironmentName() + Constants.BACKSLASH + Constants.SCRIPT_NAME_LOCAL_START+ app.getIdentification()+ Constants.EXTENSION_LOG_FILES);
    res.append(Constants.QUOTE_MARK + Constants.SPACE);
    res.append(Constants.NEWLINE);
  }
  return res.toString();
}
Program: 89715
Project: 89715
Buggy source:
/** 
 * Receives replies from a message queue and triggers the blocked call in sendAndWaitForOneReply().
 * @param msg an ObjectMessage containing a NetarkivetMessage.
 */
public void onMessage(Message msg){
  ArgumentNotValid.checkNotNull(msg,"String_Node_Str");
  NetarkivetMessage naMsg=JMSConnection.unpack(msg);
  NetarkivetMessage requestMsg;
synchronized (requests) {
    requestMsg=requests.get(naMsg.getReplyOfId());
  }
  if (requestMsg != null) {
synchronized (requestMsg) {
      replies.put(naMsg.getReplyOfId(),naMsg);
      requestMsg.notifyAll();
    }
  }
 else {
    log.warn("String_Node_Str" + naMsg.getReplyOfId() + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Receives replies from a message queue and triggers the blocked call in sendAndWaitForOneReply().
 * @param msg an ObjectMessage containing a NetarkivetMessage.
 */
public void onMessage(Message msg){
  ArgumentNotValid.checkNotNull(msg,"String_Node_Str");
  NetarkivetMessage naMsg=JMSConnection.unpack(msg);
  NetarkivetMessage requestMsg;
synchronized (requests) {
    requestMsg=requests.get(naMsg.getReplyOfId());
  }
  if (requestMsg != null) {
synchronized (requestMsg) {
      replies.put(naMsg.getReplyOfId(),naMsg);
      requestMsg.notifyAll();
    }
  }
 else {
    log.warn("String_Node_Str" + naMsg.getReplyOfId() + "String_Node_Str"+ naMsg.getClass().getName()+ "String_Node_Str"+ naMsg.toString());
  }
}
Program: 89717
Project: 89717
Buggy source:
/** 
 * Return a list of all jobs.
 * @return A list of all jobs
 */
public synchronized Iterator<Job> getAll(){
  List<Long> idList=DBUtils.selectLongList(DBConnect.getDBConnection(),"String_Node_Str");
  return new FilterIterator<Long,Job>(idList.iterator()){
    public Job filter(    Long aLong){
      return read(aLong);
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Return a list of all jobs.
 * @return A list of all jobs
 */
@Override public synchronized Iterator<Job> getAll(){
  List<Long> idList=DBUtils.selectLongList(DBConnect.getDBConnection(),"String_Node_Str");
  return new FilterIterator<Long,Job>(idList.iterator()){
    public Job filter(    Long aLong){
      return read(aLong);
    }
  }
;
}
Program: 89720
Project: 89720
Buggy source:
/** 
 * Returns the number of existing jobs.
 * @return Number of jobs in 'jobs' table
 */
public synchronized int getCountJobs(){
  return DBUtils.selectIntValue(DBConnect.getDBConnection(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Returns the number of existing jobs.
 * @return Number of jobs in 'jobs' table
 */
@Override public synchronized int getCountJobs(){
  return DBUtils.selectIntValue(DBConnect.getDBConnection(),"String_Node_Str");
}
Program: 89721
Project: 89721
Buggy source:
/** 
 * Check whether a particular job exists.
 * @param jobID Id of the job.
 * @return true if the job exists in any state.
 */
public synchronized boolean exists(Long jobID){
  ArgumentNotValid.checkNotNull(jobID,"String_Node_Str");
  return 1 == DBUtils.selectLongValue(DBConnect.getDBConnection(),"String_Node_Str",jobID);
}

Fixed version (ground truth):
/** 
 * Check whether a particular job exists.
 * @param jobID Id of the job.
 * @return true if the job exists in any state.
 */
@Override public synchronized boolean exists(Long jobID){
  ArgumentNotValid.checkNotNull(jobID,"String_Node_Str");
  return 1 == DBUtils.selectLongValue(DBConnect.getDBConnection(),"String_Node_Str",jobID);
}
Program: 89724
Project: 89724
Buggy source:
/** 
 * Schedule all jobs ready for execution and perform backup if required. 
 */
synchronized void dispatchJobs(){
  stopTimeoutJobs();
  submitNewJobs();
}

Fixed version (ground truth):
/** 
 * Dispatched new jobs Stop jobs with status STARTED, which have been on running for more  than settings.harvester.scheduler.jobtimeouttime time.
 */
void dispatchJobs(){
  stopTimeoutJobs();
  submitNewJobs();
}
Program: 89725
Project: 89725
Buggy source:
/** 
 * Submit those jobs that are ready for submission if the relevant message queue is empty.
 */
synchronized void submitNewJobs(){
  final JobDAO dao=JobDAO.getInstance();
  Iterator<Long> jobsToSubmit=dao.getAllJobIds(JobStatus.NEW);
  if (!jobsToSubmit.hasNext()) {
    log.trace("String_Node_Str");
  }
 else {
    log.trace("String_Node_Str");
  }
  int numberOfSubmittedJobs=0;
  while (jobsToSubmit.hasNext()) {
    final long jobID=jobsToSubmit.next();
    Job jobToSubmit=null;
    try {
      jobToSubmit=dao.read(jobID);
      if (isQueueEmpty(JobChannelUtil.getChannel(jobToSubmit.getPriority()))) {
        jobToSubmit.setStatus(JobStatus.SUBMITTED);
        jobToSubmit.setSubmittedDate(new Date());
        dao.update(jobToSubmit);
        List<MetadataEntry> metadata=new ArrayList<MetadataEntry>();
        MetadataEntry aliasMetadataEntry=MetadataEntry.makeAliasMetadataEntry(jobToSubmit.getJobAliasInfo(),jobToSubmit.getOrigHarvestDefinitionID(),jobToSubmit.getHarvestNum(),jobToSubmit.getJobID());
        if (aliasMetadataEntry != null) {
          metadata.add(aliasMetadataEntry);
        }
        if (HeritrixLauncher.isDeduplicationEnabledInTemplate(jobToSubmit.getOrderXMLdoc())) {
          MetadataEntry duplicateReductionMetadataEntry=MetadataEntry.makeDuplicateReductionMetadataEntry(dao.getJobIDsForDuplicateReduction(jobID),jobToSubmit.getOrigHarvestDefinitionID(),jobToSubmit.getHarvestNum(),jobToSubmit.getJobID());
          if (duplicateReductionMetadataEntry != null) {
            metadata.add(duplicateReductionMetadataEntry);
          }
        }
        doOneCrawl(jobToSubmit,metadata);
        numberOfSubmittedJobs++;
        log.trace("String_Node_Str" + jobToSubmit + "String_Node_Str");
      }
    }
 catch (    Throwable e) {
      String message="String_Node_Str" + jobID;
      log.warn(message,e);
      if (jobToSubmit != null) {
        jobToSubmit.setStatus(JobStatus.FAILED);
        jobToSubmit.appendHarvestErrors(message);
        jobToSubmit.appendHarvestErrorDetails(ExceptionUtils.getStackTrace(e));
        dao.update(jobToSubmit);
      }
    }
  }
  if (numberOfSubmittedJobs > 0) {
    log.info("String_Node_Str" + numberOfSubmittedJobs + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Submit the next new job if the relevant message queue is empty. 
 */
synchronized void submitNewJobs(){
  try {
    for (    JobPriority priority : JobPriority.values()) {
      if (isQueueEmpty(JobChannelUtil.getChannel(priority))) {
        submitNextNewJob(priority);
      }
    }
  }
 catch (  JMSException e) {
    log.error("String_Node_Str",e);
  }
}
Program: 89726
Project: 89726
Buggy source:
/** 
 * Test that runNewJobs makes correct duplication reduction information.
 * @throws Exception if HarvestScheduler throws exception
 */
public void testSubmitNewJobsMakesDuplicateReductionInfo() throws Exception {
  clearNewJobs();
  DataModelTestCase.createTestJobs(2L,15L);
  TestMessageListener hacoListener=new TestMessageListener();
  JMSConnectionMockupMQ.getInstance().setListener(JobChannelUtil.getChannel(JobPriority.HIGHPRIORITY),hacoListener);
  JMSConnectionMockupMQ.getInstance().setListener(JobChannelUtil.getChannel(JobPriority.LOWPRIORITY),hacoListener);
  submitNewJobs();
  ((JMSConnectionMockupMQ)JMSConnectionMockupMQ.getInstance()).waitForConcurrentTasksToFinish();
  assertEquals("String_Node_Str",14,hacoListener.getNumReceived());
  DoOneCrawlMessage crawlMessage=(DoOneCrawlMessage)hacoListener.getReceived();
  assertEquals("String_Node_Str",1,crawlMessage.getMetadata().size());
  MetadataEntry metadataEntry=crawlMessage.getMetadata().get(0);
  assertNotNull("String_Node_Str",metadataEntry);
  assertEquals("String_Node_Str","String_Node_Str",metadataEntry.getMimeType());
  assertEquals("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str",metadataEntry.getURL());
  assertEquals("String_Node_Str","String_Node_Str",new String(metadataEntry.getData()));
}

Fixed version (ground truth):
/** 
 * Test that runNewJobs makes correct duplication reduction information.
 * @throws Exception If HarvestScheduler throws exception
 */
public void testSubmitNewJobsMakesDuplicateReductionInfo() throws Exception {
  clearNewJobs();
  DataModelTestCase.createTestJobs(2L,15L);
  TestMessageListener hacoListener=new TestMessageListener();
  JMSConnectionMockupMQ.getInstance().setListener(JobChannelUtil.getChannel(JobPriority.HIGHPRIORITY),hacoListener);
  JMSConnectionMockupMQ.getInstance().setListener(JobChannelUtil.getChannel(JobPriority.LOWPRIORITY),hacoListener);
  submitNewJobs();
  ((JMSConnectionMockupMQ)JMSConnectionMockupMQ.getInstance()).waitForConcurrentTasksToFinish();
  assertEquals("String_Node_Str",14,hacoListener.getNumReceived());
  DoOneCrawlMessage crawlMessage=(DoOneCrawlMessage)hacoListener.getReceived();
  assertEquals("String_Node_Str",1,crawlMessage.getMetadata().size());
  MetadataEntry metadataEntry=crawlMessage.getMetadata().get(0);
  assertNotNull("String_Node_Str",metadataEntry);
  assertEquals("String_Node_Str","String_Node_Str",metadataEntry.getMimeType());
  assertEquals("String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str",metadataEntry.getURL());
  assertEquals("String_Node_Str","String_Node_Str",new String(metadataEntry.getData()));
}
Program: 89727
Project: 89727
Buggy source:
/** 
 * Calls the <code>submitNewJobs</code> method on the current harvestScheduler test instance
 * @throws Exception
 */
private void submitNewJobs() throws Exception {
  ReflectUtils.getPrivateMethod(HarvestScheduler.class,"String_Node_Str").invoke(harvestScheduler);
  ((JMSConnectionMockupMQ)JMSConnectionMockupMQ.getInstance()).waitForConcurrentTasksToFinish();
}

Fixed version (ground truth):
/** 
 * Calls the <code>submitNewJobs</code> method on the current harvestScheduler test instance
 * @throws Exception
 */
private void submitNewJobs() throws Exception {
  harvestScheduler.submitNewJobs();
  ((JMSConnectionMockupMQ)JMSConnectionMockupMQ.getInstance()).waitForConcurrentTasksToFinish();
}
Program: 89728
Project: 89728
Buggy source:
/** 
 * Checks that the connection is valid (i.e. still open on the server side). This implementation can be overriden if a specific RDBM is not handling the   {@link Connection#isValid(int)} JDBC4 method properly.
 * @param connection
 * @param validityTimeout
 * @return
 * @throws SQLException 
 */
public boolean connectionIsValid(Connection connection,int validityTimeout) throws SQLException {
  return connection.isValid(validityTimeout);
}

Fixed version (ground truth):
/** 
 * Checks that the connection is valid (i.e. still open on the server side). This implementation can be overriden if a specific RDBM is not handling the   {@link Connection#isValid(int)} JDBC4 method properly.
 * @param connection A database connection.
 * @param validityTimeout The time in seconds to wait for the database operation used to validate the connection 
 * @return true, if the connection is valid; false otherwise
 * @throws SQLException 
 */
public boolean connectionIsValid(Connection connection,int validityTimeout) throws SQLException {
  return connection.isValid(validityTimeout);
}
Program: 89729
Project: 89729
Buggy source:
/** 
 * Checks that the message queue for the given harvest job is empty and  therefore ready for the next message.
 * @param job The job to check the queue for
 * @return Is the queue empty
 * @throws JMSException Unable to retrieve queue information
 */
private boolean isQueueEmpty(ChannelID channelId) throws JMSException {
  QueueBrowser qBrowser=jmsConnection.createQueueBrowser(channelId);
  return !qBrowser.getEnumeration().hasMoreElements();
}

Fixed version (ground truth):
/** 
 * Checks that the message queue for the given harvest job is empty and  therefore ready for the next message.
 * @param channelId The id of the channel to check
 * @return Is the queue empty
 * @throws JMSException Unable to retrieve queue information
 */
private boolean isQueueEmpty(ChannelID channelId) throws JMSException {
  QueueBrowser qBrowser=jmsConnection.createQueueBrowser(channelId);
  return !qBrowser.getEnumeration().hasMoreElements();
}
Program: 89731
Project: 89731
Buggy source:
/** 
 * Release allocated resources (JMS connections) and stops dispatching  harvest jobs, all without logging.
 * @override
 */
public void shutdown(){
  log.debug("String_Node_Str");
  if (dispatcherThread != null) {
    dispatcherThread.interrupt();
    dispatcherThread=null;
  }
  jmsConnection=null;
}

Fixed version (ground truth):
/** 
 * Release allocated resources (JMS connections) and stops dispatching  harvest jobs, all without logging.
 */
@Override public void shutdown(){
  log.debug("String_Node_Str");
  if (dispatcherThread != null) {
    dispatcherThread.interrupt();
    dispatcherThread=null;
  }
  jmsConnection=null;
}
Program: 89732
Project: 89732
Buggy source:
/** 
 * Get a hibernate session for communicating with the object store for the wayback indexer. This method has the side effect of creating and initialising a SessionFactory object if there is no current open SessionFactory.
 * @return
 */
public static Session getSession(){
  initialiseFactory();
  return sessionFactory.openSession();
}

Fixed version (ground truth):
/** 
 * Get a hibernate session for communicating with the object store for the wayback indexer. This method has the side effect of creating and initialising a SessionFactory object if there is no current open SessionFactory.
 * @return the abovementioned hibernate session.
 */
public static Session getSession(){
  initialiseFactory();
  return sessionFactory.openSession();
}
Program: 89735
Project: 89735
Buggy source:
/** 
 * Test that correct checksums are generated in ChecksumJob, i.e. that the expected checksums are written to the remote file for a given set of files.
 * @throws IOException
 */
public void testGeneratedChecksum() throws IOException {
  ChecksumJob checkJob=new ChecksumJob();
  BatchStatus batchStatus=arClient.batch(checkJob,Settings.get(CommonSettings.USE_REPLICA_ID));
  batchStatus.getResultFile().copyTo(OUTPUT_FILE);
  List<String> jobChecksums=new ArrayList<String>();
  assertTrue("String_Node_Str",OUTPUT_FILE.exists());
  BufferedReader reader=new BufferedReader(new FileReader(OUTPUT_FILE));
  String line;
  while ((line=reader.readLine()) != null) {
    jobChecksums.add(line.split(dk.netarkivet.archive.arcrepository.bitpreservation.Constants.STRING_FILENAME_SEPARATOR)[1]);
  }
  reader.close();
  FileUtils.removeRecursively(OUTPUT_FILE);
  String[] refChecksums=new String[testFiles.length];
  for (int i=0; i < refChecksums.length; i++) {
    refChecksums[i]=MD5.generateMD5onFile(testFiles[i]);
  }
  for (int i=0; i < testFiles.length; i++) {
    assertTrue("String_Node_Str" + refChecksums[i],jobChecksums.contains(refChecksums[i]));
  }
}

Fixed version (ground truth):
/** 
 * Test that correct checksums are generated in ChecksumJob, i.e. that the expected checksums are written to the remote file for a given set of files.
 * @throws IOException
 */
public void testGeneratedChecksum() throws IOException {
  ChecksumJob checkJob=new ChecksumJob();
  BatchStatus batchStatus=arClient.batch(checkJob,Settings.get(CommonSettings.USE_REPLICA_ID));
  batchStatus.getResultFile().copyTo(OUTPUT_FILE);
  List<String> jobChecksums=new ArrayList<String>();
  assertTrue("String_Node_Str",OUTPUT_FILE.exists());
  BufferedReader reader=new BufferedReader(new FileReader(OUTPUT_FILE));
  String line;
  while ((line=reader.readLine()) != null) {
    jobChecksums.add(line.split(ChecksumJob.STRING_FILENAME_SEPARATOR)[1]);
  }
  reader.close();
  FileUtils.removeRecursively(OUTPUT_FILE);
  String[] refChecksums=new String[testFiles.length];
  for (int i=0; i < refChecksums.length; i++) {
    refChecksums[i]=MD5.generateMD5onFile(testFiles[i]);
  }
  for (int i=0; i < testFiles.length; i++) {
    assertTrue("String_Node_Str" + refChecksums[i],jobChecksums.contains(refChecksums[i]));
  }
}
Program: 89737
Project: 89737
Buggy source:
/** 
 * Test that correct checksums are generated in ChecksumJob, i.e. that the expected checksums are written to the remote file for a given set of files.
 * @throws IOException
 */
public void testGeneratedChecksum() throws IOException {
  ChecksumJob checkJob=new ChecksumJob();
  BatchStatus batchStatus=arClient.batch(checkJob,Settings.get(CommonSettings.USE_REPLICA_ID));
  batchStatus.getResultFile().copyTo(OUTPUT_FILE);
  List<String> jobChecksums=new ArrayList<String>();
  assertTrue("String_Node_Str",OUTPUT_FILE.exists());
  BufferedReader reader=new BufferedReader(new FileReader(OUTPUT_FILE));
  String line;
  while ((line=reader.readLine()) != null) {
    jobChecksums.add(line.split(dk.netarkivet.archive.arcrepository.bitpreservation.Constants.STRING_FILENAME_SEPARATOR)[1]);
  }
  reader.close();
  FileUtils.removeRecursively(OUTPUT_FILE);
  String[] refChecksums=new String[testFiles.length];
  for (int i=0; i < refChecksums.length; i++) {
    refChecksums[i]=MD5.generateMD5onFile(testFiles[i]);
  }
  for (int i=0; i < testFiles.length; i++) {
    assertTrue("String_Node_Str" + refChecksums[i],jobChecksums.contains(refChecksums[i]));
  }
}

Fixed version (ground truth):
/** 
 * Test that correct checksums are generated in ChecksumJob, i.e. that the expected checksums are written to the remote file for a given set of files.
 * @throws IOException
 */
public void testGeneratedChecksum() throws IOException {
  ChecksumJob checkJob=new ChecksumJob();
  BatchStatus batchStatus=arClient.batch(checkJob,Settings.get(CommonSettings.USE_REPLICA_ID));
  batchStatus.getResultFile().copyTo(OUTPUT_FILE);
  List<String> jobChecksums=new ArrayList<String>();
  assertTrue("String_Node_Str",OUTPUT_FILE.exists());
  BufferedReader reader=new BufferedReader(new FileReader(OUTPUT_FILE));
  String line;
  while ((line=reader.readLine()) != null) {
    jobChecksums.add(line.split(ChecksumJob.STRING_FILENAME_SEPARATOR)[1]);
  }
  reader.close();
  FileUtils.removeRecursively(OUTPUT_FILE);
  String[] refChecksums=new String[testFiles.length];
  for (int i=0; i < refChecksums.length; i++) {
    refChecksums[i]=MD5.generateMD5onFile(testFiles[i]);
  }
  for (int i=0; i < testFiles.length; i++) {
    assertTrue("String_Node_Str" + refChecksums[i],jobChecksums.contains(refChecksums[i]));
  }
}
Program: 89742
Project: 89742
Buggy source:
/** 
 * Method for updating the checksum status of a replicafileinfo instance. Updates the following fields for the entry in the replicafileinfo: <br/> checksum_status = OK. <br/> checksum_checkdatetime = current time. 
 * @param replicafileinfoId The id of the replicafileinfo.
 */
private void updateReplicaFileInfoChecksumOk(long replicafileinfoId){
  try {
    String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
    PreparedStatement statement=null;
    Connection connection=getDbConnection();
    Date now=new Date(Calendar.getInstance().getTimeInMillis());
    statement=DBUtils.prepareStatement(connection,sql,ChecksumStatus.OK.ordinal(),now,replicafileinfoId);
    statement.executeUpdate();
    connection.commit();
  }
 catch (  Exception e) {
    String msg="String_Node_Str";
    log.warn(msg);
    throw new IOFailure(msg,e);
  }
}

Fixed version (ground truth):
/** 
 * Method for updating the checksum status of a replicafileinfo instance. Updates the following fields for the entry in the replicafileinfo: <br/> checksum_status = OK. <br/> upload_status = UPLOAD_COMLPETE. <br/> checksum_checkdatetime = current time.  <br/><br/> The file is required to exist in the replica.
 * @param replicafileinfoId The id of the replicafileinfo.
 */
private void updateReplicaFileInfoChecksumOk(long replicafileinfoId){
  try {
    String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
    PreparedStatement statement=null;
    Connection connection=getDbConnection();
    Date now=new Date(Calendar.getInstance().getTimeInMillis());
    statement=DBUtils.prepareStatement(connection,sql,ChecksumStatus.OK.ordinal(),now,ReplicaStoreState.UPLOAD_COMPLETED.ordinal(),replicafileinfoId);
    statement.executeUpdate();
    connection.commit();
  }
 catch (  Exception e) {
    String msg="String_Node_Str";
    log.warn(msg);
    throw new IOFailure(msg,e);
  }
}
Program: 89743
Project: 89743
Buggy source:
/** 
 * Method for retrieving the FilePreservationState for a specific file.
 * @param filename The name of the file for whom the FilePreservationStateshould be retrieved.
 * @return The FilePreservationState for the file.
 * @throws ArgumentNotValid If the filename is null or the empty string.
 */
@Override public PreservationState getPreservationState(String filename) throws ArgumentNotValid {
  ArgumentNotValid.checkNotNullOrEmpty(filename,"String_Node_Str");
  List<ReplicaFileInfo> rfis=new ArrayList<ReplicaFileInfo>(Replica.getKnown().size());
  for (  Replica replica : Replica.getKnown()) {
    rfis.add(cache.getReplicaFileInfo(filename,replica));
  }
  return new DatabasePreservationState(filename,rfis);
}

Fixed version (ground truth):
/** 
 * Method for retrieving the FilePreservationState for a specific file.
 * @param filename The name of the file for whom the FilePreservationStateshould be retrieved.
 * @return The FilePreservationState for the file.
 * @throws ArgumentNotValid If the filename is null or the empty string.
 */
@Override public PreservationState getPreservationState(String filename) throws ArgumentNotValid {
  ArgumentNotValid.checkNotNullOrEmpty(filename,"String_Node_Str");
  List<ReplicaFileInfo> rfis=new ArrayList<ReplicaFileInfo>(Replica.getKnown().size());
  for (  Replica replica : Replica.getKnown()) {
    updateChecksumStatus(filename,replica);
    rfis.add(cache.getReplicaFileInfo(filename,replica));
  }
  return new DatabasePreservationState(filename,rfis);
}
Program: 89748
Project: 89748
Buggy source:
public void setUp(){
  rs.setUp();
  mjms.setUp();
  listener=new GetFileListener(mtf.working(new File(TestInfo.DATA_DIR,"String_Node_Str")));
  JMSConnectionFactory.getInstance().setListener(Channels.getTheRepos(),listener);
  Settings.set(CommonSettings.REMOTE_FILE_CLASS,"String_Node_Str");
  mtf.setUp();
  pss.setUp();
  pse.setUp();
}

Fixed version (ground truth):
public void setUp(){
  ChannelsTester.resetChannels();
  rs.setUp();
  mjms.setUp();
  listener=new GetFileListener(mtf.working(new File(TestInfo.DATA_DIR,"String_Node_Str")));
  JMSConnectionFactory.getInstance().setListener(Channels.getTheRepos(),listener);
  Settings.set(CommonSettings.REMOTE_FILE_CLASS,"String_Node_Str");
  mtf.setUp();
  pss.setUp();
  pse.setUp();
}
Program: 89749
Project: 89749
Buggy source:
/** 
 * Retrieves and update the status of a file for a specific replica.
 * @param filename The name of the file.
 * @param replica The replica to retrieve and update the file status for.
 */
private void updateChecksumStatus(String filename,Replica replica){
  String checksum=ArcRepositoryClientFactory.getPreservationInstance().getChecksum(replica.getId(),filename);
  cache.insertSingleChecksumResult(filename,checksum,replica);
}

Fixed version (ground truth):
/** 
 * Retrieves and update the status of a file for a specific replica.
 * @param filename The name of the file.
 * @param replica The replica to retrieve and update the file status for.
 */
private void updateChecksumStatus(String filename){
  for (  Replica replica : Replica.getKnown()) {
    String checksum=ArcRepositoryClientFactory.getPreservationInstance().getChecksum(replica.getId(),filename);
    cache.insertSingleChecksumResult(filename,checksum,replica);
  }
  cache.updateChecksumStatus(filename);
}
Program: 89750
Project: 89750
Buggy source:
/** 
 * Method for retrieving the FilePreservationState for a specific file.
 * @param filename The name of the file for whom the FilePreservationStateshould be retrieved.
 * @return The FilePreservationState for the file.
 * @throws ArgumentNotValid If the filename is null or the empty string.
 */
@Override public PreservationState getPreservationState(String filename) throws ArgumentNotValid {
  ArgumentNotValid.checkNotNullOrEmpty(filename,"String_Node_Str");
  List<ReplicaFileInfo> rfis=new ArrayList<ReplicaFileInfo>(Replica.getKnown().size());
  for (  Replica replica : Replica.getKnown()) {
    updateChecksumStatus(filename,replica);
    rfis.add(cache.getReplicaFileInfo(filename,replica));
  }
  return new DatabasePreservationState(filename,rfis);
}

Fixed version (ground truth):
/** 
 * Method for retrieving the FilePreservationState for a specific file.
 * @param filename The name of the file for whom the FilePreservationStateshould be retrieved.
 * @return The FilePreservationState for the file.
 * @throws ArgumentNotValid If the filename is null or the empty string.
 */
@Override public PreservationState getPreservationState(String filename) throws ArgumentNotValid {
  ArgumentNotValid.checkNotNullOrEmpty(filename,"String_Node_Str");
  List<ReplicaFileInfo> rfis=new ArrayList<ReplicaFileInfo>(Replica.getKnown().size());
  updateChecksumStatus(filename);
  for (  Replica replica : Replica.getKnown()) {
    rfis.add(cache.getReplicaFileInfo(filename,replica));
  }
  return new DatabasePreservationState(filename,rfis);
}
Program: 89751
Project: 89751
Buggy source:
/** 
 * Method for updating the status for the files for all the replicas. If the checksums of the archives differ for some replicas, then based on a checksum vote, a specific checksum is chosen as the 'correct' one, and the entries with another checksum that this 'correct' one will be marked as corrupt.
 */
void updateChecksumStatus();

Fixed version (ground truth):
/** 
 * Method for updating the status for a specific file for all the replicas. If the checksums for the replicas differ for some replica, then based on  a checksum vote, a specific checksum is chosen as the 'correct' one, and the entries with another checksum than the 'correct one' will be marked as corrupt.
 * @param filename The name of the file to update the status for.
 */
void updateChecksumStatus(String filename);
Program: 89752
Project: 89752
Buggy source:
/** 
 * This method is used to update the status for the checksums for all  replicafileinfo entries. <br/> <br/> For each file in the database, the checksum vote is made in the  following way. <br/> Each entry in the replicafileinfo table containing the file is retrieved. All the unique checksums are retrieved, e.g. if a checksum is found more than one, then it is ignored. <br/> If only one unique checksum is found, then if must be the correct one,  and all the replicas with this file will have their checksum_status set  to 'OK'. <br/> If more than one checksum is found, then a vote for the correct checksum is performed. This is done by counting the amount of time each of the  unique checksum is found among the replicafileinfo entries for the  current file. The checksum with most votes is chosen as the correct one, and the checksum_status for all the replicafileinfo entries with this  checksum is set to 'OK', whereas the replicafileinfo entries with a  different checksum is set to 'CORRUPT'. <br/>   If no winner is found then a warning and a notification is issued, and  the checksum_status for all the replicafileinfo entries with for the  current file is set to 'UNKNOWN'. <br/>
 */
public void updateChecksumStatus(){
  List<Long> fileIds=retrieveAllFileIds();
  for (  long fileId : fileIds) {
    fileChecksumVote(fileId);
  }
}

Fixed version (ground truth):
/** 
 * Method for updating the status for a specific file for all the replicas. If the checksums for the replicas differ for some replica, then based on  a checksum vote, a specific checksum is chosen as the 'correct' one, and the entries with another checksum than the 'correct one' will be marked as corrupt.
 * @param filename The name of the file to update the status for.
 */
@Override public void updateChecksumStatus(String filename){
  Long fileId=retrieveIdForFile(filename);
  fileChecksumVote(fileId);
}
Program: 89753
Project: 89753
Buggy source:
/** 
 * Method for retrieving the checksum for a specific file. Since a file is not directly attached with a checksum, the checksum of  a file must be found by having the replicafileinfo entries for the file vote about it.
 * @param filename The name of the file, whose checksum are to be found.
 * @return The checksum of the file, or a Null if no validated checksumcan be found.
 * @throws ArgumentNotValid If teh filename is either null or the empty string.
 */
public String getChecksum(String filename) throws ArgumentNotValid {
  ArgumentNotValid.checkNotNullOrEmpty(filename,"String_Node_Str");
  long fileId=retrieveIdForFile(filename);
  for (  Replica rep : Replica.getKnown()) {
    if (retrieveChecksumStatusForReplicaFileInfoEntry(fileId,rep.getId()) == ChecksumStatus.OK) {
      return retrieveChecksumForReplicaFileInfoEntry(fileId,rep.getId());
    }
  }
  log.debug("String_Node_Str" + filename + "String_Node_Str");
  fileChecksumVote(fileId);
  for (  Replica rep : Replica.getKnown()) {
    if (retrieveChecksumStatusForReplicaFileInfoEntry(fileId,rep.getId()) == ChecksumStatus.OK) {
      return retrieveChecksumForReplicaFileInfoEntry(fileId,rep.getId());
    }
  }
  log.warn("String_Node_Str" + filename + "String_Node_Str"+ "String_Node_Str");
  return null;
}

Fixed version (ground truth):
/** 
 * Method for retrieving the checksum for a specific file. Since a file is not directly attached with a checksum, the checksum of  a file must be found by having the replicafileinfo entries for the file vote about it.
 * @param filename The name of the file, whose checksum are to be found.
 * @return The checksum of the file, or a Null if no validated checksumcan be found.
 * @throws ArgumentNotValid If teh filename is either null or the empty string.
 */
public String getChecksum(String filename) throws ArgumentNotValid {
  ArgumentNotValid.checkNotNullOrEmpty(filename,"String_Node_Str");
  long fileId=retrieveIdForFile(filename);
  for (  Replica rep : Replica.getKnown()) {
    if (retrieveChecksumStatusForReplicaFileInfoEntry(fileId,rep.getId()) == ChecksumStatus.OK) {
      return retrieveChecksumForReplicaFileInfoEntry(fileId,rep.getId());
    }
  }
  log.debug("String_Node_Str" + filename + "String_Node_Str");
  Set<String> checksums=new HashSet<String>();
  for (  Replica rep : Replica.getKnown()) {
    if (retrieveChecksumStatusForReplicaFileInfoEntry(fileId,rep.getId()) != ChecksumStatus.CORRUPT) {
      String tmpChecksum=retrieveChecksumForReplicaFileInfoEntry(fileId,rep.getId());
      if (tmpChecksum != null) {
        checksums.add(tmpChecksum);
      }
    }
  }
  if (checksums.size() == 1) {
    return checksums.iterator().next();
  }
  if (checksums.size() == 0) {
    log.warn("String_Node_Str" + filename + "String_Node_Str");
    return null;
  }
  log.info("String_Node_Str" + filename + "String_Node_Str");
  List<String> checksumList=new ArrayList<String>();
  for (  Replica rep : Replica.getKnown()) {
    String cs=retrieveChecksumForReplicaFileInfoEntry(fileId,rep.getId());
    if (cs != null) {
      checksumList.add(cs);
    }
  }
  return vote(checksumList);
}
Program: 89755
Project: 89755
Buggy source:
public void tearDown(){
  JMSConnectionMockupMQ.clearTestQueues();
}

Fixed version (ground truth):
public void tearDown(){
  JMSConnectionMockupMQ.clearTestQueues();
  ChannelsTester.resetChannels();
}
Program: 89756
Project: 89756
Buggy source:
/** 
 * Returns a list of either all active or all inactive trap lists.
 * @param isActive whether to return active or inactive lists.
 * @return  a list if global crawler trap lists.
 */
private List<GlobalCrawlerTrapList> getAllByActivity(boolean isActive){
  List<GlobalCrawlerTrapList> result=new ArrayList<GlobalCrawlerTrapList>();
  Connection conn=DBConnect.getDBConnection();
  PreparedStatement stmt=null;
  try {
    stmt=conn.prepareStatement(SELECT_BY_ACTIVITY);
    stmt.setBoolean(1,isActive);
    ResultSet rs=stmt.executeQuery();
    while (rs.next()) {
      result.add(read(rs.getInt(1)));
    }
    return result;
  }
 catch (  SQLException e) {
    String message="String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e);
    log.warn(message,e);
    throw new UnknownID(message,e);
  }
}

Fixed version (ground truth):
/** 
 * Returns a list of either all active or all inactive trap lists.
 * @param isActive whether to return active or inactive lists.
 * @return  a list if global crawler trap lists.
 */
private List<GlobalCrawlerTrapList> getAllByActivity(boolean isActive){
  List<GlobalCrawlerTrapList> result=new ArrayList<GlobalCrawlerTrapList>();
  Connection conn=DBConnect.getDBConnection();
  PreparedStatement stmt=null;
  try {
    stmt=conn.prepareStatement(SELECT_BY_ACTIVITY);
    stmt.setBoolean(1,isActive);
    ResultSet rs=stmt.executeQuery();
    while (rs.next()) {
      result.add(read(rs.getInt(1)));
    }
    return result;
  }
 catch (  SQLException e) {
    String message="String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e);
    log.warn(message,e);
    throw new UnknownID(message,e);
  }
 finally {
    DBUtils.closeStatementIfOpen(stmt);
  }
}
Program: 89757
Project: 89757
Buggy source:
@Override public GlobalCrawlerTrapList read(int id){
  Connection conn=DBConnect.getDBConnection();
  PreparedStatement stmt=null;
  try {
    stmt=conn.prepareStatement(SELECT_TRAPLIST_STMT);
    stmt.setInt(1,id);
    ResultSet rs=stmt.executeQuery();
    if (!rs.next()) {
      throw new UnknownID("String_Node_Str" + id + "String_Node_Str");
    }
    String name=rs.getString("String_Node_Str");
    String description=rs.getString("String_Node_Str");
    boolean isActive=rs.getBoolean("String_Node_Str");
    stmt=conn.prepareStatement(SELECT_TRAP_EXPRESSIONS_STMT);
    stmt.setInt(1,id);
    rs=stmt.executeQuery();
    List<String> exprs=new ArrayList<String>();
    while (rs.next()) {
      exprs.add(rs.getString("String_Node_Str"));
    }
    return new GlobalCrawlerTrapList(id,exprs,name,description,isActive);
  }
 catch (  SQLException e) {
    String message="String_Node_Str" + id + "String_Node_Str"+ ExceptionUtils.getSQLExceptionCause(e);
    log.warn(message,e);
    throw new IOFailure(message,e);
  }
}

Fixed version (ground truth):
@Override public GlobalCrawlerTrapList read(int id){
  Connection conn=DBConnect.getDBConnection();
  PreparedStatement stmt=null;
  try {
    stmt=conn.prepareStatement(SELECT_TRAPLIST_STMT);
    stmt.setInt(1,id);
    ResultSet rs=stmt.executeQuery();
    if (!rs.next()) {
      throw new UnknownID("String_Node_Str" + id + "String_Node_Str");
    }
    String name=rs.getString("String_Node_Str");
    String description=rs.getString("String_Node_Str");
    boolean isActive=rs.getBoolean("String_Node_Str");
    stmt=conn.prepareStatement(SELECT_TRAP_EXPRESSIONS_STMT);
    stmt.setInt(1,id);
    rs=stmt.executeQuery();
    List<String> exprs=new ArrayList<String>();
    while (rs.next()) {
      exprs.add(rs.getString("String_Node_Str"));
    }
    return new GlobalCrawlerTrapList(id,exprs,name,description,isActive);
  }
 catch (  SQLException e) {
    String message="String_Node_Str" + id + "String_Node_Str"+ ExceptionUtils.getSQLExceptionCause(e);
    log.warn(message,e);
    throw new IOFailure(message,e);
  }
 finally {
    DBUtils.closeStatementIfOpen(stmt);
  }
}
Program: 89758
Project: 89758
Buggy source:
@Override public List<String> getAllActiveTrapExpressions(){
  Connection conn=DBConnect.getDBConnection();
  List<String> result=new ArrayList<String>();
  try {
    PreparedStatement stmt=conn.prepareStatement(SELECT_EXPRS_STMT);
    ResultSet rs=stmt.executeQuery();
    while (rs.next()) {
      result.add(rs.getString(1));
    }
    return result;
  }
 catch (  SQLException e) {
    String message="String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e);
    log.warn(message,e);
    throw new IOFailure(message,e);
  }
}

Fixed version (ground truth):
@Override public List<String> getAllActiveTrapExpressions(){
  Connection conn=DBConnect.getDBConnection();
  List<String> result=new ArrayList<String>();
  PreparedStatement stmt=null;
  try {
    stmt=conn.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    stmt.setBoolean(1,true);
    ResultSet rs=stmt.executeQuery();
    while (rs.next()) {
      result.add(rs.getString(1));
    }
    return result;
  }
 catch (  SQLException e) {
    String message="String_Node_Str" + ExceptionUtils.getSQLExceptionCause(e);
    log.warn(message,e);
    throw new IOFailure(message,e);
  }
 finally {
    DBUtils.closeStatementIfOpen(stmt);
  }
}
Program: 89759
Project: 89759
Buggy source:
/** 
 * Get a list of URLs as calculated by the Heritrix tests.
 * @return The list of URLs.
 */
private URL[] classPathAsURLS(){
  URL[] urls=new URL[0];
  try {
    Method method=ReflectUtils.getPrivateMethod(JMXHeritrixController.class,"String_Node_Str",Map.class);
    Map<String,String> environment=new HashMap<String,String>(System.getenv());
    method.invoke(null,environment);
    String[] urlStrings=environment.get("String_Node_Str").split("String_Node_Str");
    urls=new URL[urlStrings.length];
    for (int i=0; i < urlStrings.length; i++) {
      urls[i]=new URL("String_Node_Str" + urlStrings[i]);
    }
  }
 catch (  NoSuchMethodException e) {
    e.printStackTrace(System.err);
    fail("String_Node_Str" + e.getMessage());
  }
catch (  IllegalAccessException e) {
    e.printStackTrace(System.err);
    fail("String_Node_Str" + e.getMessage());
  }
catch (  InvocationTargetException e) {
    e.printStackTrace(System.err);
    fail("String_Node_Str" + e.getMessage());
  }
catch (  MalformedURLException e) {
    e.printStackTrace(System.err);
    fail("String_Node_Str" + e.getMessage());
  }
  return urls;
}

Fixed version (ground truth):
/** 
 * Get a list of URLs as calculated by the Heritrix tests.
 * @return The list of URLs.
 */
private URL[] classPathAsURLS(){
  URL[] urls=new URL[0];
  try {
    Method method=ReflectUtils.getPrivateMethod(AbstractJMXHeritrixController.class,"String_Node_Str",Map.class);
    Map<String,String> environment=new HashMap<String,String>(System.getenv());
    method.invoke(null,environment);
    String[] urlStrings=environment.get("String_Node_Str").split("String_Node_Str");
    urls=new URL[urlStrings.length];
    for (int i=0; i < urlStrings.length; i++) {
      urls[i]=new URL("String_Node_Str" + urlStrings[i]);
    }
  }
 catch (  NoSuchMethodException e) {
    e.printStackTrace(System.err);
    fail("String_Node_Str" + e.getMessage());
  }
catch (  IllegalAccessException e) {
    e.printStackTrace(System.err);
    fail("String_Node_Str" + e.getMessage());
  }
catch (  InvocationTargetException e) {
    e.printStackTrace(System.err);
    fail("String_Node_Str" + e.getMessage());
  }
catch (  MalformedURLException e) {
    e.printStackTrace(System.err);
    fail("String_Node_Str" + e.getMessage());
  }
  return urls;
}
Program: 89760
Project: 89760
Buggy source:
public static Test suite(){
  TestSuite suite;
  suite=new TestSuite("String_Node_Str");
  addToSuite(suite);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite;
  suite=new TestSuite(HeritrixTesterSuite.class.getName());
  addToSuite(suite);
  return suite;
}
Program: 89761
Project: 89761
Buggy source:
public static void main(String[] args){
  String[] args2={"String_Node_Str","String_Node_Str"};
  TestRunner.main(args2);
}

Fixed version (ground truth):
public static void main(String[] args){
  String[] args2={"String_Node_Str",HeritrixTesterSuite.class.getName()};
  TestRunner.main(args2);
}
Program: 89762
Project: 89762
Buggy source:
public static void addToSuite(TestSuite suite){
  suite.addTestSuite(HeritrixTests.class);
}

Fixed version (ground truth):
public static void addToSuite(TestSuite suite){
  suite.addTestSuite(dk.netarkivet.externalsoftware.HeritrixTests.class);
}