nus-yam/ex-repair huggingface dataset:
Program: 89511
Project: 89511
Buggy source:
public Heritrix3JobMonitor getRunningH3Job(long jobId){
  Heritrix3JobMonitor h3Job;
synchronized (runningJobMonitorMap) {
    h3Job=runningJobMonitorMap.get(jobId);
    LOG.debug("String_Node_Str" + runningJobMonitorMap.hashCode());
  }
  return h3Job;
}

Fixed version (ground truth):
public Heritrix3JobMonitor getRunningH3Job(long jobId){
  Heritrix3JobMonitor h3Job;
synchronized (runningJobMonitorMap) {
    h3Job=runningJobMonitorMap.get(jobId);
    LOG.debug("String_Node_Str" + runningJobMonitorMap.hashCode(),runningJobMonitorMap.hashCode());
  }
  return h3Job;
}
Program: 89513
Project: 89513
Buggy source:
public Heritrix3JobMonitor getRunningH3Job(long jobId){
  Heritrix3JobMonitor h3Job;
synchronized (runningJobMonitorMap) {
    h3Job=runningJobMonitorMap.get(jobId);
    LOG.debug("String_Node_Str",runningJobMonitorMap.hashCode());
  }
  return h3Job;
}

Fixed version (ground truth):
public Heritrix3JobMonitor getRunningH3Job(long jobId){
  Heritrix3JobMonitor h3Job;
synchronized (runningJobMonitorMap) {
    h3Job=runningJobMonitorMap.get(jobId);
    LOG.debug("String_Node_Str" + runningJobMonitorMap.hashCode());
  }
  return h3Job;
}
Program: 89515
Project: 89515
Buggy source:
public Heritrix3JobMonitor getRunningH3Job(long jobId){
  Heritrix3JobMonitor h3Job;
synchronized (runningJobMonitorMap) {
    h3Job=runningJobMonitorMap.get(jobId);
    LOG.debug("String_Node_Str" + runningJobMonitorMap.hashCode(),runningJobMonitorMap.hashCode());
  }
  return h3Job;
}

Fixed version (ground truth):
public Heritrix3JobMonitor getRunningH3Job(long jobId){
  Heritrix3JobMonitor h3Job;
synchronized (runningJobMonitorMap) {
    h3Job=runningJobMonitorMap.get(jobId);
    LOG.debug("String_Node_Str",runningJobMonitorMap.hashCode());
  }
  return h3Job;
}
Program: 89517
Project: 89517
Buggy source:
public List<Heritrix3JobMonitor> getRunningH3Jobs(){
  List<Heritrix3JobMonitor> h3JobsList=new LinkedList<Heritrix3JobMonitor>();
synchronized (runningJobMonitorMap) {
    h3JobsList.addAll(runningJobMonitorMap.values());
  }
  return h3JobsList;
}

Fixed version (ground truth):
public List<Heritrix3JobMonitor> getRunningH3Jobs(){
  List<Heritrix3JobMonitor> h3JobsList=new LinkedList<Heritrix3JobMonitor>();
synchronized (runningJobMonitorMapSynchronizer) {
    h3JobsList.addAll(runningJobMonitorMap.values());
  }
  return h3JobsList;
}
Program: 89518
Project: 89518
Buggy source:
public Heritrix3JobMonitor getRunningH3Job(long jobId){
  Heritrix3JobMonitor h3Job;
synchronized (runningJobMonitorMap) {
    h3Job=runningJobMonitorMap.get(jobId);
    LOG.debug("String_Node_Str",runningJobMonitorMap.hashCode());
  }
  return h3Job;
}

Fixed version (ground truth):
public Heritrix3JobMonitor getRunningH3Job(long jobId){
  Heritrix3JobMonitor h3Job;
synchronized (runningJobMonitorMapSynchronizer) {
    h3Job=runningJobMonitorMap.get(jobId);
    LOG.debug("String_Node_Str",runningJobMonitorMap.hashCode());
  }
  return h3Job;
}
Program: 89519
Project: 89519
Buggy source:
@Test public void DSIABLED_testChecksumCalls() throws Exception {
  ArcRepository.getInstance().cleanup();
  Settings.set(CommonSettings.USE_REPLICA_ID,"String_Node_Str");
  DISABLED_testOnBatchReply();
}

Fixed version (ground truth):
public void DSIABLED_testChecksumCalls() throws Exception {
  ArcRepository.getInstance().cleanup();
  Settings.set(CommonSettings.USE_REPLICA_ID,"String_Node_Str");
  DISABLED_testOnBatchReply();
}
Program: 89521
Project: 89521
Buggy source:
/** 
 * Return the directory name of this site section.
 * @return The dirname.
 */
public String getDirname(){
  return dirname;
}

Fixed version (ground truth):
/** 
 * Return the directory name of this site section.
 * @return The dirname.
 */
public String getDirname(){
}
Program: 89524
Project: 89524
Buggy source:
/** 
 * Create a new history SiteSection object.
 */
