nus-yam/ex-repair huggingface dataset:
Program: 89763
Project: 89763
Buggy source:
/** 
 * Prints the header information for the webpages in the GUI. This includes the navigation menu, and links for changing the language.
 * @param title An internationalised title of the page.
 * @param context The context of the web page request.
 * @throws IOException if an error occurs during writing to output.
 */
public static void generateHeader(String title,PageContext context) throws IOException {
  ArgumentNotValid.checkNotNull(title,"String_Node_Str");
  ArgumentNotValid.checkNotNull(context,"String_Node_Str");
  JspWriter out=context.getOut();
  String url=((HttpServletRequest)context.getRequest()).getRequestURL().toString();
  Locale locale=context.getResponse().getLocale();
  title=escapeHtmlValues(title);
  log.debug("String_Node_Str" + url + "String_Node_Str"+ title+ "String_Node_Str");
  out.print(WEBPAGE_HEADER_TEMPLATE.replace(TITLE_PLACEHOLDER,title));
  out.print("String_Node_Str");
  generateNavigationTree(out,url,locale);
  out.print("String_Node_Str");
  generateLanguageLinks(out);
}

Fixed version (ground truth):
/** 
 * Prints the header information for the webpages in the GUI. This includes the navigation menu, and links for changing the language.
 * @param title An internationalised title of the page.
 * @param context The context of the web page request.
 * @param refreshInSeconds auto-refresh time in seconds
 * @throws IOException if an error occurs during writing to output.
 */
public static void generateHeader(String title,long refreshInSeconds,PageContext context) throws IOException {
  ArgumentNotValid.checkNotNull(title,"String_Node_Str");
  ArgumentNotValid.checkNotNull(context,"String_Node_Str");
  JspWriter out=context.getOut();
  String url=((HttpServletRequest)context.getRequest()).getRequestURL().toString();
  Locale locale=context.getResponse().getLocale();
  title=escapeHtmlValues(title);
  log.debug("String_Node_Str" + url + "String_Node_Str"+ title+ "String_Node_Str");
  out.print(WEBPAGE_HEADER_TEMPLATE_TOP);
  if (refreshInSeconds > 0) {
    out.print(WEBPAGE_HEADER_AUTOREFRESH.replace(TITLE_PLACEHOLDER,Long.toString(refreshInSeconds)));
  }
  out.print(WEBPAGE_HEADER_TEMPLATE_BOTTOM.replace(TITLE_PLACEHOLDER,title));
  out.print("String_Node_Str");
  generateNavigationTree(out,url,locale);
  out.print("String_Node_Str");
  generateLanguageLinks(out);
}
Program: 89765
Project: 89765
Buggy source:
/** 
 * The file represented by WAYBACK_INDEXER_INITIAL_FILES is read line by line and each line is ingested as an already-indexed archive file
 */