public HistorySiteSection(){
  super("String_Node_Str","String_Node_Str",2,new String[][]{{"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"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"}},"String_Node_Str",dk.netarkivet.harvester.Constants.TRANSLATIONS_BUNDLE);
}

Fixed version (ground truth):
/** 
 * Create a new history SiteSection object.
 */
public HistorySiteSection(){
  super("String_Node_Str","String_Node_Str",3,new String[][]{{"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"},{"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",dk.netarkivet.harvester.Constants.TRANSLATIONS_BUNDLE);
}
Program: 89526
Project: 89526
Buggy source:
/** 
 * Return a key for queue names based on domain names (last two parts of host name) or IP address.  They key may include a #<portnr> at the end.
 * @param cauri A potential URI.
 * @return a class key (really an arbitrary string), one of <domainOrIP>,<domainOrIP>#<port>, or "default...".
 * @see HostnameQueueAssignmentPolicy#getClassKey(CrawlURI)
 */
public String getClassKey(CrawlURI cauri){
  String candidate;
  boolean ignoreSourceSeed=cauri != null && cauri.getCanonicalString().startsWith("String_Node_Str");
  try {
    candidate=super.getClassKey(cauri);
  }
 catch (  NullPointerException e) {
    log.debug("String_Node_Str" + cauri);
    candidate=DEFAULT_CLASS_KEY;
  }
  String sourceSeedCandidate=null;
  if (!ignoreSourceSeed) {
    sourceSeedCandidate=getCandidateFromSource(cauri);
  }
  if (sourceSeedCandidate != null) {
    return sourceSeedCandidate;
  }
 else {
    String[] hostnameandportnr=candidate.split("String_Node_Str");
    if (hostnameandportnr.length == 0 || hostnameandportnr.length > 2) {
      return candidate;
    }
    String domainName=DomainUtils.domainNameFromHostname(hostnameandportnr[0]);
    if (domainName == null) {
      log.debug("String_Node_Str" + candidate + "String_Node_Str"+ cauri+ "String_Node_Str");
      return candidate;
    }
    return domainName;
  }
}

Fixed version (ground truth):
/** 
 * Return a key for queue names based on domain names (last two parts of host name) or IP address.  They key may include a #<portnr> at the end.
 * @param cauri A potential URI.
 * @return a class key (really an arbitrary string), one of <domainOrIP>,<domainOrIP>#<port>, or "default...".
 * @see HostnameQueueAssignmentPolicy#getClassKey(CrawlURI)
 */
public String getClassKey(CrawlURI cauri){
  String candidate;
  boolean ignoreSourceSeed=cauri != null;
  try {
    candidate=super.getClassKey(cauri);
  }
 catch (  NullPointerException e) {
    log.debug("String_Node_Str" + cauri);
    candidate=DEFAULT_CLASS_KEY;
  }
  String sourceSeedCandidate=null;
  if (!ignoreSourceSeed) {
    sourceSeedCandidate=getCandidateFromSource(cauri);
  }
  if (sourceSeedCandidate != null) {
    return sourceSeedCandidate;
  }
 else {
    String[] hostnameandportnr=candidate.split("String_Node_Str");
    if (hostnameandportnr.length == 0 || hostnameandportnr.length > 2) {
      return candidate;
    }
    String domainName=DomainUtils.domainNameFromHostname(hostnameandportnr[0]);
    if (domainName == null) {
      log.debug("String_Node_Str" + candidate + "String_Node_Str"+ cauri+ "String_Node_Str");
      return candidate;
    }
    return domainName;
  }
}
Program: 89527
Project: 89527
Buggy source:
/** 
 * Find a candidate from the source.
 * @param cauri A potential URI
 * @return a candidate from the source or null if none found
 */
private String getCandidateFromSource(CrawlURI cauri){
  String sourceCandidate=null;
  try {
    sourceCandidate=cauri.getSourceTag();
  }
 catch (  NoSuchElementException e) {
    log.warn("String_Node_Str");
    return null;
  }
  String hostname=null;
  try {
    hostname=UURIFactory.getInstance(sourceCandidate).getHost();
  }
 catch (  URIException e) {
    log.warn("String_Node_Str" + sourceCandidate);
    return null;
  }
  return DomainUtils.domainNameFromHostname(hostname);
}

Fixed version (ground truth):
/** 
 * Find a candidate from the source.
 * @param cauri A potential URI
 * @return a candidate from the source or null if none found
 */
private String getCandidateFromSource(CrawlURI cauri){
  String sourceCandidate=null;
  try {
    sourceCandidate=cauri.getSourceTag();
  }
 catch (  NoSuchElementException e) {
    log.warn("String_Node_Str");
    return null;
  }
  String hostname=null;
  try {
    hostname=UURIFactory.getInstance(sourceCandidate).getHost();
  }
 catch (  URIException e) {
    log.warn("String_Node_Str" + sourceCandidate);
    return null;
  }
  String candidateKey=DomainUtils.domainNameFromHostname(hostname);
  return candidateKey;
}
Program: 89529
Project: 89529
Buggy source:
/** 
 * Constructs the single metadata arc file from the crawlDir and the jobID.
 * @return metadata arc file as a File
 */
protected File getMetadataFile(){
  return new File(getMetadataDir(),MetadataFileWriter.getMetadataArchiveFileName(Long.toString(jobId)));
}

Fixed version (ground truth):
/** 
 * Constructs the single metadata arc file from the crawlDir and the jobID.
 * @return metadata arc file as a File
 */
protected File getMetadataFile(){
  return new File(getMetadataDir(),MetadataFileWriter.getMetadataArchiveFileName(Long.toString(jobId),harvestId));
}
Program: 89530
Project: 89530
Buggy source:
/** 
 * Constructs the TEMPORARY metadata arc file from the crawlDir and the jobID.
 * @return tmp-metadata arc file as a File
 */
private File getTmpMetadataFile(){
  return new File(getTmpMetadataDir(),MetadataFileWriter.getMetadataArchiveFileName(Long.toString(jobId)));
}

Fixed version (ground truth):
/** 
 * Constructs the TEMPORARY metadata arc file from the crawlDir and the jobID.
 * @return tmp-metadata arc file as a File
 */
private File getTmpMetadataFile(){
  return new File(getTmpMetadataDir(),MetadataFileWriter.getMetadataArchiveFileName(Long.toString(jobId),harvestId));
}
Program: 89531
Project: 89531
Buggy source:
/** 
 * @param name Name of this writer.
 */
public WARCWriterProcessor(final String name){
  super(name,"String_Node_Str");
  Type e=addElementToDefinition(new SimpleType(ATTR_WRITE_REQUESTS,"String_Node_Str",new Boolean(true)));
  e.setOverrideable(true);
  e.setExpertSetting(true);
  e=addElementToDefinition(new SimpleType(ATTR_WRITE_METADATA,"String_Node_Str",new Boolean(true)));
  e=addElementToDefinition(new SimpleType(ATTR_WRITE_METADATA_OUTLINKS,"String_Node_Str",new Boolean(true)));
  e.setOverrideable(true);
  e.setExpertSetting(true);
  e=addElementToDefinition(new SimpleType(ATTR_WRITE_REVISIT_FOR_IDENTICAL_DIGESTS,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",new Boolean(true)));
  e.setOverrideable(true);
  e.setExpertSetting(true);
  e=addElementToDefinition(new SimpleType(ATTR_WRITE_REVISIT_FOR_NOT_MODIFIED,"String_Node_Str" + "String_Node_Str",new Boolean(true)));
  e.setOverrideable(true);
  e.setExpertSetting(true);
  e=addElementToDefinition(new MapType(ATTR_METADATA_ITEMS,"String_Node_Str",String.class));
  e.setOverrideable(true);
  e.setExpertSetting(true);
}

Fixed version (ground truth):
/** 
 * @param name Name of this writer.
 */
public WARCWriterProcessor(final String name){
  super(name,"String_Node_Str");
  Type e=addElementToDefinition(new SimpleType(ATTR_WRITE_REQUESTS,"String_Node_Str",new Boolean(true)));
  e.setOverrideable(true);
  e.setExpertSetting(true);
  e=addElementToDefinition(new SimpleType(ATTR_WRITE_METADATA,"String_Node_Str",new Boolean(true)));
  e.setOverrideable(true);
  e.setExpertSetting(true);
  e=addElementToDefinition(new SimpleType(ATTR_WRITE_METADATA_OUTLINKS,"String_Node_Str",new Boolean(true)));
  e.setOverrideable(true);
  e.setExpertSetting(true);
  e=addElementToDefinition(new SimpleType(ATTR_WRITE_REVISIT_FOR_IDENTICAL_DIGESTS,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",new Boolean(true)));
  e.setOverrideable(true);
  e.setExpertSetting(true);
  e=addElementToDefinition(new SimpleType(ATTR_WRITE_REVISIT_FOR_NOT_MODIFIED,"String_Node_Str" + "String_Node_Str",new Boolean(true)));
  e.setOverrideable(true);
  e.setExpertSetting(true);
  e=addElementToDefinition(new MapType(ATTR_METADATA_ITEMS,"String_Node_Str",String.class));
  e.setOverrideable(true);
  e.setExpertSetting(true);
}
Program: 89532
Project: 89532
Buggy source:
/** 
 * Constructs the single metadata arc file from the crawlDir and the jobID.
 * @return metadata arc file as a File
 */
protected File getMetadataFile(){
  return new File(getMetadataDir(),MetadataFileWriter.getMetadataArchiveFileName(Long.toString(jobId)));
}

Fixed version (ground truth):
/** 
 * Constructs the single metadata arc file from the crawlDir and the jobID.
 * @return metadata arc file as a File
 */
protected File getMetadataFile(){
  return new File(getMetadataDir(),MetadataFileWriter.getMetadataArchiveFileName(Long.toString(jobId),harvestId));
}
Program: 89533
Project: 89533
Buggy source:
/** 
 * Constructs the TEMPORARY metadata arc file from the crawlDir and the jobID.
 * @return tmp-metadata arc file as a File
 */
private File getTmpMetadataFile(){
  return new File(getTmpMetadataDir(),MetadataFileWriter.getMetadataArchiveFileName(Long.toString(jobId)));
}

Fixed version (ground truth):
/** 
 * Constructs the TEMPORARY metadata arc file from the crawlDir and the jobID.
 * @return tmp-metadata arc file as a File
 */
private File getTmpMetadataFile(){
  return new File(getTmpMetadataDir(),MetadataFileWriter.getMetadataArchiveFileName(Long.toString(jobId),harvestId));
}
Program: 89536
Project: 89536
Buggy source:
protected URI writeMetadata(final WARCWriter w,final String timestamp,final URI baseid,final CrawlURI curi,final ANVLRecord namedFields) throws IOException {
  final URI uid=qualifyRecordID(baseid,TYPE,METADATA);
  ANVLRecord r=new ANVLRecord();
  if (curi.isSeed()) {
    r.addLabel("String_Node_Str");
  }
 else {
    if (curi.forceFetch()) {
      r.addLabel("String_Node_Str");
    }
    r.addLabelValue("String_Node_Str",curi.flattenVia());
    r.addLabelValue("String_Node_Str",curi.getPathFromSeed());
    if (curi.containsKey(A_SOURCE_TAG)) {
      r.addLabelValue("String_Node_Str",curi.getString(A_SOURCE_TAG));
    }
  }
  long duration=curi.getFetchDuration();
  if (duration > -1) {
    r.addLabelValue("String_Node_Str",Long.toString(duration));
  }
  if (curi.containsKey(A_FTP_FETCH_STATUS)) {
    r.addLabelValue("String_Node_Str",curi.getString(A_FTP_FETCH_STATUS));
  }
  Collection<Link> links=curi.getOutLinks();
  if (links != null && links.size() > 0) {
    for (    Link link : links) {
      r.addLabelValue("String_Node_Str",link.toString());
    }
  }
  byte[] b=r.getUTF8Bytes();
  w.writeMetadataRecord(curi.toString(),timestamp,ANVLRecord.MIMETYPE,uid,namedFields,new ByteArrayInputStream(b),b.length);
  return uid;
}

Fixed version (ground truth):
protected URI writeMetadata(final WARCWriter w,final String timestamp,final URI baseid,final CrawlURI curi,final ANVLRecord namedFields,final boolean writeMetadataOutlinks) throws IOException {
  final URI uid=qualifyRecordID(baseid,TYPE,METADATA);
  ANVLRecord r=new ANVLRecord();
  if (curi.isSeed()) {
    r.addLabel("String_Node_Str");
  }
 else {
    if (curi.forceFetch()) {
      r.addLabel("String_Node_Str");
    }
    r.addLabelValue("String_Node_Str",curi.flattenVia());
    r.addLabelValue("String_Node_Str",curi.getPathFromSeed());
    if (curi.containsKey(A_SOURCE_TAG)) {
      r.addLabelValue("String_Node_Str",curi.getString(A_SOURCE_TAG));
    }
  }
  long duration=curi.getFetchDuration();
  if (duration > -1) {
    r.addLabelValue("String_Node_Str",Long.toString(duration));
  }
  if (curi.containsKey(A_FTP_FETCH_STATUS)) {
    r.addLabelValue("String_Node_Str",curi.getString(A_FTP_FETCH_STATUS));
  }
  if (writeMetadataOutlinks == true) {
    Collection<Link> links=curi.getOutLinks();
    if (links != null && links.size() > 0) {
      for (      Link link : links) {
        r.addLabelValue("String_Node_Str",link.toString());
      }
    }
  }
  byte[] b=r.getUTF8Bytes();
  w.writeMetadataRecord(curi.toString(),timestamp,ANVLRecord.MIMETYPE,uid,namedFields,new ByteArrayInputStream(b),b.length);
  return uid;
}
Program: 89538
Project: 89538
Buggy source:
/** 
 * @param name Name of this writer.
 */
public WARCWriterProcessor(final String name){
  super(name,"String_Node_Str");
  Type e=addElementToDefinition(new SimpleType(ATTR_WRITE_REQUESTS,"String_Node_Str",new Boolean(true)));
  e.setOverrideable(true);
  e.setExpertSetting(true);
  e=addElementToDefinition(new SimpleType(ATTR_WRITE_METADATA,"String_Node_Str",new Boolean(true)));
  e.setOverrideable(true);
  e.setExpertSetting(true);
  e=addElementToDefinition(new SimpleType(ATTR_WRITE_REVISIT_FOR_IDENTICAL_DIGESTS,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",new Boolean(true)));
  e.setOverrideable(true);
  e.setExpertSetting(true);
  e=addElementToDefinition(new SimpleType(ATTR_WRITE_REVISIT_FOR_NOT_MODIFIED,"String_Node_Str" + "String_Node_Str",new Boolean(true)));
  e.setOverrideable(true);
  e.setExpertSetting(true);
  e=addElementToDefinition(new MapType(ATTR_METADATA_ITEMS,"String_Node_Str",String.class));
  e.setOverrideable(true);
  e.setExpertSetting(true);
}

Fixed version (ground truth):
/** 
 * @param name Name of this writer.
 */
public WARCWriterProcessor(final String name){
  super(name,"String_Node_Str");
  Type e=addElementToDefinition(new SimpleType(ATTR_WRITE_REQUESTS,"String_Node_Str",new Boolean(true)));
  e.setOverrideable(true);
  e.setExpertSetting(true);
  e=addElementToDefinition(new SimpleType(ATTR_WRITE_METADATA,"String_Node_Str",new Boolean(true)));
  e=addElementToDefinition(new SimpleType(ATTR_WRITE_METADATA_OUTLINKS,"String_Node_Str",new Boolean(true)));
  e.setOverrideable(true);
  e.setExpertSetting(true);
  e=addElementToDefinition(new SimpleType(ATTR_WRITE_REVISIT_FOR_IDENTICAL_DIGESTS,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",new Boolean(true)));
  e.setOverrideable(true);
  e.setExpertSetting(true);
  e=addElementToDefinition(new SimpleType(ATTR_WRITE_REVISIT_FOR_NOT_MODIFIED,"String_Node_Str" + "String_Node_Str",new Boolean(true)));
  e.setOverrideable(true);
  e.setExpertSetting(true);
  e=addElementToDefinition(new MapType(ATTR_METADATA_ITEMS,"String_Node_Str",String.class));
  e.setOverrideable(true);
  e.setExpertSetting(true);
}
Program: 89539
Project: 89539
Buggy source:
private String knownJobsToString(EngineResult engineResult){
  String result=null;
  if (engineResult == null || engineResult.engine == null || engineResult.engine.jobs == null) {
    result=null;
  }
 else {
    List<JobShort> knownjobs=engineResult.engine.jobs;
    for (    JobShort js : knownjobs) {
      result+=js.shortName + "String_Node_Str";
    }
  }
  return result;
}

Fixed version (ground truth):
private String knownJobsToString(EngineResult engineResult){
  String result="String_Node_Str";
  if (engineResult == null || engineResult.engine == null || engineResult.engine.jobs == null) {
    result=null;
  }
 else {
    List<JobShort> knownjobs=engineResult.engine.jobs;
    for (    JobShort js : knownjobs) {
      result+=js.shortName + "String_Node_Str";
    }
  }
  return result;
}
Program: 89542
Project: 89542
Buggy source:
/** 
 * Get the login name for accessing the Heritrix GUI. This name can be set in the settings.xml file.
 * @return Name to use for accessing Heritrix web GUI
 */
protected String getHeritrixAdminName(){
  return Settings.get(Heritrix3Settings.HERITRIX_ADMIN_NAME);
}

Fixed version (ground truth):
/** 
 * Get the login name for accessing the Heritrix3 GUI. This name can be set in the settings.xml file.
 * @return Name to use for accessing Heritrix3 web GUI
 */
protected String getHeritrixAdminName(){
  return Settings.get(Heritrix3Settings.HERITRIX_ADMIN_NAME);
}
Program: 89543
Project: 89543
Buggy source:
@Override public void exitValue(int exitValue){
  semaphore.release();
  log.info("String_Node_Str",exitValue);
}

Fixed version (ground truth):
@Override public void exitValue(int exitValue){
  semaphore.release();
  if (exitValue != 0) {
    log.error("String_Node_Str",exitValue);
  }
 else {
    log.info("String_Node_Str",exitValue);
  }
}
Program: 89544
Project: 89544
Buggy source:
/** 
 * @return the HTTP port used by the Heritrix GUI.
 */
protected int getGuiPort(){
  return guiPort;
}

Fixed version (ground truth):
/** 
 * @return the HTTP port used by the Heritrix3 GUI.
 */
protected int getGuiPort(){
  return guiPort;
}
Program: 89545
Project: 89545
Buggy source:
/** 
 * Get the login password for accessing the Heritrix GUI. This password can be set in the settings.xml file.
 * @return Password to use for accessing the Heritrix GUI
 */
protected String getHeritrixAdminPassword(){
  return Settings.get(Heritrix3Settings.HERITRIX_ADMIN_PASSWORD);
}

Fixed version (ground truth):
/** 
 * Get the login password for accessing the Heritrix3 GUI. This password can be set in the settings.xml file.
 * @return Password to use for accessing the Heritrix3 GUI
 */
protected String getHeritrixAdminPassword(){
  return Settings.get(Heritrix3Settings.HERITRIX_ADMIN_PASSWORD);
}
Program: 89546
Project: 89546
Buggy source:
/** 
 * @return the Heritrix files wrapper.
 */
protected Heritrix3Files getHeritrixFiles(){
  return files;
}

Fixed version (ground truth):
/** 
 * @return the Heritrix3 files wrapper.
 */
protected Heritrix3Files getHeritrixFiles(){
  return files;
}
Program: 89548
Project: 89548
Buggy source:
/** 
 * Test a BatchMessage is sent to the_bamon queue.
 */
@Test public void testVisitBatchMessage(){
  DummyServer serverTheBamonQueue=new DummyServer();
  serverTheBamonQueue.reset();
  con.setListener(Channels.getTheBamon(),serverTheBamonQueue);
  ArcRepository arc=ArcRepository.getInstance();
  BatchMessage msg=new BatchMessage(Channels.getTheBamon(),Channels.getError(),new TestBatchJobRuns(),Settings.get(CommonSettings.USE_REPLICA_ID));
  new ArcRepositoryServer(arc).visit(msg);
  ((JMSConnectionMockupMQ)con).waitForConcurrentTasksToFinish();
  assertEquals("String_Node_Str",1,serverTheBamonQueue.msgReceived);
  arc.close();
}

Fixed version (ground truth):
/** 
 * Test a BatchMessage is sent to the_bamon queue.
 */
public void testVisitBatchMessage(){
  DummyServer serverTheBamonQueue=new DummyServer();
  serverTheBamonQueue.reset();
  con.setListener(Channels.getTheBamon(),serverTheBamonQueue);
  ArcRepository arc=ArcRepository.getInstance();
  BatchMessage msg=new BatchMessage(Channels.getTheBamon(),Channels.getError(),new TestBatchJobRuns(),Settings.get(CommonSettings.USE_REPLICA_ID));
  new ArcRepositoryServer(arc).visit(msg);
  ((JMSConnectionMockupMQ)con).waitForConcurrentTasksToFinish();
  assertEquals("String_Node_Str",1,serverTheBamonQueue.msgReceived);
  arc.close();
}
Program: 89549
Project: 89549
Buggy source:
/** 
 * Test message is resent.
 */
@Test public void testGet(){
  file=new File(BITARCHIVE_DIR,STORABLE_FILES.get(0).toString());
  GetMessage msg=new GetMessage(Channels.getTheRepos(),Channels.getError(),"String_Node_Str",0);
  JMSConnectionMockupMQ testCon=(JMSConnectionMockupMQ)JMSConnectionMockupMQ.getInstance();
  TestMessageListener listener=new TestMessageListener();
  testCon.setListener(Channels.getAllBa(),listener);
  ArcRepositoryServer arc=new ArcRepositoryServer(ArcRepository.getInstance());
  arc.visit(msg);
  testCon.waitForConcurrentTasksToFinish();
  assertEquals("String_Node_Str",1,listener.getNumReceived());
  arc.close();
}

Fixed version (ground truth):
/** 
 * Test message is resent.
 */
public void testGet(){
  file=new File(BITARCHIVE_DIR,STORABLE_FILES.get(0).toString());
  GetMessage msg=new GetMessage(Channels.getTheRepos(),Channels.getError(),"String_Node_Str",0);
  JMSConnectionMockupMQ testCon=(JMSConnectionMockupMQ)JMSConnectionMockupMQ.getInstance();
  TestMessageListener listener=new TestMessageListener();
  testCon.setListener(Channels.getAllBa(),listener);
  ArcRepositoryServer arc=new ArcRepositoryServer(ArcRepository.getInstance());
  arc.visit(msg);
  testCon.waitForConcurrentTasksToFinish();
  assertEquals("String_Node_Str",1,listener.getNumReceived());
  arc.close();
}
Program: 89551
Project: 89551
Buggy source:
/** 
 * Initialise options by setting legal parameters for batch jobs.
 */
ArgumentParameters(){
  options.addOption(Constants.ARG_CONFIG_FILE,HAS_ARG,"String_Node_Str");
  options.addOption(Constants.ARG_NETARCHIVE_SUITE_FILE,HAS_ARG,"String_Node_Str");
  options.addOption(Constants.ARG_SECURITY_FILE,HAS_ARG,"String_Node_Str");
  options.addOption(Constants.ARG_SLF4J_CONFIG_FILE,HAS_ARG,"String_Node_Str");
  options.addOption(Constants.ARG_OUTPUT_DIRECTORY,HAS_ARG,"String_Node_Str");
  options.addOption(Constants.ARG_DATABASE_FILE,HAS_ARG,"String_Node_Str");
  options.addOption(Constants.ARG_TEST,HAS_ARG,"String_Node_Str" + "String_Node_Str");
  options.addOption(Constants.ARG_RESET,HAS_ARG,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  options.addOption(Constants.ARG_EVALUATE,HAS_ARG,"String_Node_Str");
  options.addOption(Constants.ARG_ARC_DB,HAS_ARG,"String_Node_Str");
  options.addOption(Constants.ARG_JAR_FOLDER,HAS_ARG,"String_Node_Str" + "String_Node_Str");
  options.addOption(Constants.ARG_SOURCE_ENCODING,HAS_ARG,"String_Node_Str");
  options.addOption(Constants.ARG_DEFAULT_BUNDLER_ZIP,HAS_ARG,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Initialise options by setting legal parameters for batch jobs.
 */
ArgumentParameters(){
  options.addOption(Constants.ARG_CONFIG_FILE,HAS_ARG,"String_Node_Str");
  options.addOption(Constants.ARG_NETARCHIVE_SUITE_FILE,HAS_ARG,"String_Node_Str");
  options.addOption(Constants.ARG_SECURITY_FILE,HAS_ARG,"String_Node_Str");
  options.addOption(Constants.ARG_SLF4J_CONFIG_FILE,HAS_ARG,"String_Node_Str");
  options.addOption(Constants.ARG_OUTPUT_DIRECTORY,HAS_ARG,"String_Node_Str");
  options.addOption(Constants.ARG_DATABASE_FILE,HAS_ARG,"String_Node_Str");
  options.addOption(Constants.ARG_TEST,HAS_ARG,"String_Node_Str" + "String_Node_Str");
  options.addOption(Constants.ARG_RESET,HAS_ARG,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
  options.addOption(Constants.ARG_EVALUATE,HAS_ARG,"String_Node_Str");
  options.addOption(Constants.ARG_ARC_DB,HAS_ARG,"String_Node_Str");
  options.addOption(Constants.ARG_JAR_FOLDER,HAS_ARG,"String_Node_Str" + "String_Node_Str");
  options.addOption(Constants.ARG_SOURCE_ENCODING,HAS_ARG,"String_Node_Str");
  options.addOption(Constants.ARG_DEFAULT_BUNDLER_ZIP,HAS_ARG,"String_Node_Str" + "String_Node_Str");
}
Program: 89553
Project: 89553
Buggy source:
/** 
 * Will create a NodeTraverser for accessing the indicated node. If the current node does existes it will be created.
 * @param element The tag for the element to make available, eg. <crawl-order>.....
 * @param name A optional name attribute to add to the element if created.
 * @return The NodeTraverser reference, which can be used to create further child nodes.
 */
public NodeTraverser getChildNode(String element,String name){
  Node childNode=null;
  NodeList nodes=currentNode.getChildNodes();
  if (nodes != null) {
    for (int i=0; i < nodes.getLength(); i++) {
      Node node=nodes.item(i);
      if ((name == null || name.equals(node.getNodeName())) && element.equals(node.getAttributes().getNamedItem("String_Node_Str"))) {
        childNode=node;
        break;
      }
    }
  }
  if (childNode == null) {
    Element newNode=doc.createElement(element);
    if (name != null) {
      newNode.setAttribute("String_Node_Str",name);
    }
    currentNode.appendChild(newNode);
    childNode=newNode;
  }
  currentNode=childNode;
  return this;
}

Fixed version (ground truth):
/** 
 * Will create a NodeTraverser for accessing the indicated node. If the current node does exist it will be created.
 * @param element The tag for the element to make available, eg. <crawl-order>.....
 * @param name A optional name attribute to add to the element if created.
 * @return The NodeTraverser reference, which can be used to create further child nodes.
 */
public NodeTraverser getChildNode(String element,String name){
  Node childNode=null;
  NodeList nodes=currentNode.getChildNodes();
  if (nodes != null) {
    for (int i=0; i < nodes.getLength(); i++) {
      Node node=nodes.item(i);
      NamedNodeMap attributes=node.getAttributes();
      String nameAttr=null;
      if (attributes != null) {
        Node attrNode=attributes.getNamedItem("String_Node_Str");
        if (attrNode != null && attrNode.getNodeType() == Node.ATTRIBUTE_NODE) {
          nameAttr=attrNode.getNodeValue();
        }
      }
      if (element.equals(node.getNodeName()) && (name == null || name.equals(nameAttr))) {
        childNode=node;
        break;
      }
    }
  }
  if (childNode == null) {
    Element newNode=doc.createElement(element);
    if (name != null) {
      newNode.setAttribute("String_Node_Str",name);
    }
    currentNode.appendChild(newNode);
    childNode=newNode;
  }
  currentNode=childNode;
  return this;
}
Program: 89554
Project: 89554
Buggy source:
/** 
 * Simple test of new job submitting.
 */
@Test public void testSubmitNewJobs() throws DocumentException {
  prepareDefaultMockAnswers(SELECTIVE_HARVEST_CHANNEL,jobMock);
  jobDispatcher.submitNextNewJob(SELECTIVE_HARVEST_CHANNEL);
  verify(jobMock).setStatus(JobStatus.SUBMITTED);
  verify(jobMock).setSubmittedDate(any(Date.class));
  verify(jobDAO).update(jobMock);
  verify(jmsConnection).send(crawlMessageCaptor.capture());
  assertTrue(jobMock == crawlMessageCaptor.getValue().getJob());
  assertEquals(HarvesterChannels.getHarvestJobChannelId(SELECTIVE_HARVEST_CHANNEL),crawlMessageCaptor.getValue().getTo());
  assertEquals(harvest.getName(),crawlMessageCaptor.getValue().getOrigHarvestInfo().getOrigHarvestName());
}

Fixed version (ground truth):
/** 
 * Simple test of new job submitting.
 */
@Test public void testSubmitNewJobs() throws DocumentException {
  prepareDefaultMockAnswers(SELECTIVE_HARVEST_CHANNEL,jobMock,false);
  jobDispatcher.submitNextNewJob(SELECTIVE_HARVEST_CHANNEL);
  verify(jobMock).setStatus(JobStatus.SUBMITTED);
  verify(jobMock).setSubmittedDate(any(Date.class));
  verify(jobDAO).update(jobMock);
  verify(jmsConnection).send(crawlMessageCaptor.capture());
  assertTrue(jobMock == crawlMessageCaptor.getValue().getJob());
  assertEquals(HarvesterChannels.getHarvestJobChannelId(SELECTIVE_HARVEST_CHANNEL),crawlMessageCaptor.getValue().getTo());
  assertEquals(harvest.getName(),crawlMessageCaptor.getValue().getOrigHarvestInfo().getOrigHarvestName());
}
Program: 89555
Project: 89555
Buggy source:
/** 
 * Test sending + check that we send a message Uses MessageTestHandler()
 */
@Test public void testSendingToCorrectQueue(){
  prepareDefaultMockAnswers(SELECTIVE_HARVEST_CHANNEL,jobMock);
  jobDispatcher.submitNextNewJob(SELECTIVE_HARVEST_CHANNEL);
  verify(jmsConnection).send(crawlMessageCaptor.capture());
  assertTrue(jobMock == crawlMessageCaptor.getValue().getJob());
  assertEquals(HarvesterChannels.getHarvestJobChannelId(SELECTIVE_HARVEST_CHANNEL),crawlMessageCaptor.getValue().getTo());
  reset(jmsConnection);
  Job snapshotJob=createJob(2);
  prepareDefaultMockAnswers(SNAPSHOT,snapshotJob);
  jobDispatcher.submitNextNewJob(SNAPSHOT);
  verify(jmsConnection).send(crawlMessageCaptor.capture());
  assertTrue(snapshotJob == crawlMessageCaptor.getValue().getJob());
  assertEquals(HarvesterChannels.getHarvestJobChannelId(SNAPSHOT),crawlMessageCaptor.getValue().getTo());
}

Fixed version (ground truth):
/** 
 * Test sending + check that we send a message Uses MessageTestHandler()
 */
@Test public void testSendingToCorrectQueue(){
  prepareDefaultMockAnswers(SELECTIVE_HARVEST_CHANNEL,jobMock,false);
  jobDispatcher.submitNextNewJob(SELECTIVE_HARVEST_CHANNEL);
  verify(jmsConnection).send(crawlMessageCaptor.capture());
  assertTrue(jobMock == crawlMessageCaptor.getValue().getJob());
  assertEquals(HarvesterChannels.getHarvestJobChannelId(SELECTIVE_HARVEST_CHANNEL),crawlMessageCaptor.getValue().getTo());
  reset(jmsConnection);
  Job snapshotJob=createJob(2);
  prepareDefaultMockAnswers(SNAPSHOT,snapshotJob,false);
  jobDispatcher.submitNextNewJob(SNAPSHOT);
  verify(jmsConnection).send(crawlMessageCaptor.capture());
  assertTrue(snapshotJob == crawlMessageCaptor.getValue().getJob());
  assertEquals(HarvesterChannels.getHarvestJobChannelId(SNAPSHOT),crawlMessageCaptor.getValue().getTo());
}
Program: 89556
Project: 89556
Buggy source:
/** 
 * Test that runNewJobs makes correct duplication reduction information.
 */
@Test public void testSubmitNewJobsMakesDuplicateReductionInfo() throws DocumentException {
  prepareDefaultMockAnswers(SELECTIVE_HARVEST_CHANNEL,jobMock);
  Document doc=OrderXmlBuilder.create().enableDeduplication().getDoc();
  HeritrixTemplate h1temp=new H1HeritrixTemplate(doc,false);
  when(jobMock.getOrderXMLdoc()).thenReturn(h1temp);
  List<Long> jobIDsForDuplicateReduction=Arrays.asList(new Long[]{1L});
  when(jobDAO.getJobIDsForDuplicateReduction(jobMock.getJobID())).thenReturn(jobIDsForDuplicateReduction);
  jobDispatcher.submitNextNewJob(SELECTIVE_HARVEST_CHANNEL);
  verify(jmsConnection).send(crawlMessageCaptor.capture());
  DoOneCrawlMessage crawlMessage=crawlMessageCaptor.getValue();
  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"+ "String_Node_Str" + harvest.getOid() + "String_Node_Str"+ jobMock.getHarvestNum()+ "String_Node_Str"+ jobMock.getJobID(),metadataEntry.getURL());
  assertEquals("String_Node_Str",jobIDsForDuplicateReduction.get(0) + "String_Node_Str",new String(metadataEntry.getData()));
}

Fixed version (ground truth):
/** 
 * Test that runNewJobs makes correct duplication reduction information.
 */
@Test public void testSubmitNewJobsMakesDuplicateReductionInfo() throws DocumentException {
  prepareDefaultMockAnswers(SELECTIVE_HARVEST_CHANNEL,jobMock,true);
  List<Long> jobIDsForDuplicateReduction=Arrays.asList(new Long[]{1L});
  when(jobDAO.getJobIDsForDuplicateReduction(jobMock.getJobID())).thenReturn(jobIDsForDuplicateReduction);
  jobDispatcher.submitNextNewJob(SELECTIVE_HARVEST_CHANNEL);
  verify(jmsConnection).send(crawlMessageCaptor.capture());
  DoOneCrawlMessage crawlMessage=crawlMessageCaptor.getValue();
  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"+ "String_Node_Str" + harvest.getOid() + "String_Node_Str"+ jobMock.getHarvestNum()+ "String_Node_Str"+ jobMock.getJobID(),metadataEntry.getURL());
  assertEquals("String_Node_Str",jobIDsForDuplicateReduction.get(0) + "String_Node_Str",new String(metadataEntry.getData()));
}
Program: 89557
Project: 89557
Buggy source:
private void prepareDefaultMockAnswers(HarvestChannel channel,Job job){
  Iterator<Long> jobIDIterator=Arrays.asList(new Long[]{job.getJobID()}).iterator();
  when(jobDAO.getAllJobIds(JobStatus.NEW,channel)).thenReturn(jobIDIterator);
  when(jobDAO.read(job.getJobID())).thenReturn(job);
  when(harvestDefinitionDAO.getHarvestName(harvest.getOid())).thenReturn(harvest.getName());
  when(harvestDefinitionDAO.getSparsePartialHarvest(harvest.getName())).thenReturn(harvest);
}

Fixed version (ground truth):
private void prepareDefaultMockAnswers(HarvestChannel channel,Job job,boolean dedup){
  Iterator<Long> jobIDIterator=Arrays.asList(new Long[]{job.getJobID()}).iterator();
  when(jobDAO.getAllJobIds(JobStatus.NEW,channel)).thenReturn(jobIDIterator);
  when(jobDAO.read(job.getJobID())).thenReturn(job);
  when(harvestDefinitionDAO.getHarvestName(harvest.getOid())).thenReturn(harvest.getName());
  when(harvestDefinitionDAO.getSparsePartialHarvest(harvest.getName())).thenReturn(harvest);
  OrderXmlBuilder builder=OrderXmlBuilder.createDefault();
  if (dedup) {
    builder=builder.enableDeduplication();
  }
 else {
    builder=builder.disableDeduplication();
  }
  HeritrixTemplate h1temp=new H1HeritrixTemplate(builder.getDoc(),false);
  when(job.getOrderXMLdoc()).thenReturn(h1temp);
  when(job.getChannel()).thenReturn(SELECTIVE_HARVEST_CHANNEL.getName());
  when(job.getOrderXMLName()).thenReturn("String_Node_Str");
  when(job.getHarvestFilenamePrefix()).thenReturn("String_Node_Str");
}
Program: 89558
Project: 89558
Buggy source:
/** 
 * Test that runNewJobs generates correct alias information for the job.s
 */
@Test public void testSubmitNewJobsMakesAliasInfo() throws SQLException {
  prepareDefaultMockAnswers(SELECTIVE_HARVEST_CHANNEL,jobMock);
  String originalDomain="String_Node_Str";
  String aliasDomain="String_Node_Str";
  when(jobDAO.getJobAliasInfo(any(Job.class))).thenReturn(Arrays.asList(new AliasInfo[]{new AliasInfo("String_Node_Str","String_Node_Str",new Date())}));
  jobDispatcher.submitNextNewJob(SELECTIVE_HARVEST_CHANNEL);
  verify(jmsConnection).send(crawlMessageCaptor.capture());
  assertEquals("String_Node_Str",1,crawlMessageCaptor.getValue().getMetadata().size());
  assertEquals(aliasDomain + "String_Node_Str" + originalDomain+ "String_Node_Str",new String(crawlMessageCaptor.getValue().getMetadata().get(0).getData()));
}

Fixed version (ground truth):
/** 
 * Test that runNewJobs generates correct alias information for the job.s
 */
@Test public void testSubmitNewJobsMakesAliasInfo() throws SQLException {
  prepareDefaultMockAnswers(SELECTIVE_HARVEST_CHANNEL,jobMock,false);
  String originalDomain="String_Node_Str";
  String aliasDomain="String_Node_Str";
  when(jobDAO.getJobAliasInfo(any(Job.class))).thenReturn(Arrays.asList(new AliasInfo[]{new AliasInfo("String_Node_Str","String_Node_Str",new Date())}));
  jobDispatcher.submitNextNewJob(SELECTIVE_HARVEST_CHANNEL);
  verify(jmsConnection).send(crawlMessageCaptor.capture());
  assertEquals("String_Node_Str",1,crawlMessageCaptor.getValue().getMetadata().size());
  assertEquals(aliasDomain + "String_Node_Str" + originalDomain+ "String_Node_Str",new String(crawlMessageCaptor.getValue().getMetadata().get(0).getData()));
}
Program: 89559
Project: 89559
Buggy source:
/** 
 * test constructor behaviour given bad arguments. The introduction of a factory for the HeritrixLauncher hides the actual cause behind the message "Error creating singleton of class 'dk.netarkivet.harvester.harvesting.controller.BnfHeritrixLauncher'.
 */
@Test public void testRunHarvest() throws Exception {
  HeritrixFiles files=HeritrixFiles.getH1HeritrixFilesWithDefaultJmxFiles(new File(TestInfo.WORKING_DIR,"String_Node_Str"),new JobInfoTestImpl(42L,23L));
  hc=HarvestController.getInstance();
  String cause="String_Node_Str" + "String_Node_Str";
  try {
    hc.runHarvest(files);
    fail("String_Node_Str");
  }
 catch (  IOFailure e) {
    System.out.println("String_Node_Str" + e.getMessage());
    StringAsserts.assertStringContains("String_Node_Str","String_Node_Str",e.getMessage());
  }
catch (  ArgumentNotValid e) {
    StringAsserts.assertStringMatches("String_Node_Str",cause,e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * test constructor behaviour given bad arguments. The introduction of a factory for the HeritrixLauncher hides the actual cause behind the message "Error creating singleton of class 'dk.netarkivet.harvester.harvesting.controller.BnfHeritrixLauncher'.
 */
@Test public void testRunHarvest() throws Exception {
  HeritrixFiles files=HeritrixFiles.getH1HeritrixFilesWithDefaultJmxFiles(new File(Heritrix1ControllerTestInfo.WORKING_DIR,"String_Node_Str"),new JobInfoTestImpl(42L,23L));
  hc=HarvestController.getInstance();
  String cause="String_Node_Str" + "String_Node_Str";
  try {
    hc.runHarvest(files);
    fail("String_Node_Str");
  }
 catch (  IOFailure e) {
    System.out.println("String_Node_Str" + e.getMessage());
    StringAsserts.assertStringContains("String_Node_Str","String_Node_Str",e.getMessage());
  }
catch (  ArgumentNotValid e) {
    StringAsserts.assertStringMatches("String_Node_Str",cause,e.getMessage());
  }
}
Program: 89560
Project: 89560
Buggy source:
/** 
 * Test that the launcher handles an empty order file correctly.
 */
@Test public void testStartEmptyFile(){
  HeritrixLauncher hl=getHeritrixLauncher(Heritrix1ControllerTestInfo.EMPTY_ORDER_FILE,null);
  try {
    hl.doCrawl();
    fail("String_Node_Str");
  }
 catch (  IOFailure e) {
  }
}

Fixed version (ground truth):
/** 
 * Test that the launcher handles an empty order file correctly.
 */
@Test public void testStartEmptyFile(){
  HeritrixLauncher hl=getHeritrixLauncher(Heritrix1ControllerTestInfo.EMPTY_ORDER_FILE,null);
  try {
    hl.doCrawl();
    fail("String_Node_Str");
  }
 catch (  ArgumentNotValid e) {
  }
}
Program: 89561
Project: 89561
Buggy source:
/** 
 * This method is used to test various scenarios with bad order-files.
 * @param orderfile
 */
private void myTesterOfBadOrderfiles(File orderfile){
  HeritrixLauncher hl=getHeritrixLauncher(orderfile,null);
  try {
    hl.doCrawl();
    fail("String_Node_Str");
  }
 catch (  IOFailure e) {
  }
catch (  IllegalState e) {
  }
}

Fixed version (ground truth):
/** 
 * This method is used to test various scenarios with bad order-files.
 * @param orderfile
 */
private void myTesterOfBadOrderfiles(File orderfile){
  try {
    HeritrixLauncher hl=getHeritrixLauncher(orderfile,null);
    hl.doCrawl();
    fail("String_Node_Str");
  }
 catch (  IOFailure e) {
  }
catch (  IllegalState e) {
  }
catch (  ArgumentNotValid e) {
  }
}
Program: 89562
Project: 89562
Buggy source:
public H1HeritrixTemplate(Clob clob) throws SQLException {
  Document doc;
  try {
    SAXReader reader=new SAXReader();
    doc=reader.read(clob.getCharacterStream());
  }
 catch (  DocumentException e) {
    String errMsg="String_Node_Str" + clob.getSubString(1,(int)clob.length());
    log.warn(errMsg,e);
    throw new IOFailure(errMsg,e);
  }
  this.template=doc;
}

Fixed version (ground truth):
public H1HeritrixTemplate(String templateAsString) throws DocumentException {
  ArgumentNotValid.checkNotNull(templateAsString,"String_Node_Str");
  this.template=XmlUtils.documentFromString(templateAsString);
}
Program: 89563
Project: 89563
Buggy source:
/** 
 * Alternate constructor, taking a clob as an argument.
 * @param clob The template as SQL CLOB
 */
public H3HeritrixTemplate(Clob clob){
  StringBuilder sb=new StringBuilder();
  try {
    Reader reader=clob.getCharacterStream();
    BufferedReader br=new BufferedReader(reader);
    String line;
    while (null != (line=br.readLine())) {
      sb.append(line);
      sb.append("String_Node_Str");
    }
    br.close();
  }
 catch (  SQLException e) {
    throw new IOFailure("String_Node_Str",e);
  }
catch (  IOException e) {
    throw new IOFailure("String_Node_Str",e);
  }
  this.template=sb.toString();
}

Fixed version (ground truth):
/** 
 * Constructor for HeritrixTemplate class.
 * @param doc the order.xml
 * @param verify If true, verifies if the given dom4j Document contains the elements required by our software.
 * @throws ArgumentNotValid if doc is null, or verify is true and doc does not obey the constraints required by oursoftware.
 */
public H3HeritrixTemplate(String template){
  ArgumentNotValid.checkNotNull(template,"String_Node_Str");
  this.template=template;
}
Program: 89564
Project: 89564
Buggy source:
@Override public void writeTemplate(OutputStream os) throws IOException, ArgumentNotValid {
  XMLWriter writer;
  try {
    writer=new XMLWriter(os);
    writer.write(this.template);
  }
 catch (  UnsupportedEncodingException e) {
    String errMsg="String_Node_Str";
    log.error(errMsg,e);
    throw new ArgumentNotValid(errMsg,e);
  }
}

Fixed version (ground truth):
@Override public void writeTemplate(JspWriter out) throws IOFailure {
  try {
    out.write(template.asXML());
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str",e);
  }
}
Program: 89565
Project: 89565
Buggy source:
@Override public void writeTemplate(OutputStream os) throws IOFailure {
  String templateWithTraps=writeCrawlerTrapsToTemplate();
  try {
    os.write(templateWithTraps.getBytes(Charset.forName("String_Node_Str")));
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void writeTemplate(JspWriter out) throws IOFailure {
  try {
    out.write(template);
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str",e);
  }
}
Program: 89566
Project: 89566
Buggy source:
public abstract void writeTemplate(OutputStream os) throws IOException, ArgumentNotValid ;

Fixed version (ground truth):
public abstract void writeTemplate(JspWriter out);
Program: 89567
Project: 89567
Buggy source:
/** 
 * Builds a new message.
 * @param harvestChannelName the channel of jobs crawled by the sender.
 * @param applicationInstanceId the sender's application instance ID.
 */
public HarvesterReadyMessage(String applicationInstanceId,String harvestChannelName){
  super(HarvesterChannels.getHarvesterStatusChannel(),Channels.getError());
  this.applicationInstanceId=applicationInstanceId;
  this.harvestChannelName=harvestChannelName;
}

Fixed version (ground truth):
/** 
 * Builds a new message.
 * @param harvestChannelName the channel of jobs crawled by the sender.
 * @param applicationInstanceId the sender's application instance ID.
 */
public HarvesterReadyMessage(String applicationInstanceId,String harvestChannelName){
  super(HarvesterChannels.getHarvesterStatusChannel(),Channels.getError());
  this.applicationInstanceId=applicationInstanceId;
  this.harvestChannelName=harvestChannelName;
  this.hostName=SystemUtils.getLocalHostName();
}
Program: 89568
Project: 89568
Buggy source:
public HarvesterRegistrationRequest(final String harvestChannelName,final String instanceId){
  super(HarvesterChannels.getHarvesterRegistrationRequestChannel(),Channels.getError());
  this.harvestChannelName=harvestChannelName;
  this.instanceId=instanceId;
}

Fixed version (ground truth):
public HarvesterRegistrationRequest(final String harvestChannelName,final String instanceId){
  super(HarvesterChannels.getHarvesterRegistrationRequestChannel(),Channels.getError());
  this.harvestChannelName=harvestChannelName;
  this.instanceId=instanceId;
  this.hostname=SystemUtils.getLocalHostName();
}
Program: 89569
Project: 89569
Buggy source:
@Override public void visit(HarvesterRegistrationRequest msg){
  ArgumentNotValid.checkNotNull(msg,"String_Node_Str");
  String harvesterInstanceId=msg.getInstanceId();
  String channelName=msg.getHarvestChannelName();
  boolean isSnapshot=true;
  boolean isValid=true;
  try {
    HarvestChannel chan=harvestChannelDao.getByName(channelName);
    isSnapshot=chan.isSnapshot();
  }
 catch (  UnknownID e) {
    isValid=false;
  }
  if (isValid) {
    harvestChannelRegistry.register(channelName,harvesterInstanceId);
  }
  jmsConnection.send(new HarvesterRegistrationResponse(channelName,isValid,isSnapshot));
  log.info("String_Node_Str",channelName,(isValid ? "String_Node_Str" : "String_Node_Str"));
}

Fixed version (ground truth):
@Override public void visit(HarvesterRegistrationRequest msg){
  ArgumentNotValid.checkNotNull(msg,"String_Node_Str");
  String harvesterInstanceId=msg.getInstanceId();
  String channelName=msg.getHarvestChannelName();
  boolean isSnapshot=true;
  boolean isValid=true;
  try {
    HarvestChannel chan=harvestChannelDao.getByName(channelName);
    isSnapshot=chan.isSnapshot();
  }
 catch (  UnknownID e) {
    isValid=false;
  }
  if (isValid) {
    harvestChannelRegistry.register(channelName,harvesterInstanceId);
  }
  jmsConnection.send(new HarvesterRegistrationResponse(channelName,isValid,isSnapshot));
  log.info("String_Node_Str",msg.getHostname(),channelName,(isValid ? "String_Node_Str" : "String_Node_Str"));
}