private static void ingestInitialFiles(){
  File initialFile=null;
  try {
    initialFile=Settings.getFile(WaybackSettings.WAYBACK_INDEXER_INITIAL_FILES);
  }
 catch (  UnknownID e) {
    log.info("String_Node_Str");
    return;
  }
  if (!initialFile.isFile()) {
    throw new ArgumentNotValid("String_Node_Str" + initialFile.getAbsolutePath() + "String_Node_Str");
  }
  BufferedReader br=null;
  try {
    br=new BufferedReader(new FileReader(initialFile));
  }
 catch (  FileNotFoundException e) {
    throw new IOFailure("String_Node_Str" + initialFile + "String_Node_Str",e);
  }
  String fileName=null;
  ArchiveFileDAO dao=new ArchiveFileDAO();
  Date today=new Date();
  try {
    while ((fileName=br.readLine()) != null) {
      ArchiveFile archiveFile=new ArchiveFile();
      archiveFile.setFilename(fileName);
      archiveFile.setIndexed(true);
      archiveFile.setIndexedDate(today);
      if (!dao.exists(fileName)) {
        log.info("String_Node_Str" + fileName + "String_Node_Str");
        dao.create(archiveFile);
      }
    }
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * The file represented by WAYBACK_INDEXER_INITIAL_FILES is read line by line and each line is ingested as an already-indexed archive file
 */
private static void ingestInitialFiles(){
  String initialFileString=Settings.get(WaybackSettings.WAYBACK_INDEXER_INITIAL_FILES);
  if ("String_Node_Str".equals(initialFileString)) {
    log.info("String_Node_Str");
    return;
  }
  File initialFile=null;
  try {
    initialFile=Settings.getFile(WaybackSettings.WAYBACK_INDEXER_INITIAL_FILES);
  }
 catch (  UnknownID e) {
    log.info("String_Node_Str");
    return;
  }
  if (!initialFile.isFile()) {
    throw new ArgumentNotValid("String_Node_Str" + initialFile.getAbsolutePath() + "String_Node_Str");
  }
  BufferedReader br=null;
  try {
    br=new BufferedReader(new FileReader(initialFile));
  }
 catch (  FileNotFoundException e) {
    throw new IOFailure("String_Node_Str" + initialFile + "String_Node_Str",e);
  }
  String fileName=null;
  ArchiveFileDAO dao=new ArchiveFileDAO();
  Date today=new Date();
  try {
    while ((fileName=br.readLine()) != null) {
      ArchiveFile archiveFile=new ArchiveFile();
      archiveFile.setFilename(fileName);
      archiveFile.setIndexed(true);
      archiveFile.setIndexedDate(today);
      if (!dao.exists(fileName)) {
        log.info("String_Node_Str" + fileName + "String_Node_Str");
        dao.create(archiveFile);
      }
    }
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str",e);
  }
}
Program: 89767
Project: 89767
Buggy source:
public String getHarvestName(){
  return harvestName;
}

Fixed version (ground truth):
public String getHarvestName(){
  if (harvestName == null) {
    return "String_Node_Str";
  }
  return harvestName;
}
Program: 89768
Project: 89768
Buggy source:
/** 
 * Get the unique index server instance.
 * @return The instance;
 */
public static IndexServer getInstance(){
  if (instance == null) {
    instance=new IndexServer();
  }
  return instance;
}

Fixed version (ground truth):
/** 
 * Get the unique index server instance.
 * @return The instance;
 */
public static synchronized IndexServer getInstance(){
  if (instance == null) {
    instance=new IndexServer();
  }
  return instance;
}
Program: 89769
Project: 89769
Buggy source:
/** 
 * Instantiates the two handlers, and starts listening for requests. 
 */
public IndexServer(){
  FileBasedCache<Set<Long>> cdxCache=new CDXIndexCache();
  FileBasedCache<Set<Long>> dedupCrawlLogCache=new DedupCrawlLogIndexCache();
  FileBasedCache<Set<Long>> fullCrawlLogCache=new FullCrawlLogIndexCache();
  Set<Long> emptySet=new HashSet<Long>();
  cdxCache.getIndex(emptySet);
  dedupCrawlLogCache.getIndex(emptySet);
  fullCrawlLogCache.getIndex(emptySet);
  remoteServer=IndexRequestServer.getInstance();
  remoteServer.setHandler(RequestType.CDX,cdxCache);
  remoteServer.setHandler(RequestType.DEDUP_CRAWL_LOG,dedupCrawlLogCache);
  remoteServer.setHandler(RequestType.FULL_CRAWL_LOG,fullCrawlLogCache);
}

Fixed version (ground truth):
/** 
 * Instantiates the two handlers, and starts listening for requests. 
 */
protected IndexServer(){
  FileBasedCache<Set<Long>> cdxCache=new CDXIndexCache();
  FileBasedCache<Set<Long>> dedupCrawlLogCache=new DedupCrawlLogIndexCache();
  FileBasedCache<Set<Long>> fullCrawlLogCache=new FullCrawlLogIndexCache();
  Set<Long> emptySet=new HashSet<Long>();
  cdxCache.getIndex(emptySet);
  dedupCrawlLogCache.getIndex(emptySet);
  fullCrawlLogCache.getIndex(emptySet);
  remoteServer=IndexRequestServer.getInstance();
  remoteServer.setHandler(RequestType.CDX,cdxCache);
  remoteServer.setHandler(RequestType.DEDUP_CRAWL_LOG,dedupCrawlLogCache);
  remoteServer.setHandler(RequestType.FULL_CRAWL_LOG,fullCrawlLogCache);
}
Program: 89770
Project: 89770
Buggy source:
/** 
 * Process a single file.
 * @param job The job that does the processing
 * @param file The file to process
 * @param os Where to put the output.
 */
private void processFile(FileBatchJob job,final File file,OutputStream os){
  log.debug("String_Node_Str" + file.getAbsolutePath() + "String_Node_Str");
  boolean success=false;
  try {
    success=job.processFile(file,os);
  }
 catch (  Exception e) {
    log.warn("String_Node_Str" + file + "String_Node_Str"+ job,e);
  }
  job.noOfFilesProcessed++;
  if (!success) {
    job.filesFailed.add(file);
  }
}

Fixed version (ground truth):
/** 
 * Process a single file.
 * @param job The job that does the processing
 * @param file The file to process
 * @param os Where to put the output.
 */
private void processFile(FileBatchJob job,final File file,OutputStream os){
  log.trace("String_Node_Str" + file.getAbsolutePath() + "String_Node_Str");
  boolean success=false;
  try {
    success=job.processFile(file,os);
  }
 catch (  Exception e) {
    log.warn("String_Node_Str" + file + "String_Node_Str"+ job,e);
  }
  job.noOfFilesProcessed++;
  if (!success) {
    job.filesFailed.add(file);
  }
}
Program: 89771
Project: 89771
Buggy source:
/** 
 * Process one file stored in the bit archive.
 * @param file the file to be processed.
 * @param os   the OutputStream to which output should be written
 * @return true if the file was successfully processed, false otherwise
 */
public boolean processFile(File file,OutputStream os){
  log.debug("String_Node_Str" + file.getAbsolutePath() + "String_Node_Str");
  ArgumentNotValid.checkNotNull(file,"String_Node_Str");
  ArgumentNotValid.checkNotNull(os,"String_Node_Str");
  return loadedJob.processFile(file,os);
}

Fixed version (ground truth):
/** 
 * Process one file stored in the bit archive.
 * @param file the file to be processed.
 * @param os   the OutputStream to which output should be written
 * @return true if the file was successfully processed, false otherwise
 */
public boolean processFile(File file,OutputStream os){
  log.trace("String_Node_Str" + file.getAbsolutePath() + "String_Node_Str");
  ArgumentNotValid.checkNotNull(file,"String_Node_Str");
  ArgumentNotValid.checkNotNull(os,"String_Node_Str");
  return loadedJob.processFile(file,os);
}
Program: 89774
Project: 89774
Buggy source:
/** 
 * The constructor. Initializes the time out for this job.
 */
public FileListJob(){
  batchJobTimeout=Constants.ONE_HOUR_IN_MILLIES;
}

Fixed version (ground truth):
/** 
 * The constructor. 
 */
public FileListJob(){
}
Program: 89779
Project: 89779
Buggy source:
/** 
 * The constructor.
 */
public ChecksumJob(){
  batchJobTimeout=CHECKSUM_JOB_TIME;
}

Fixed version (ground truth):
/** 
 * The constructor.
 */
public ChecksumJob(){
  batchJobTimeout=-1;
}
Program: 89780
Project: 89780
Buggy source:
/** 
 * The method is used to update the checksum for all the files in a replica. The checksum for the replica is retrieved through GetAllChecksumMessages. This will take a very large amount of time for the bitarchive, but a  more limited amount of time for the checksumarchive. The corresponding replicafileinfo entries in the database for the  retrieved checksum results will be updated. Then a checksum update will  be performed to check for corrupted replicafileinfo.
 * @param replica The replica to find the changed files for.
 * @throws ArgumentNotValid If the replica is null.
 */
public void findChangedFiles(Replica replica) throws ArgumentNotValid {
  ArgumentNotValid.checkNotNull(replica,"String_Node_Str");
  runChecksum(replica);
  initChecksumStatusUpdate();
  cache.updateChecksumStatus();
}

Fixed version (ground truth):
/** 
 * The method is used to update the checksum for all the files in a replica. The checksum for the replica is retrieved through GetAllChecksumMessages. This will take a very large amount of time for the bitarchive, but a  more limited amount of time for the checksumarchive. The corresponding replicafileinfo entries in the database for the  retrieved checksum results will be updated. Then a checksum update will  be performed to check for corrupted replicafileinfo.
 * @param replica The replica to find the changed files for.
 * @throws ArgumentNotValid If the replica is null.
 */
public synchronized void findChangedFiles(Replica replica) throws ArgumentNotValid {
  ArgumentNotValid.checkNotNull(replica,"String_Node_Str");
  runChecksum(replica);
  initChecksumStatusUpdate();
  cache.updateChecksumStatus();
}
Program: 89781
Project: 89781
Buggy source:
/** 
 * This method retrieves the filelist for the replica, and then it updates the database with this list of filenames.
 * @param replica The replica to find the missing files for.
 * @throws ArgumentNotValid If the replica is null.
 */
public void findMissingFiles(Replica replica) throws ArgumentNotValid {
  ArgumentNotValid.checkNotNull(replica,"String_Node_Str");
  List<String> filenames=getFilenamesList(replica);
  cache.addFileListInformation(filenames,replica);
}

Fixed version (ground truth):
/** 
 * This method retrieves the filelist for the replica, and then it updates the database with this list of filenames.
 * @param replica The replica to find the missing files for.
 * @throws ArgumentNotValid If the replica is null.
 */
public synchronized void findMissingFiles(Replica replica) throws ArgumentNotValid {
  ArgumentNotValid.checkNotNull(replica,"String_Node_Str");
  List<String> filenames=getFilenamesList(replica);
  cache.addFileListInformation(filenames,replica);
}
Program: 89782
Project: 89782
Buggy source:
/** 
 * Method for retrieving the current instance of this class.
 * @return The instance.
 */
public static DatabaseBasedActiveBitPreservation getInstance(){
  if (instance == null) {
    instance=new DatabaseBasedActiveBitPreservation();
  }
  return instance;
}

Fixed version (ground truth):
/** 
 * Method for retrieving the current instance of this class.
 * @return The instance.
 */
public static synchronized DatabaseBasedActiveBitPreservation getInstance(){
  if (instance == null) {
    instance=new DatabaseBasedActiveBitPreservation();
  }
  return instance;
}
Program: 89784
Project: 89784
Buggy source:
/** 
 * Method to create a new entry in the file table in the database. The file_id is automatically created by the database, and the argument is used for the filename for this new entry to the table.  This will also create a replicafileinfo entry for each replica.
 * @param filename The filename for the new entry in the file table.
 * @throws IllegalState If the file cannot be inserted into the database.
 */
private void insertFileIntoDB(String filename) throws IllegalState {
  try {
    PreparedStatement statement=null;
    dbConnection.setAutoCommit(false);
    statement=dbConnection.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    statement.setString(1,filename);
    statement.executeUpdate();
    dbConnection.commit();
    long fileId=retrieveIdForFile(filename);
    createReplicaFileInfoEntriesInDB(fileId);
  }
 catch (  SQLException e) {
    throw new IllegalState("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Method to create a new entry in the file table in the database. The file_id is automatically created by the database, and the argument is used for the filename for this new entry to the table.  This will also create a replicafileinfo entry for each replica.
 * @param filename The filename for the new entry in the file table.
 * @throws IllegalState If the file cannot be inserted into the database.
 */
private void insertFileIntoDB(String filename) throws IllegalState {
  try {
    PreparedStatement statement=null;
    dbConnection.setAutoCommit(false);
    statement=dbConnection.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    statement.setString(1,filename);
    statement.executeUpdate();
    dbConnection.commit();
    long fileId=retrieveIdForFile(filename);
    createReplicaFileInfoEntriesInDB(fileId);
  }
 catch (  SQLException e) {
    throw new IllegalState("String_Node_Str" + filename + "String_Node_Str",e);
  }
}
Program: 89785
Project: 89785
Buggy source:
/** 
 * Method for retrieving the current instance of this class.
 * @return The current instance.
 */
public static ReplicaCacheDatabase getInstance(){
  if (instance == null) {
    instance=new ReplicaCacheDatabase();
  }
  return instance;
}

Fixed version (ground truth):
/** 
 * Method for retrieving the current instance of this class.
 * @return The current instance.
 */
public static synchronized ReplicaCacheDatabase getInstance(){
  if (instance == null) {
    instance=new ReplicaCacheDatabase();
  }
  return instance;
}
Program: 89786
Project: 89786
Buggy source:
/** 
 * Get the date for the last file list job.
 * @param replica The replica to get the date for.
 * @return The date of the last missing files update for the replica.A null is returned if no last missing files update has been performed.
 * @throws ArgumentNotValid If the replica is null.
 * @throws IllegalArgumentException If the Date of the Timestamp cannot beinstanciated.
 */
@Override public Date getDateOfLastMissingFilesUpdate(Replica replica) throws ArgumentNotValid, IllegalArgumentException {
  ArgumentNotValid.checkNotNull(replica,"String_Node_Str");
  String sql="String_Node_Str" + "String_Node_Str";
  String result=DBUtils.selectStringValue(dbConnection,sql,replica.getId());
  if (result == null) {
    return null;
  }
 else {
    return new Date(Timestamp.valueOf(result).getTime());
  }
}

Fixed version (ground truth):
/** 
 * Get the date for the last file list job.
 * @param replica The replica to get the date for.
 * @return The date of the last missing files update for the replica.A null is returned if no last missing files update has been performed.
 * @throws ArgumentNotValid If the replica is null.
 * @throws IllegalArgumentException If the Date of the Timestamp cannot beinstanciated.
 */
@Override public Date getDateOfLastMissingFilesUpdate(Replica replica) throws ArgumentNotValid, IllegalArgumentException {
  ArgumentNotValid.checkNotNull(replica,"String_Node_Str");
  String sql="String_Node_Str" + "String_Node_Str";
  String result=DBUtils.selectStringValue(dbConnection,sql,replica.getId());
  if (result == null) {
    log.warn("String_Node_Str" + "String_Node_Str");
    return null;
  }
 else {
    return new Date(Timestamp.valueOf(result).getTime());
  }
}
Program: 89787
Project: 89787
Buggy source:
/** 
 * Method for retrieving the date for the last update for corrupted files. This method does not contact the replicas, it only retrieves the data from the last time the checksum was retrieved. 
 * @param replica The replica to find the date for the latest update forcorruption of files. 
 * @return The date for the last checksum update. A null is returned if nowrong files update has been performed for this replica.
 * @throws ArgumentNotValid If the replica is null.
 * @throws IllegalArgumentException If the Date of the Timestamp cannot beinstanciated.
 */
@Override public Date getDateOfLastWrongFilesUpdate(Replica replica) throws ArgumentNotValid, IllegalArgumentException {
  ArgumentNotValid.checkNotNull(replica,"String_Node_Str");
  String sql="String_Node_Str" + "String_Node_Str";
  String result=DBUtils.selectStringValue(dbConnection,sql,replica.getId());
  if (result == null) {
    return null;
  }
 else {
    return new Date(Timestamp.valueOf(result).getTime());
  }
}

Fixed version (ground truth):
/** 
 * Method for retrieving the date for the last update for corrupted files. This method does not contact the replicas, it only retrieves the data from the last time the checksum was retrieved. 
 * @param replica The replica to find the date for the latest update forcorruption of files. 
 * @return The date for the last checksum update. A null is returned if nowrong files update has been performed for this replica.
 * @throws ArgumentNotValid If the replica is null.
 * @throws IllegalArgumentException If the Date of the Timestamp cannot beinstanciated.
 */
@Override public Date getDateOfLastWrongFilesUpdate(Replica replica) throws ArgumentNotValid, IllegalArgumentException {
  ArgumentNotValid.checkNotNull(replica,"String_Node_Str");
  String sql="String_Node_Str" + "String_Node_Str";
  String result=DBUtils.selectStringValue(dbConnection,sql,replica.getId());
  if (result == null) {
    log.warn("String_Node_Str" + "String_Node_Str");
    return null;
  }
 else {
    return new Date(Timestamp.valueOf(result).getTime());
  }
}
Program: 89790
Project: 89790
Buggy source:
/** 
 * Extract the name of the bitarchive (parameter Constants.BITARCHIVE_NAME_PARAM) and whether to update missing files (parameter Constants.FIND_MISSING_FILES_PARAM) or checksums (parameter Constants.CHECKSUM_PARAM). Does nothing if parameter 'bitarchive' is not set.
 * @param context the current JSP context
 * @throws ForwardedToErrorPage if an unknown bitarchive is posted.
 * @throws ArgumentNotValid If the context is null.
 */
public static void processUpdateRequest(PageContext context) throws ArgumentNotValid, ForwardedToErrorPage {
  ArgumentNotValid.checkNotNull(context,"String_Node_Str");
  ServletRequest request=context.getRequest();
  String bitarchiveName=request.getParameter(Constants.BITARCHIVE_NAME_PARAM);
  if (bitarchiveName == null) {
    log.info("String_Node_Str");
    return;
  }
  if (!Replica.isKnownReplicaName(bitarchiveName)) {
    HTMLUtils.forwardWithErrorMessage(context,I18N,"String_Node_Str",bitarchiveName);
    throw new ForwardedToErrorPage("String_Node_Str" + bitarchiveName);
  }
  Replica bitarchive=Replica.getReplicaFromName(bitarchiveName);
  String findmissingfiles=request.getParameter(Constants.FIND_MISSING_FILES_PARAM);
  String checksum=request.getParameter(Constants.CHECKSUM_PARAM);
  ActiveBitPreservation preserve=ActiveBitPreservationFactory.getInstance();
  if (findmissingfiles != null) {
    preserve.findMissingFiles(bitarchive);
  }
  if (checksum != null) {
    preserve.findChangedFiles(bitarchive);
  }
}

Fixed version (ground truth):
/** 
 * Extract the name of the bitarchive (parameter Constants.BITARCHIVE_NAME_PARAM) and whether to update missing files (parameter Constants.FIND_MISSING_FILES_PARAM) or checksums (parameter Constants.CHECKSUM_PARAM). Does nothing if parameter 'bitarchive' is not set.
 * @param context the current JSP context
 * @throws ForwardedToErrorPage if an unknown bitarchive is posted.
 * @throws ArgumentNotValid If the context is null.
 */
public static void processUpdateRequest(PageContext context) throws ArgumentNotValid, ForwardedToErrorPage {
  ArgumentNotValid.checkNotNull(context,"String_Node_Str");
  ServletRequest request=context.getRequest();
  String bitarchiveName=request.getParameter(Constants.BITARCHIVE_NAME_PARAM);
  if (bitarchiveName == null) {
    log.debug("String_Node_Str" + Constants.BITARCHIVE_NAME_PARAM + "String_Node_Str"+ "String_Node_Str");
    return;
  }
  if (!Replica.isKnownReplicaName(bitarchiveName)) {
    HTMLUtils.forwardWithErrorMessage(context,I18N,"String_Node_Str",bitarchiveName);
    throw new ForwardedToErrorPage("String_Node_Str" + bitarchiveName);
  }
  Replica bitarchive=Replica.getReplicaFromName(bitarchiveName);
  String findmissingfiles=request.getParameter(Constants.FIND_MISSING_FILES_PARAM);
  String checksum=request.getParameter(Constants.CHECKSUM_PARAM);
  ActiveBitPreservation preserve=ActiveBitPreservationFactory.getInstance();
  if (findmissingfiles != null) {
    preserve.findMissingFiles(bitarchive);
  }
  if (checksum != null) {
    preserve.findChangedFiles(bitarchive);
  }
}
Program: 89791
Project: 89791
Buggy source:
/** 
 * Constructor.
 */
private ChecksumFileServer(){
  log.info("String_Node_Str");
  jmsCon=JMSConnectionFactory.getInstance();
  theCR=Channels.getTheCR();
  jmsCon.setListener(theCR,this);
  checksumAppId=createAppId();
  cs=FileChecksumArchive.getInstance();
  log.info("String_Node_Str" + checksumAppId + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
private ChecksumFileServer(){
  log.info("String_Node_Str");
  cs=FileChecksumArchive.getInstance();
  jmsCon=JMSConnectionFactory.getInstance();
  theCR=Channels.getTheCR();
  jmsCon.setListener(theCR,this);
  checksumAppId=createAppId();
  log.info("String_Node_Str" + checksumAppId + "String_Node_Str");
}
Program: 89795
Project: 89795
Buggy source:
/** 
 * Get a sorted list of all domainnames of a HarvestDefinition.
 * @param harvestName of HarvestDefintion
 * @return List of all domains of the HarvestDefintion.
 */
public List<String> getListOfDomainsOfHarvestDefinition(String harvestName){
  ArgumentNotValid.checkNotNullOrEmpty(harvestName,"String_Node_Str");
  Connection c=DBConnect.getDBConnection();
  PreparedStatement s=null;
  try {
    s=c.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    s.setString(1,harvestName);
    ResultSet res=s.executeQuery();
    List<String> domains=new ArrayList<String>();
    while (res.next()) {
      domains.add(res.getString(1));
    }
    return domains;
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    DBUtils.closeStatementIfOpen(s);
  }
}

Fixed version (ground truth):
/** 
 * Get a sorted list of all domainnames of a HarvestDefinition.
 * @param harvestName of HarvestDefinition
 * @return List of all domains of the HarvestDefinition.
 */
public List<String> getListOfDomainsOfHarvestDefinition(String harvestName){
  ArgumentNotValid.checkNotNullOrEmpty(harvestName,"String_Node_Str");
  Connection c=DBConnect.getDBConnection();
  PreparedStatement s=null;
  try {
    s=c.prepareStatement("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    s.setString(1,harvestName);
    ResultSet res=s.executeQuery();
    List<String> domains=new ArrayList<String>();
    while (res.next()) {
      domains.add(res.getString(1));
    }
    return domains;
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ ExceptionUtils.getSQLExceptionCause(e),e);
  }
 finally {
    DBUtils.closeStatementIfOpen(s);
  }
}
Program: 89796
Project: 89796
Buggy source:
/** 
 * Test whether the correct error message when sending to a checksum replica.  
 */
public void testArgumentsChecksumReplica(){
  String expectedErrorMessage="String_Node_Str" + "String_Node_Str" + TestInfo.BATCH_CS_REPLICA_NAME + "String_Node_Str"+ "String_Node_Str"+ Replica.getReplicaFromName(TestInfo.BATCH_CS_REPLICA_NAME)+ "String_Node_Str";
  String[] args=new String[]{"String_Node_Str" + TestInfo.BATCH_TEST_JAR_FILE.getAbsolutePath(),"String_Node_Str" + TestInfo.BATCH_TEST_JAR_GOOD_CLASS,"String_Node_Str" + TestInfo.BATCH_CS_REPLICA_NAME};
  try {
    RunBatch.main(args);
    fail("String_Node_Str");
  }
 catch (  SecurityException e) {
  }
  String errMsg=pss.getErr();
  int pseVal=pse.getExitValue();
  assertEquals("String_Node_Str" + pseVal,1,pseVal);
  assertTrue("String_Node_Str" + expectedErrorMessage + "String_Node_Str"+ errMsg,errMsg.startsWith(expectedErrorMessage));
}

Fixed version (ground truth):
/** 
 * Test whether the correct error message when sending to a checksum replica.  
 */
public void testArgumentsChecksumReplica(){
  String expectedErrorMessage="String_Node_Str" + "String_Node_Str" + Replica.getReplicaFromName(TestInfo.BATCH_CS_REPLICA_NAME) + "String_Node_Str"+ Replica.getReplicaFromName(TestInfo.BATCH_CS_REPLICA_NAME).getType()+ "String_Node_Str";
  String[] args=new String[]{"String_Node_Str" + TestInfo.BATCH_TEST_JAR_FILE.getAbsolutePath(),"String_Node_Str" + TestInfo.BATCH_TEST_JAR_GOOD_CLASS,"String_Node_Str" + TestInfo.BATCH_CS_REPLICA_NAME};
  try {
    RunBatch.main(args);
    fail("String_Node_Str");
  }
 catch (  SecurityException e) {
  }
  String errMsg=pss.getErr();
  int pseVal=pse.getExitValue();
  assertEquals("String_Node_Str" + pseVal,1,pseVal);
  assertTrue("String_Node_Str" + expectedErrorMessage + "String_Node_Str"+ errMsg,errMsg.startsWith(expectedErrorMessage));
}
Program: 89797
Project: 89797
Buggy source:
/** 
 * Closes this BitarchiveMonitorServer cleanly.
 */
public void cleanup(){
  if (instance != null) {
    con.removeListener(Channels.getTheBamon(),this);
    instance=null;
    if (bamon != null) {
      bamon.cleanup();
      bamon=null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Closes this BitarchiveMonitorServer cleanly.
 */
public void cleanup(){
  if (instance != null) {
    con.removeListener(Channels.getTheBamon(),this);
    batchConversions.clear();
    instance=null;
    if (bamon != null) {
      bamon.cleanup();
      bamon=null;
    }
  }
}
Program: 89798
Project: 89798
Buggy source:
/** 
 * Handles notifications from the bitarchive monitor, that a batch job is complete. Spawns a new thread in which all the results are wrapped and sent back in a reply to the originator of this batch request.
 * @param o   the observable object. Should always be the bitarchivemonitor. If it isn't, this notification will be logged and ignored.
 * @param arg an argument passed from the bitarchive monitor. This shouldalways be a batch status object indicating the end of that batchjob. If it isn't, this notification will be logged and ignored.
 */
public void update(Observable o,final Object arg){
  if (o != bamon) {
    log.warn("String_Node_Str" + o + "String_Node_Str");
    return;
  }
  if (arg == null) {
    log.warn("String_Node_Str");
    return;
  }
  if (!(arg instanceof dk.netarkivet.archive.bitarchive.BitarchiveMonitor.BatchJobStatus)) {
    log.warn("String_Node_Str" + arg.getClass() + "String_Node_Str"+ arg+ "String_Node_Str");
    return;
  }
  new Thread(){
    public void run(){
      doBatchReply((BitarchiveMonitor.BatchJobStatus)arg);
    }
  }
.start();
}

Fixed version (ground truth):
/** 
 * Handles notifications from the bitarchive monitor, that a batch job is complete. Spawns a new thread in which all the results are wrapped and sent back in a reply to the originator of this batch request.
 * @param o   the observable object. Should always be the bitarchivemonitor. If it isn't, this notification will be logged and ignored.
 * @param arg an argument passed from the bitarchive monitor. This shouldalways be a batch status object indicating the end of that batchjob. If it isn't, this notification will be logged and ignored.
 */
public void update(Observable o,final Object arg){
  if (o != bamon) {
    log.warn("String_Node_Str" + o + "String_Node_Str");
    return;
  }
  if (arg == null) {
    log.warn("String_Node_Str");
    return;
  }
  if (!(arg instanceof dk.netarkivet.archive.bitarchive.BitarchiveMonitor.BatchJobStatus)) {
    log.warn("String_Node_Str" + arg.getClass() + "String_Node_Str"+ arg+ "String_Node_Str");
    return;
  }
  new Thread(){
    public void run(){
      BitarchiveMonitor.BatchJobStatus bjs=(BitarchiveMonitor.BatchJobStatus)arg;
      if (batchConversions.containsKey(bjs.originalRequestID)) {
        replyConvertedBatch(bjs);
      }
 else {
        doBatchReply(bjs);
      }
    }
  }
.start();
}
Program: 89799
Project: 89799
Buggy source:
public void run(){
  doBatchReply((BitarchiveMonitor.BatchJobStatus)arg);
}

Fixed version (ground truth):
public void run(){
  BitarchiveMonitor.BatchJobStatus bjs=(BitarchiveMonitor.BatchJobStatus)arg;
  if (batchConversions.containsKey(bjs.originalRequestID)) {
    replyConvertedBatch(bjs);
  }
 else {
    doBatchReply(bjs);
  }
}
Program: 89800
Project: 89800
Buggy source:
/** 
 * This is the message handling method for HeartBeatMessages. Registers a sign of life from a bitarchive.
 * @param hbMsg the message that represents the sign of life
 */
public void visit(HeartBeatMessage hbMsg){
  try {
    bamon.signOfLife(hbMsg.getBitarchiveID());
  }
 catch (  Exception e) {
    log.warn("String_Node_Str" + hbMsg + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Method for handling the 
 * @param msg The GetAllChecksumsMessage, which will be made into a batchjoband sent to the 
 */
public void visit(GetChecksumMessage msg){
  log.info("String_Node_Str" + msg + "String_Node_Str");
  ChecksumJob cj=new ChecksumJob();
  cj.processOnlyFileNamed(msg.getArcfileName());
  executeConvertedBatch(cj,msg);
}
Program: 89801
Project: 89801
Buggy source:
/** 
 * This method sends a reply based on the information from bitarchives received and stored in the given batch job status. It will concatenate the results from all the bitarchives in one file, and construct a reply to the originating requester with all information.
 * @param bjs Status of received messages from bitarchives.
 */
private void doBatchReply(BitarchiveMonitor.BatchJobStatus bjs){
  RemoteFile resultsFile=null;
  try {
    resultsFile=RemoteFileFactory.getMovefileInstance(bjs.batchResultFile);
  }
 catch (  Exception e) {
    log.warn("String_Node_Str" + bjs.batchResultFile,e);
    bjs.appendError("String_Node_Str" + e);
  }
  BatchReplyMessage brMsg=new BatchReplyMessage(bjs.originalRequestReplyTo,Channels.getTheBamon(),bjs.originalRequestID,bjs.noOfFilesProcessed,bjs.filesFailed,resultsFile);
  if (bjs.errorMessages != null) {
    brMsg.setNotOk(bjs.errorMessages);
  }
  con.send(brMsg);
  log.info("String_Node_Str" + brMsg + "String_Node_Str"+ brMsg.getTo()+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * This method sends a reply based on the information from bitarchives received and stored in the given batch job status. It will concatenate the results from all the bitarchives in one file, and construct a reply to the originating requester with all information.
 * @param bjs Status of received messages from bitarchives.
 */
private void doBatchReply(BitarchiveMonitor.BatchJobStatus bjs){
  RemoteFile resultsFile=null;
  try {
    resultsFile=RemoteFileFactory.getMovefileInstance(bjs.batchResultFile);
  }
 catch (  Exception e) {
    log.warn("String_Node_Str" + bjs.batchResultFile,e);
    bjs.appendError("String_Node_Str" + e);
  }
  BatchReplyMessage brMsg=new BatchReplyMessage(bjs.originalRequestReplyTo,Channels.getTheBamon(),bjs.originalRequestID,bjs.noOfFilesProcessed,bjs.filesFailed,resultsFile);
  if (bjs.errorMessages != null) {
    brMsg.setNotOk(bjs.errorMessages);
  }
  con.send(brMsg);
  log.info("String_Node_Str" + brMsg + "String_Node_Str"+ "String_Node_Str"+ brMsg.getTo()+ "String_Node_Str");
}
Program: 89802
Project: 89802
Buggy source:
/** 
 * Method for retrieving a map containing all the checksums and their  corresponding filenames within the archive.
 * @param msg The GetAllChecksumMessage.
 * @throws ArgumentNotValid If the GetAllChecksumMessage is null.
 */
public void visit(GetAllChecksumsMessage msg) throws ArgumentNotValid {
  ArgumentNotValid.checkNotNull(msg,"String_Node_Str");
  log.debug("String_Node_Str" + msg.toString());
  try {
    msg.setResultingFile(cs.getArchiveAsFile());
  }
 catch (  Throwable e) {
    log.warn("String_Node_Str",e);
    msg.setNotOk(e);
  }
 finally {
    log.info("String_Node_Str" + msg.toString());
    jmsCon.reply(msg);
  }
}

Fixed version (ground truth):
/** 
 * Method for retrieving a map containing all the checksums and their  corresponding filenames within the archive.
 * @param msg The GetAllChecksumMessage.
 * @throws ArgumentNotValid If the GetAllChecksumMessage is null.
 */
public void visit(GetAllChecksumsMessage msg) throws ArgumentNotValid {
  ArgumentNotValid.checkNotNull(msg,"String_Node_Str");
  log.debug("String_Node_Str" + msg.toString());
  try {
    msg.setFile(cs.getArchiveAsFile());
  }
 catch (  Throwable e) {
    log.warn("String_Node_Str",e);
    msg.setNotOk(e);
  }
 finally {
    log.info("String_Node_Str" + msg.toString());
    jmsCon.reply(msg);
  }
}
Program: 89803
Project: 89803
Buggy source:
/** 
 * Method for retrieving the checksum of a specific file from the archive of a specific replica. If the replica is a BitArchive, then a Batch  message with the ChecksumJob is sent. If the replica is a  ChecksumArchive, then a GetChecksumMessage is sent.
 * @param filename The file to checksum.
 * @param replicaClient The client to retrieve the checksum of the file from.
 */
private void sendChecksumRequestForFile(String filename,ReplicaClient replicaClient){
  NetarkivetMessage msg;
  if (replicaClient.getType() == ReplicaType.BITARCHIVE) {
    ChecksumJob checksumJob=new ChecksumJob();
    checksumJob.processOnlyFileNamed(filename);
    msg=replicaClient.batch(Channels.getTheRepos(),checksumJob);
  }
 else   if (replicaClient.getType() == ReplicaType.CHECKSUM) {
    msg=replicaClient.getChecksum(Channels.getTheRepos(),filename);
  }
 else {
    String errMsg="String_Node_Str" + replicaClient + "String_Node_Str"+ filename+ "String_Node_Str";
    log.error(errMsg);
    throw new IllegalState(errMsg);
  }
  outstandingChecksumFiles.put(msg.getID(),filename);
  log.debug("String_Node_Str" + filename + "String_Node_Str"+ msg.getID()+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Method for retrieving the checksum of a specific file from the archive of a specific replica. If the replica is a BitArchive, then a Batch  message with the ChecksumJob is sent. If the replica is a  ChecksumArchive, then a GetChecksumMessage is sent.
 * @param filename The file to checksum.
 * @param replicaClient The client to retrieve the checksum of the file from.
 */
private void sendChecksumRequestForFile(String filename,ReplicaClient replicaClient){
  NetarkivetMessage msg;
  msg=replicaClient.getChecksum(Channels.getTheRepos(),filename);
  outstandingChecksumFiles.put(msg.getID(),filename);
  log.debug("String_Node_Str" + filename + "String_Node_Str"+ msg.getID()+ "String_Node_Str");
}
Program: 89804
Project: 89804
Buggy source:
/** 
 * Method for retrieving the checksums from a specific replica. The checksum are retrieved differently for the different types of  replica: <br/> The checksums of a bitarchive is retrieved through running  the BatchJob ChecksumJob on the replica. <br/> The checksums of a checksumsarchive is retrieved through a  GetAllChecksumMessage.
 * @param replica The replica to retrieve the checksums from.
 * @return The checksums in the format of ChecksumEntry.
 * @throws IOFailure If a bitarchive does not return a output file.
 * @throws IllegalState If the replica has an unknown replica type.
 */
private List<ChecksumEntry> getChecksumList(Replica replica) throws IOFailure, IllegalState {
  ArgumentNotValid.checkNotNull(replica,"String_Node_Str");
  if (replica.getType() == ReplicaType.BITARCHIVE) {
    File outputFile=WorkFiles.getFile(replica,WorkFiles.CHECKSUMS_ON_BA);
    log.info("String_Node_Str" + replica + "String_Node_Str");
    runBatchJob(new ChecksumJob(),replica,null,outputFile);
    if (outputFile == null || !outputFile.exists()) {
      String errMsg="String_Node_Str" + replica + "String_Node_Str";
      log.warn(errMsg);
      throw new IOFailure(errMsg);
    }
    return ChecksumEntry.parseChecksumJob(outputFile);
  }
 else   if (replica.getType() == ReplicaType.CHECKSUM) {
    log.info("String_Node_Str" + replica + "String_Node_Str");
    return ChecksumEntry.parseChecksumJob(ArcRepositoryClientFactory.getPreservationInstance().getAllChecksums(replica.getId()));
  }
 else {
    String msg="String_Node_Str" + replica + "String_Node_Str";
    log.warn(msg);
    throw new IllegalState(msg);
  }
}

Fixed version (ground truth):
/** 
 * Method for retrieving the checksums from a specific replica. The checksum are retrieved differently for the different types of  replica: <br/> The checksums of a bitarchive is retrieved through running  the BatchJob ChecksumJob on the replica. <br/> The checksums of a checksumsarchive is retrieved through a  GetAllChecksumMessage.
 * @param replica The replica to retrieve the checksums from.
 * @return The checksums in the format of ChecksumEntry.
 * @throws IOFailure If a bitarchive does not return a output file.
 * @throws IllegalState If the replica has an unknown replica type.
 */
private List<ChecksumEntry> getChecksumList(Replica replica) throws IOFailure, IllegalState {
  ArgumentNotValid.checkNotNull(replica,"String_Node_Str");
  log.info("String_Node_Str" + replica + "String_Node_Str");
  return ChecksumEntry.parseChecksumJob(ArcRepositoryClientFactory.getPreservationInstance().getAllChecksums(replica.getId()));
}
Program: 89805
Project: 89805
Buggy source:
/** 
 * Method for retrieving the filelist from a specific replica. The filelist are retrieved differently for the different types of  replica: <br/> The filelist of a bitarchive is retrieved through running  the BatchJob FilelistJob on the replica. <br/> The filelist of a checksumsarchive is retrieved through a  GetAllFilenamesMessage.
 * @param replica The replica to retrieve the filelist from.
 * @return The names of the files in a list.
 * @throws ArgumentNotValid If the replica is 'null'.
 * @throws UnknownID If the replica has a unhandled replica type.
 */
private List<String> getFilenamesList(Replica replica) throws ArgumentNotValid, UnknownID {
  ArgumentNotValid.checkNotNull(replica,"String_Node_Str");
  if (replica.getType() == ReplicaType.BITARCHIVE) {
    File outputFile=WorkFiles.getFile(replica,WorkFiles.CHECKSUMS_ON_BA);
    log.info("String_Node_Str" + replica + "String_Node_Str");
    runBatchJob(new FileListJob(),replica,null,outputFile);
    return FileUtils.readListFromFile(outputFile);
  }
 else   if (replica.getType() == ReplicaType.CHECKSUM) {
    log.info("String_Node_Str" + replica + "String_Node_Str");
    return FileUtils.readListFromFile(ArcRepositoryClientFactory.getPreservationInstance().getAllFilenames(replica.getId()));
  }
 else {
    String msg="String_Node_Str" + replica + "String_Node_Str";
    log.warn(msg);
    throw new UnknownID(msg);
  }
}

Fixed version (ground truth):
/** 
 * Method for retrieving the filelist from a specific replica. The filelist are retrieved differently for the different types of  replica: <br/> The filelist of a bitarchive is retrieved through running  the BatchJob FilelistJob on the replica. <br/> The filelist of a checksumsarchive is retrieved through a  GetAllFilenamesMessage.
 * @param replica The replica to retrieve the filelist from.
 * @return The names of the files in a list.
 * @throws ArgumentNotValid If the replica is 'null'.
 * @throws UnknownID If the replica has a unhandled replica type.
 */
private List<String> getFilenamesList(Replica replica) throws ArgumentNotValid, UnknownID {
  ArgumentNotValid.checkNotNull(replica,"String_Node_Str");
  log.info("String_Node_Str" + replica + "String_Node_Str");
  return FileUtils.readListFromFile(ArcRepositoryClientFactory.getPreservationInstance().getAllFilenames(replica.getId()));
}
Program: 89806
Project: 89806
Buggy source:
/** 
 * This should creates a batch job for retrieving all the filenames.
 * @param msg The message.
 * @throws NotImplementedException Always, since this method has not yet been implemented.
 * @throws ArgumentNotValid If the GetAllFilenamesMessage is null.
 */
public void getAllFilenames(GetAllFilenamesMessage msg) throws NotImplementedException, ArgumentNotValid {
  ArgumentNotValid.checkNotNull(msg,"String_Node_Str");
  throw new NotImplementedException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Method for sending a GetAllFilenamesMessage to a checksum archive.
 * @param msg The GetAllFilenamesMessage, which will be send through the jms connection to the checksum archive.
 * @throws ArgumentNotValid If the GetAllFilenamesMessage is null.
 */
public void getAllFilenames(GetAllFilenamesMessage msg) throws ArgumentNotValid {
  ArgumentNotValid.checkNotNull(msg,"String_Node_Str");
  jmsCon.resend(msg,theBamon);
  log.debug("String_Node_Str" + msg.toString() + "String_Node_Str");
}
Program: 89807
Project: 89807
Buggy source:
/** 
 * Forward the message to ALL_BA.
 * @param msg the message to forward.
 */
public void removeAndGetFile(RemoveAndGetFileMessage msg){
  ArgumentNotValid.checkNotNull(msg,"String_Node_Str");
  con.resend(msg,this.allBa);
}

Fixed version (ground truth):
/** 
 * Forward the message to ALL_BA.
 * @param msg the message to forward.
 */
public void removeAndGetFile(RemoveAndGetFileMessage msg){
  ArgumentNotValid.checkNotNull(msg,"String_Node_Str");
  jmsCon.resend(msg,this.allBa);
}
Program: 89808
Project: 89808
Buggy source:
/** 
 * Submit an upload request to the bitarchive.
 * @param rf The file to upload.
 * @throws IOFailure If access to file denied.
 * @throws ArgumentNotValid If arcfile is null.
 */
public void upload(RemoteFile rf) throws IOFailure, ArgumentNotValid {
  ArgumentNotValid.checkNotNull(rf,"String_Node_Str");
  UploadMessage up=new UploadMessage(anyBa,clientId,rf);
  log.debug("String_Node_Str" + up.toString());
  con.send(up);
}

Fixed version (ground truth):
/** 
 * Submit an upload request to the bitarchive.
 * @param rf The file to upload.
 * @throws IOFailure If access to file denied.
 * @throws ArgumentNotValid If arcfile is null.
 */
public void upload(RemoteFile rf) throws IOFailure, ArgumentNotValid {
  ArgumentNotValid.checkNotNull(rf,"String_Node_Str");
  UploadMessage up=new UploadMessage(anyBa,clientId,rf);
  log.debug("String_Node_Str" + up.toString());
  jmsCon.send(up);
}
Program: 89809
Project: 89809
Buggy source:
/** 
 * Submit a batch job to the archive. This is used by the ArcRepository when it needs to run batch jobs for its own reasons, i.e. when checksumming a file as part of the Store operation.
 * @param replyChannel The channel that the reply of this job should be sent to.
 * @param job The job that should be run on the bit archive handled by thisclient.
 * @return The submitted message.
 * @throws ArgumentNotValid If any parameter was null.
 * @throws IOFailure If sending the batch message did not succeed.
 */
public BatchMessage batch(ChannelID replyChannel,FileBatchJob job) throws ArgumentNotValid, IOFailure {
  ArgumentNotValid.checkNotNull(replyChannel,"String_Node_Str");
  ArgumentNotValid.checkNotNull(job,"String_Node_Str");
  BatchMessage bMsg=new BatchMessage(this.theBamon,replyChannel,job,"String_Node_Str" + "String_Node_Str");
  con.send(bMsg);
  return bMsg;
}

Fixed version (ground truth):
/** 
 * Submit a batch job to the archive. This is used by the ArcRepository when it needs to run batch jobs for its own reasons, i.e. when checksumming a file as part of the Store operation.
 * @param replyChannel The channel that the reply of this job should be sent to.
 * @param job The job that should be run on the bit archive handled by thisclient.
 * @return The submitted message.
 * @throws ArgumentNotValid If any parameter was null.
 * @throws IOFailure If sending the batch message did not succeed.
 */
public BatchMessage batch(ChannelID replyChannel,FileBatchJob job) throws ArgumentNotValid, IOFailure {
  ArgumentNotValid.checkNotNull(replyChannel,"String_Node_Str");
  ArgumentNotValid.checkNotNull(job,"String_Node_Str");
  BatchMessage bMsg=new BatchMessage(this.theBamon,replyChannel,job,"String_Node_Str" + "String_Node_Str");
  jmsCon.send(bMsg);
  return bMsg;
}
Program: 89810
Project: 89810
Buggy source:
/** 
 * Establish the connection to the server.
 * @param allBaIn topic to all bitarchives
 * @param anyBaIn queue to one of the bitarchives
 * @param theBamonIn queue to the bitarchive monitor
 * @throws IOFailure If there is a problem making the connection.
 */
private BitarchiveClient(ChannelID allBaIn,ChannelID anyBaIn,ChannelID theBamonIn) throws IOFailure {
  this.allBa=allBaIn;
  this.anyBa=anyBaIn;
  this.theBamon=theBamonIn;
  con=JMSConnectionFactory.getInstance();
}

Fixed version (ground truth):
/** 
 * Establish the connection to the server.
 * @param allBaIn topic to all bitarchives
 * @param anyBaIn queue to one of the bitarchives
 * @param theBamonIn queue to the bitarchive monitor
 * @throws IOFailure If there is a problem making the connection.
 */
private BitarchiveClient(ChannelID allBaIn,ChannelID anyBaIn,ChannelID theBamonIn) throws IOFailure {
  this.allBa=allBaIn;
  this.anyBa=anyBaIn;
  this.theBamon=theBamonIn;
  jmsCon=JMSConnectionFactory.getInstance();
}