nus-yam/ex-repair huggingface dataset:
Program: 89949
Project: 89949
Buggy source:
/** 
 * Constructor used when you want to change the checksum for the given filename.
 * @param theFileName the given filename
 * @param theChecksum the new checksum for the filename
 */
public AdminDataMessage(String theFileName,String theChecksum){
  super(Channels.getTheRepos(),Channels.getThisReposClient(),IDPREFIX);
  fileName=theFileName;
  checksum=theChecksum;
  changechecksum=true;
}

Fixed version (ground truth):
/** 
 * Constructor used when you want to change the checksum for the given filename.
 * @param theFileName the given filename
 * @param theChecksum the new checksum for the filename
 */
public AdminDataMessage(String theFileName,String theChecksum){
  super(Channels.getTheRepos(),Channels.getThisReposClient());
  fileName=theFileName;
  checksum=theChecksum;
  changechecksum=true;
}
Program: 89950
Project: 89950
Buggy source:
/** 
 * Construct StoreMessage.
 * @param replyTo Channel to reply back to
 * @param arcfile The file to store
 */
public StoreMessage(ChannelID replyTo,File arcfile){
  super(Channels.getTheRepos(),replyTo,STORE_MESSAGE_PREFIX);
  ArgumentNotValid.checkNotNull(arcfile,"String_Node_Str");
  theRemoteFile=RemoteFileFactory.getDistributefileInstance(arcfile);
}

Fixed version (ground truth):
/** 
 * Construct StoreMessage.
 * @param replyTo Channel to reply back to
 * @param arcfile The file to store
 */
public StoreMessage(ChannelID replyTo,File arcfile){
  super(Channels.getTheRepos(),replyTo);
  ArgumentNotValid.checkNotNull(arcfile,"String_Node_Str");
  theRemoteFile=RemoteFileFactory.getDistributefileInstance(arcfile);
}
Program: 89951
Project: 89951
Buggy source:
/** 
 * Message to signal from a BitarchiveServer to the BitarchiveMonitorServer that the Bit Archive Application identified by BA_ApplicationId has completed its part of the batch job. Holds status information: list of files processed and a list of ARC files (file names) on which the batch job failed.
 * @param to the channel to which this message is to be sent (must be aBAMON channel)
 * @param originatingBatchMsgId the Id field from the original batch message
 * @param status The object containing status info.
 */
public BatchEndedMessage(ChannelID to,String originatingBatchMsgId,BatchStatus status){
  super(to,Channels.getError(),IDPREFIX);
  ArgumentNotValid.checkNotNull(to,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(originatingBatchMsgId,"String_Node_Str");
  ArgumentNotValid.checkNotNull(status,"String_Node_Str");
  this.originatingBatchMsgId=originatingBatchMsgId;
  this.BA_ApplicationId=status.getBitArchiveAppId();
  this.rf=status.getResultFile();
  this.noOfFilesProcessed=status.getNoOfFilesProcessed();
  this.filesFailed=status.getFilesFailed();
  this.exceptions=status.getExceptions();
}

Fixed version (ground truth):
/** 
 * Message to signal from a BitarchiveServer to the BitarchiveMonitorServer that the Bit Archive Application identified by BA_ApplicationId has completed its part of the batch job. Holds status information: list of files processed and a list of ARC files (file names) on which the batch job failed.
 * @param to the channel to which this message is to be sent (must be aBAMON channel)
 * @param originatingBatchMsgId the Id field from the original batch message
 * @param status The object containing status info.
 */
public BatchEndedMessage(ChannelID to,String originatingBatchMsgId,BatchStatus status){
  super(to,Channels.getError());
  ArgumentNotValid.checkNotNull(to,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(originatingBatchMsgId,"String_Node_Str");
  ArgumentNotValid.checkNotNull(status,"String_Node_Str");
  this.originatingBatchMsgId=originatingBatchMsgId;
  this.BA_ApplicationId=status.getBitArchiveAppId();
  this.rf=status.getResultFile();
  this.noOfFilesProcessed=status.getNoOfFilesProcessed();
  this.filesFailed=status.getFilesFailed();
  this.exceptions=status.getExceptions();
}
Program: 89952
Project: 89952
Buggy source:
/** 
 * Creates a BatchMessage object which can be used to initiate a batch job.
 * @param to The channel to which the batch message is to be sent
 * @param replyTo The channel whereto the reply to this message is sent.
 * @param job  The batch job to be executed
 * @param replicaId id of this replica.
 */
public BatchMessage(ChannelID to,ChannelID replyTo,FileBatchJob job,String replicaId){
  super(to,replyTo,IDPREFIX);
  ArgumentNotValid.checkNotNull(job,"String_Node_Str");
  this.job=job;
  this.replicaId=replicaId;
}

Fixed version (ground truth):
/** 
 * Creates a BatchMessage object which can be used to initiate a batch job.
 * @param to The channel to which the batch message is to be sent
 * @param replyTo The channel whereto the reply to this message is sent.
 * @param job  The batch job to be executed
 * @param replicaId id of this replica.
 */
public BatchMessage(ChannelID to,ChannelID replyTo,FileBatchJob job,String replicaId){
  super(to,replyTo);
  ArgumentNotValid.checkNotNull(job,"String_Node_Str");
  this.job=job;
  this.replicaId=replicaId;
}
Program: 89953
Project: 89953
Buggy source:
/** 
 * Message to signal from BitarchiveMonitorServer that the batch job identified by originatingBatchMsgId is completed. Holds status information: list of files processed and a list of files on which the batch job failed
 * @param to The queue to which this message is to be sent. This willnormally be the ARCREPOS queue
 * @param replyTo
 * @param originatingBatchMsgId The Id of the BathMessage which gaverise to this reply
 * @param filesProcessed  the total number of file processed in thisbatch job
 * @param filesFailed a Collection<String> of the names of files onwhich this batch job failed
 * @param resultFile The RemoteFile containing the output fromthe batch job, or null if an error occurred that prevented the creation of the file.
 * @throws ArgumentNotValid if the input parameters are not meaningful
 */
public BatchReplyMessage(ChannelID to,ChannelID replyTo,String originatingBatchMsgId,int filesProcessed,Collection<File> filesFailed,RemoteFile resultFile) throws ArgumentNotValid {
  super(to,replyTo,IDPREFIX);
  ArgumentNotValid.checkNotNullOrEmpty(originatingBatchMsgId,"String_Node_Str");
  ArgumentNotValid.checkTrue(filesProcessed >= 0,"String_Node_Str");
  this.replyOfId=originatingBatchMsgId;
  this.noOfFilesProcessed=filesProcessed;
  if (filesFailed != null) {
    this.filesFailed=new HashSet<File>(filesFailed);
  }
 else {
    this.filesFailed=new HashSet<File>();
  }
  this.resultFile=resultFile;
}

Fixed version (ground truth):
/** 
 * Message to signal from BitarchiveMonitorServer that the batch job identified by originatingBatchMsgId is completed. Holds status information: list of files processed and a list of files on which the batch job failed
 * @param to The queue to which this message is to be sent. This willnormally be the ARCREPOS queue
 * @param replyTo The queue that should receive replies.
 * @param originatingBatchMsgId The Id of the BathMessage which gaverise to this reply
 * @param filesProcessed  the total number of file processed in thisbatch job
 * @param filesFailed a Collection<String> of the names of files onwhich this batch job failed
 * @param resultFile The RemoteFile containing the output fromthe batch job, or null if an error occurred that prevented the creation of the file.
 * @throws ArgumentNotValid if the input parameters are not meaningful
 */
public BatchReplyMessage(ChannelID to,ChannelID replyTo,String originatingBatchMsgId,int filesProcessed,Collection<File> filesFailed,RemoteFile resultFile) throws ArgumentNotValid {
  super(to,replyTo);
  ArgumentNotValid.checkNotNullOrEmpty(originatingBatchMsgId,"String_Node_Str");
  ArgumentNotValid.checkTrue(filesProcessed >= 0,"String_Node_Str");
  this.replyOfId=originatingBatchMsgId;
  this.noOfFilesProcessed=filesProcessed;
  if (filesFailed != null) {
    this.filesFailed=new HashSet<File>(filesFailed);
  }
 else {
    this.filesFailed=new HashSet<File>();
  }
  this.resultFile=resultFile;
}
Program: 89954
Project: 89954
Buggy source:
/** 
 * Constructor for get file message
 * @param to Recepient
 * @param replyTo Original sender
 * @param arcfileName The file to retrieve
 * @param replicaId The bitarchive replica id to retrieve it from.
 */
public GetFileMessage(ChannelID to,ChannelID replyTo,String arcfileName,String replicaId){
  super(to,replyTo,IDPREFIX);
  this.arcfileName=arcfileName;
  this.replicaId=replicaId;
}

Fixed version (ground truth):
/** 
 * Constructor for get file message
 * @param to Recepient
 * @param replyTo Original sender
 * @param arcfileName The file to retrieve
 * @param replicaId The bitarchive replica id to retrieve it from.
 */
public GetFileMessage(ChannelID to,ChannelID replyTo,String arcfileName,String replicaId){
  super(to,replyTo);
  this.arcfileName=arcfileName;
  this.replicaId=replicaId;
}
Program: 89955
Project: 89955
Buggy source:
public GetMessage(ChannelID to,ChannelID replyTo,String arcfile,long index){
  super(to,replyTo,IDPREFIX);
  this.arcfile=arcfile;
  this.index=index;
}

Fixed version (ground truth):
public GetMessage(ChannelID to,ChannelID replyTo,String arcfile,long index){
  super(to,replyTo);
  this.arcfile=arcfile;
  this.index=index;
}
Program: 89956
Project: 89956
Buggy source:
/** 
 * Creates a heartbeat message. The time of the heartbeat is set to the creation of this object.
 * @param in_receiver   ChannelID for the recipient of this message.
 * @param applicationId - id of the application that sent the heartbeat
 */
public HeartBeatMessage(ChannelID in_receiver,String applicationId){
  super(in_receiver,Channels.getError(),IDPREFIX);
  ArgumentNotValid.checkNotNullOrEmpty(applicationId,"String_Node_Str");
  timestamp=System.currentTimeMillis();
  this.applicationId=applicationId;
}

Fixed version (ground truth):
/** 
 * Creates a heartbeat message. The time of the heartbeat is set to the creation of this object.
 * @param in_receiver   ChannelID for the recipient of this message.
 * @param applicationId - id of the application that sent the heartbeat
 */
public HeartBeatMessage(ChannelID in_receiver,String applicationId){
  super(in_receiver,Channels.getError());
  ArgumentNotValid.checkNotNullOrEmpty(applicationId,"String_Node_Str");
  timestamp=System.currentTimeMillis();
  this.applicationId=applicationId;
}
Program: 89957
Project: 89957
Buggy source:
/** 
 * Constructor.
 * @param arcfileName The file to retrieve & remove
 * @param replicaId The id of the bitarchive to receive the response
 * @param checksum the checksum of the file to retrieve & remove
 * @param credentials the right credentials for this operation
 */
public RemoveAndGetFileMessage(String arcfileName,String replicaId,String checksum,String credentials){
  super(Channels.getTheRepos(),Channels.getThisReposClient(),IDPREFIX);
  this.arcfileName=arcfileName;
  this.replicaId=replicaId;
  this.checksum=checksum;
  this.credentials=credentials;
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param arcfileName The file to retrieve & remove
 * @param replicaId The id of the bitarchive to receive the response
 * @param checksum the checksum of the file to retrieve & remove
 * @param credentials the right credentials for this operation
 */
public RemoveAndGetFileMessage(String arcfileName,String replicaId,String checksum,String credentials){
  super(Channels.getTheRepos(),Channels.getThisReposClient());
  this.arcfileName=arcfileName;
  this.replicaId=replicaId;
  this.checksum=checksum;
  this.credentials=credentials;
}
Program: 89958
Project: 89958
Buggy source:
/** 
 * Construct UploadMessage.
 * @param to      Channel to message to
 * @param replyTo Channel to reply back to
 * @param rf The RemoteFile to upload
 */
public UploadMessage(ChannelID to,ChannelID replyTo,RemoteFile rf){
  super(to,replyTo,UPLOAD_MESSAGE_PREFIX);
  ArgumentNotValid.checkNotNull(rf,"String_Node_Str");
  arcfileName=rf.getName();
  theRemoteFile=rf;
}

Fixed version (ground truth):
/** 
 * Construct UploadMessage.
 * @param to      Channel to message to
 * @param replyTo Channel to reply back to
 * @param rf The RemoteFile to upload
 */
public UploadMessage(ChannelID to,ChannelID replyTo,RemoteFile rf){
  super(to,replyTo);
  ArgumentNotValid.checkNotNull(rf,"String_Node_Str");
  arcfileName=rf.getName();
  theRemoteFile=rf;
}
Program: 89959
Project: 89959
Buggy source:
/** 
 * Creates a new ArchiveMessage.
 * @param to        the initial receiver of the message
 * @param replyTo   the initial sender of the message
 * @param id_prefix A string to be prepended to the message id foridentification purposes
 * @throws ArgumentNotValid if to==replyTo or there is a null parameter.
 */
protected ArchiveMessage(ChannelID to,ChannelID replyTo,String id_prefix){
  super(to,replyTo,id_prefix);
}

Fixed version (ground truth):
/** 
 * Creates a new ArchiveMessage.
 * @param to        the initial receiver of the message
 * @param replyTo   the initial sender of the message
 * @throws ArgumentNotValid if to==replyTo or there is a null parameter.
 */
protected ArchiveMessage(ChannelID to,ChannelID replyTo){
  super(to,replyTo);
}
Program: 89960
Project: 89960
Buggy source:
/** 
 * Invoke default method for serializing object.
 * @param s
 */
private void writeObject(ObjectOutputStream s){
  try {
    s.defaultWriteObject();
  }
 catch (  Exception e) {
    throw new IOFailure("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Invoke default method for serializing object.
 * @param s The stream the object is written to.
 */
private void writeObject(ObjectOutputStream s){
  try {
    s.defaultWriteObject();
  }
 catch (  Exception e) {
    throw new IOFailure("String_Node_Str",e);
  }
}
Program: 89961
Project: 89961
Buggy source:
/** 
 * Invoke default method for deserializing object, and reinitialise the logger.
 * @param s
 */
private void readObject(ObjectInputStream s){
  try {
    s.defaultReadObject();
  }
 catch (  Exception e) {
    throw new IOFailure("String_Node_Str",e);
  }
  log=LogFactory.getLog(getClass().getName());
}

Fixed version (ground truth):
/** 
 * Invoke default method for deserializing object, and reinitialise the logger.
 * @param s The stream the object is read from.
 */
private void readObject(ObjectInputStream s){
  try {
    s.defaultReadObject();
  }
 catch (  Exception e) {
    throw new IOFailure("String_Node_Str",e);
  }
  log=LogFactory.getLog(getClass().getName());
}
Program: 89962
Project: 89962
Buggy source:
/** 
 * Generate an index request message. Receiver is always the index server channel, replyto is always this index client.
 * @param requestType Type of index requested.
 * @param jobSet      Jobs for which the index is requested.
 * @throws ArgumentNotValid if wither argument is null.
 */
public IndexRequestMessage(RequestType requestType,Set<Long> jobSet){
  super(Channels.getTheIndexServer(),Channels.getThisIndexClient(),"String_Node_Str");
  ArgumentNotValid.checkNotNull(requestType,"String_Node_Str");
  ArgumentNotValid.checkNotNull(jobSet,"String_Node_Str");
  this.requestedJobs=new HashSet<Long>(jobSet);
  this.requestType=requestType;
}

Fixed version (ground truth):
/** 
 * Generate an index request message. Receiver is always the index server channel, replyto is always this index client.
 * @param requestType Type of index requested.
 * @param jobSet      Jobs for which the index is requested.
 * @throws ArgumentNotValid if wither argument is null.
 */
public IndexRequestMessage(RequestType requestType,Set<Long> jobSet){
  super(Channels.getTheIndexServer(),Channels.getThisIndexClient());
  ArgumentNotValid.checkNotNull(requestType,"String_Node_Str");
  ArgumentNotValid.checkNotNull(jobSet,"String_Node_Str");
  this.requestedJobs=new HashSet<Long>(jobSet);
  this.requestType=requestType;
}
Program: 89963
Project: 89963
Buggy source:
public TestMessage(ChannelID to,ChannelID replyTo,String testID){
  super(to,replyTo,"String_Node_Str");
  this.testID=testID;
}

Fixed version (ground truth):
public TestMessage(ChannelID to,ChannelID replyTo,String testID){
  super(to,replyTo);
  this.testID=testID;
}
Program: 89964
Project: 89964
Buggy source:
/** 
 * Creates a new NetarkivetMessage.
 * @param to the initial receiver of the message
 * @param replyTo the initial sender of the message
 * @param id_prefix A string to be prepended to the message id foridentification purposes
 * @throws ArgumentNotValid if to==replyTo or there is a null parameter.
 */
protected NetarkivetMessage(ChannelID to,ChannelID replyTo,String id_prefix){
  ArgumentNotValid.checkNotNull(to,"String_Node_Str");
  ArgumentNotValid.checkNotNull(replyTo,"String_Node_Str");
  ArgumentNotValid.checkNotNull(id_prefix,"String_Node_Str");
  if (to.getName().equals(replyTo.getName())) {
    throw new ArgumentNotValid("String_Node_Str");
  }
  if (replyTo.isTopic()) {
    throw new ArgumentNotValid("String_Node_Str" + replyTo.toString() + "String_Node_Str");
  }
  this.to=to;
  this.replyTo=replyTo;
  this.id=null;
  this.replyOfId=null;
}

Fixed version (ground truth):
/** 
 * Creates a new NetarkivetMessage.
 * @param to the initial receiver of the message
 * @param replyTo the initial sender of the message
 * @throws ArgumentNotValid if to==replyTo, the replyTo parameter is atopic instead of a queue, or there is a null parameter.
 */
protected NetarkivetMessage(ChannelID to,ChannelID replyTo){
  ArgumentNotValid.checkNotNull(to,"String_Node_Str");
  ArgumentNotValid.checkNotNull(replyTo,"String_Node_Str");
  if (to.getName().equals(replyTo.getName())) {
    throw new ArgumentNotValid("String_Node_Str");
  }
  if (replyTo.isTopic()) {
    throw new ArgumentNotValid("String_Node_Str" + replyTo.toString() + "String_Node_Str");
  }
  this.to=to;
  this.replyTo=replyTo;
  this.id=null;
  this.replyOfId=null;
}
Program: 89965
Project: 89965
Buggy source:
/** 
 * Invoke default method for serializing object.
 * @param s
 */
private void writeObject(ObjectOutputStream s){
  try {
    s.defaultWriteObject();
  }
 catch (  Exception e) {
    throw new IOFailure("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Invoke default method for serializing object.
 * @param s The stream the object is written to.
 */
private void writeObject(ObjectOutputStream s){
  try {
    s.defaultWriteObject();
  }
 catch (  Exception e) {
    throw new IOFailure("String_Node_Str",e);
  }
}
Program: 89966
Project: 89966
Buggy source:
/** 
 * Invoke default method for deserializing object.
 * @param s
 */
private void readObject(ObjectInputStream s){
  try {
    s.defaultReadObject();
  }
 catch (  Exception e) {
    throw new IOFailure("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Invoke default method for deserializing object.
 * @param s The stream the object is read from.
 */
private void readObject(ObjectInputStream s){
  try {
    s.defaultReadObject();
  }
 catch (  Exception e) {
    throw new IOFailure("String_Node_Str",e);
  }
}
Program: 89967
Project: 89967
Buggy source:
public TestMessage(ChannelID to,ChannelID replyTo,String testID){
  super(to,replyTo,"String_Node_Str");
  this.testID=testID;
}

Fixed version (ground truth):
public TestMessage(ChannelID to,ChannelID replyTo,String testID){
  super(to,replyTo);
  this.testID=testID;
}
Program: 89968
Project: 89968
Buggy source:
public void testErrorcodes(){
  Settings.set(JMSConnectionSunMQ.JMS_BROKER_PORT,"String_Node_Str");
  JMSConnection con=JMSConnectionFactory.getInstance();
  NetarkivetMessage msg=null;
  int msgNr=0;
  while (msgNr < 50) {
    msg=new TestMessage(Channels.getError(),Channels.getTheRepos(),"String_Node_Str" + msgNr);
    System.out.println("String_Node_Str" + msgNr);
    con.send(msg);
    System.out.println("String_Node_Str" + msgNr + "String_Node_Str");
    TimeUtils.exponentialBackoffSleep(1,Calendar.MINUTE);
    msgNr++;
  }
  con.cleanup();
}

Fixed version (ground truth):
public void testErrorcodes(){
  Settings.set(JMSConnectionSunMQ.JMS_BROKER_PORT,"String_Node_Str");
  JMSConnection con=JMSConnectionFactory.getInstance();
  NetarkivetMessage msg;
  int msgNr=0;
  while (msgNr < 50) {
    msg=new TestMessage(Channels.getError(),Channels.getTheRepos(),"String_Node_Str" + msgNr);
    System.out.println("String_Node_Str" + msgNr);
    con.send(msg);
    System.out.println("String_Node_Str" + msgNr + "String_Node_Str");
    TimeUtils.exponentialBackoffSleep(1,Calendar.MINUTE);
    msgNr++;
  }
  con.cleanup();
}
Program: 89969
Project: 89969
Buggy source:
/** 
 * Return the URL for monitoring this instance.
 * @return the URL for monitoring this instance.
 */
public String getHarvestInformation(){
  return "String_Node_Str" + getHostName() + "String_Node_Str"+ getGUIPort();
}

Fixed version (ground truth):
/** 
 * Return the URL for monitoring this instance.
 * @return the URL for monitoring this instance.
 */
public String getHarvestInformation(){
  return "String_Node_Str" + SystemUtils.getLocalHostName() + "String_Node_Str"+ getGUIPort();
}
Program: 89971
Project: 89971
Buggy source:
/** 
 * Get a tree view of a part of the settings. Note: settings read with this mechanism do not support overriding with system properties!
 * @param path Dotted path to a unique element in the tree.
 * @return The part of the setting structure below the element given.
 */
public static StringTree<String> getTree(String path){
  for (  SimpleXml settingsXml : getFileSettingsXmlList()) {
    if (settingsXml.hasKey(path)) {
      return settingsXml.getTree(path);
    }
  }
  for (  SimpleXml settingsXml : getDefaultClasspathSettingsXmlList()) {
    if (settingsXml.hasKey(path)) {
      return settingsXml.getTree(path);
    }
  }
  throw new UnknownID("String_Node_Str" + path + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Get a tree view of a part of the settings. Note: settings read with this mechanism do not support overriding with system properties!
 * @param path Dotted path to a unique element in the tree.
 * @return The part of the setting structure below the element given.
 */
public static StringTree<String> getTree(String path){
synchronized (fileSettingsXmlList) {
    for (    SimpleXml settingsXml : fileSettingsXmlList) {
      if (settingsXml.hasKey(path)) {
        return settingsXml.getTree(path);
      }
    }
  }
synchronized (defaultClasspathSettingsXmlList) {
    for (    SimpleXml settingsXml : defaultClasspathSettingsXmlList) {
      if (settingsXml.hasKey(path)) {
        return settingsXml.getTree(path);
      }
    }
  }
  throw new UnknownID("String_Node_Str" + path + "String_Node_Str");
}
Program: 89972
Project: 89972
Buggy source:
/** 
 * Reloads the settings. This will reload the settings from disk, and forget all settings that were set with   {@link #set}The field   {@link #lastModified} is updated to timestampof the settings file that has been changed most recently.
 * @throws IOFailure if settings cannot be loaded
 * @see #conditionalReload()
 */
public static synchronized void reload(){
  lastModified=0;
  List<File> settingsFiles=getSettingsFiles();
  List<SimpleXml> simpleXmlList=new ArrayList<SimpleXml>();
  for (  File settingsFile : settingsFiles) {
    if (settingsFile.isFile()) {
      simpleXmlList.add(new SimpleXml(settingsFile));
    }
 else {
      log.warn("String_Node_Str" + settingsFile.getAbsolutePath() + "String_Node_Str");
    }
    if (settingsFile.lastModified() > lastModified) {
      lastModified=settingsFile.lastModified();
    }
  }
  fileSettingsXmlList=simpleXmlList;
}

Fixed version (ground truth):
/** 
 * Reloads the settings. This will reload the settings from disk, and forget all settings that were set with   {@link #set}The field   {@link #lastModified} is updated to timestampof the settings file that has been changed most recently.
 * @throws IOFailure if settings cannot be loaded
 * @see #conditionalReload()
 */
public static synchronized void reload(){
  lastModified=0;
  List<File> settingsFiles=getSettingsFiles();
  List<SimpleXml> simpleXmlList=new ArrayList<SimpleXml>();
  for (  File settingsFile : settingsFiles) {
    if (settingsFile.isFile()) {
      simpleXmlList.add(new SimpleXml(settingsFile));
    }
 else {
      log.warn("String_Node_Str" + settingsFile.getAbsolutePath() + "String_Node_Str");
    }
    if (settingsFile.lastModified() > lastModified) {
      lastModified=settingsFile.lastModified();
    }
  }
  fileSettingsXmlList=Collections.synchronizedList(simpleXmlList);
}
Program: 89973
Project: 89973
Buggy source:
/** 
 * Add the settings file represented by this path to the list of default classpath settings.
 * @param defaultClasspathSettingsPath the given default classpath setting.
 */
public static void addDefaultClasspathSettings(String defaultClasspathSettingsPath){
  ArgumentNotValid.checkNotNullOrEmpty(defaultClasspathSettingsPath,"String_Node_Str");
  InputStream stream=Thread.currentThread().getContextClassLoader().getResourceAsStream(defaultClasspathSettingsPath);
  if (stream != null) {
    if (defaultClasspathSettingsXmlList == null) {
      defaultClasspathSettingsXmlList=new ArrayList<SimpleXml>();
    }
    defaultClasspathSettingsXmlList.add(new SimpleXml(stream));
  }
 else {
    log.warn("String_Node_Str" + defaultClasspathSettingsPath + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Add the settings file represented by this path to the list of default classpath settings.
 * @param defaultClasspathSettingsPath the given default classpath setting.
 */
public static void addDefaultClasspathSettings(String defaultClasspathSettingsPath){
  ArgumentNotValid.checkNotNullOrEmpty(defaultClasspathSettingsPath,"String_Node_Str");
  InputStream stream=Thread.currentThread().getContextClassLoader().getResourceAsStream(defaultClasspathSettingsPath);
  if (stream != null) {
    if (defaultClasspathSettingsXmlList == null) {
      defaultClasspathSettingsXmlList=Collections.synchronizedList(new ArrayList<SimpleXml>());
    }
    defaultClasspathSettingsXmlList.add(new SimpleXml(stream));
  }
 else {
    log.warn("String_Node_Str" + defaultClasspathSettingsPath + "String_Node_Str");
  }
}
Program: 89974
Project: 89974
Buggy source:
/** 
 * Gets a setting. The search order for a given setting is as follows: First it is checked, if the argument key is set as a System property. If yes, return this value. If no, we continue the search. Secondly, we check, if the setting is in one of the loaded settings xml files. If the value is there, it is returned. If no, we continue the search. Finally, we check if the setting is in one of default settings  files from classpath. If the value is there, it is returned. Otherwise an UnknownId exception is thrown. Note: The retrieved value can be the empty string
 * @param key name of the setting to retrieve
 * @return the retrieved value
 * @throws ArgumentNotValid if key is null or the empty string
 * @throws UnknownID        if no setting loaded matches key
 * @throws IOFailure        if IO Failure
 */
public static String get(String key) throws UnknownID, IOFailure, ArgumentNotValid {
  ArgumentNotValid.checkNotNullOrEmpty(key,"String_Node_Str");
  String val=System.getProperty(key);
  if (val != null) {
    return val;
  }
  for (  SimpleXml settingsXml : getFileSettingsXmlList()) {
    if (settingsXml.hasKey(key)) {
      return settingsXml.getString(key);
    }
  }
  for (  SimpleXml settingsXml : getDefaultClasspathSettingsXmlList()) {
    if (settingsXml.hasKey(key)) {
      return settingsXml.getString(key);
    }
  }
  throw new UnknownID("String_Node_Str" + key + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Gets a setting. The search order for a given setting is as follows: First it is checked, if the argument key is set as a System property. If yes, return this value. If no, we continue the search. Secondly, we check, if the setting is in one of the loaded settings xml files. If the value is there, it is returned. If no, we continue the search. Finally, we check if the setting is in one of default settings  files from classpath. If the value is there, it is returned. Otherwise an UnknownId exception is thrown. Note: The retrieved value can be the empty string
 * @param key name of the setting to retrieve
 * @return the retrieved value
 * @throws ArgumentNotValid if key is null or the empty string
 * @throws UnknownID        if no setting loaded matches key
 * @throws IOFailure        if IO Failure
 */
public static String get(String key) throws UnknownID, IOFailure, ArgumentNotValid {
  ArgumentNotValid.checkNotNullOrEmpty(key,"String_Node_Str");
  String val=System.getProperty(key);
  if (val != null) {
    return val;
  }
synchronized (fileSettingsXmlList) {
    for (    SimpleXml settingsXml : fileSettingsXmlList) {
      if (settingsXml.hasKey(key)) {
        return settingsXml.getString(key);
      }
    }
  }
synchronized (defaultClasspathSettingsXmlList) {
    for (    SimpleXml settingsXml : defaultClasspathSettingsXmlList) {
      if (settingsXml.hasKey(key)) {
        return settingsXml.getString(key);
      }
    }
  }
  throw new UnknownID("String_Node_Str" + key + "String_Node_Str");
}
Program: 89975
Project: 89975
Buggy source:
/** 
 * Handle an HTTP request. Overrides default behaviour of Jetty. This will forward the URI and response to the wrapped URI resolver. Note that the server will NOT force the return value to be the one returned by the uri resolver, rather it will use the one the uri resolver has set in the response object. Exceptions will generate an internal server error-page with the details.
 * @param target URL or name for request. Not used
 * @param request The original request, including URL
 * @param response The object that receives the result
 * @param dispatch The dispatch mode. Not used.
 * @see Handler#handle(java.lang.String,HttpServletRequest,HttpServletResponse,int)
 */
public void handle(String target,HttpServletRequest request,HttpServletResponse response,int dispatch){
  URI uri=null;
  HttpResponse netarkivetResponse=new HttpResponse(response);
  HttpRequest netarkivetRequest=new HttpRequest(request);
  try {
    uriResolver.lookup(netarkivetRequest,netarkivetResponse);
    ((org.mortbay.jetty.Request)request).setHandled(true);
  }
 catch (  Exception e) {
    createErrorResponse(uri,netarkivetResponse,e);
  }
}

Fixed version (ground truth):
/** 
 * Handle an HTTP request. Overrides default behaviour of Jetty. This will forward the URI and response to the wrapped URI resolver. Note that the server will NOT force the return value to be the one returned by the uri resolver, rather it will use the one the uri resolver has set in the response object. Exceptions will generate an internal server error-page with the details.
 * @param target URL or name for request. Not used
 * @param request The original request, including URL
 * @param response The object that receives the result
 * @param dispatch The dispatch mode. Not used.
 * @see Handler#handle(java.lang.String,HttpServletRequest,HttpServletResponse,int)
 */
public void handle(String target,HttpServletRequest request,HttpServletResponse response,int dispatch){
  HttpResponse netarkivetResponse=new HttpResponse(response);
  HttpRequest netarkivetRequest=new HttpRequest(request);
  try {
    uriResolver.lookup(netarkivetRequest,netarkivetResponse);
    ((org.mortbay.jetty.Request)request).setHandled(true);
  }
 catch (  Exception e) {
    createErrorResponse(netarkivetRequest.getURI(),netarkivetResponse,e);
  }
}
Program: 89977
Project: 89977
Buggy source:
/** 
 * Return the lowest limit for the two values, or MAX_DOMAIN_SIZE if both are infinite
 * @param objectLimit A long value defining an object limit, or 0 forinfinite
 * @param byteLimit A long value defining a byte limit, or -1 for inifite.
 * @param expectedObjectSize The expected number of bytes per object
 * @return The lowest of the two boundaries, or MAX_DOMAIN_SIZE if both areunlimited.
 */
public long minObjectsBytesLimit(long objectLimit,long byteLimit,long expectedObjectSize){
  long maxObjectsByBytes=byteLimit / expectedObjectSize;
  if (objectLimit != Constants.HERITRIX_MAXOBJECTS_INFINITY) {
    if (byteLimit != Constants.HERITRIX_MAXBYTES_INFINITY) {
      return Math.min(objectLimit,maxObjectsByBytes);
    }
 else {
      return objectLimit;
    }
  }
 else {
    if (byteLimit != Constants.HERITRIX_MAXBYTES_INFINITY) {
      return maxObjectsByBytes;
    }
 else {
      return Settings.getLong(HarvesterSettings.MAX_DOMAIN_SIZE);
    }
  }
}

Fixed version (ground truth):
/** 
 * Return the lowest limit for the two values, or MAX_DOMAIN_SIZE if both are infinite, which is the max size we harvest from this domain.
 * @param objectLimit A long value defining an object limit, or 0 forinfinite
 * @param byteLimit A long value defining a byte limit, or -1 for inifite.
 * @param expectedObjectSize The expected number of bytes per object
 * @return The lowest of the two boundaries, or MAX_DOMAIN_SIZE if both areunlimited.
 */
public long minObjectsBytesLimit(long objectLimit,long byteLimit,long expectedObjectSize){
  long maxObjectsByBytes=byteLimit / expectedObjectSize;
  if (objectLimit != Constants.HERITRIX_MAXOBJECTS_INFINITY) {
    if (byteLimit != Constants.HERITRIX_MAXBYTES_INFINITY) {
      return Math.min(objectLimit,maxObjectsByBytes);
    }
 else {
      return objectLimit;
    }
  }
 else {
    if (byteLimit != Constants.HERITRIX_MAXBYTES_INFINITY) {
      return maxObjectsByBytes;
    }
 else {
      return Settings.getLong(HarvesterSettings.MAX_DOMAIN_SIZE);
    }
  }
}
Program: 89979
Project: 89979
Buggy source:
/** 
 * Get the value of an attribute, closing the connector afterwards.  If you wish to hold on to the connector, call JMXUtils#executeCommand(MBeanServerConnection, String, String, String[])
 * @param connector A one-shot connector object.
 * @param beanName The name of the bean to get an attribute from.
 * @param attribute The attribute to get.
 * @return Whatever the command returned.
 */
public static Object getAttribute(JMXConnector connector,String beanName,String attribute){
  ArgumentNotValid.checkNotNull(connector,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(beanName,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(attribute,"String_Node_Str");
  MBeanServerConnection connection=null;
  try {
    connection=connector.getMBeanServerConnection();
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str",e);
  }
  try {
    return getAttribute(beanName,attribute,connection);
  }
  finally {
    try {
      connector.close();
    }
 catch (    IOException e) {
      log.warn("String_Node_Str" + beanName,e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Get the value of an attribute, closing the connector afterwards.  If you wish to hold on to the connector, call JMXUtils#executeCommand(MBeanServerConnection, String, String, String[])
 * @param connector A one-shot connector object.
 * @param beanName The name of the bean to get an attribute from.
 * @param attribute The attribute to get.
 * @return Whatever the command returned.
 */
public static Object getAttribute(JMXConnector connector,String beanName,String attribute){
  ArgumentNotValid.checkNotNull(connector,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(beanName,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(attribute,"String_Node_Str");
  MBeanServerConnection connection;
  try {
    connection=connector.getMBeanServerConnection();
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str",e);
  }
  try {
    return getAttribute(beanName,attribute,connection);
  }
  finally {
    try {
      connector.close();
    }
 catch (    IOException e) {
      log.warn("String_Node_Str" + beanName,e);
    }
  }
}
Program: 89981
Project: 89981
Buggy source:
/** 
 * Execute a single command, closing the connector afterwards.  If you wish to hold on to the connector, call JMXUtils#executeCommand(MBeanServerConnection, String, String, String[])
 * @param connector A one-shot connector object.
 * @param beanName The name of the bean to execute a command on.
 * @param command The command to execute.
 * @param arguments The arguments to the command (all strings)
 * @return Whatever the command returned.
 */
public static Object executeCommand(JMXConnector connector,String beanName,String command,String... arguments){
  ArgumentNotValid.checkNotNull(connector,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(beanName,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(command,"String_Node_Str");
  ArgumentNotValid.checkNotNull(arguments,"String_Node_Str");
  MBeanServerConnection connection=null;
  try {
    connection=connector.getMBeanServerConnection();
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str",e);
  }
  try {
    return executeCommand(connection,beanName,command,arguments);
  }
  finally {
    try {
      connector.close();
    }
 catch (    IOException e) {
      log.warn("String_Node_Str" + beanName,e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Execute a single command, closing the connector afterwards.  If you wish to hold on to the connector, call JMXUtils#executeCommand(MBeanServerConnection, String, String, String[])
 * @param connector A one-shot connector object.
 * @param beanName The name of the bean to execute a command on.
 * @param command The command to execute.
 * @param arguments The arguments to the command (all strings)
 * @return Whatever the command returned.
 */
public static Object executeCommand(JMXConnector connector,String beanName,String command,String... arguments){
  ArgumentNotValid.checkNotNull(connector,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(beanName,"String_Node_Str");
  ArgumentNotValid.checkNotNullOrEmpty(command,"String_Node_Str");
  ArgumentNotValid.checkNotNull(arguments,"String_Node_Str");
  MBeanServerConnection connection;
  try {
    connection=connector.getMBeanServerConnection();
  }
 catch (  IOException e) {
    throw new IOFailure("String_Node_Str",e);
  }
  try {
    return executeCommand(connection,beanName,command,arguments);
  }
  finally {
    try {
      connector.close();
    }
 catch (    IOException e) {
      log.warn("String_Node_Str" + beanName,e);
    }
  }
}
Program: 89982
Project: 89982
Buggy source:
/** 
 * Cleanup after an Heritrix process. This entails sending the shutdown command to the Heritrix process, and killing it forcefully, if it is still alive after waiting  the period of time specified by the CommonSettings.PROCESS_TIMEOUT setting.
 * @see HeritrixController#cleanup() 
 */
public void cleanup(){
  try {
    executeHeritrixCommand(SHUTDOWN_COMMAND);
  }
 catch (  IOFailure e) {
    log.error("String_Node_Str",e);
  }
  final long maxWait=Settings.getLong(CommonSettings.PROCESS_TIMEOUT);
  Integer exitValue=ProcessUtils.waitFor(heritrixProcess,maxWait);
  if (exitValue != null) {
    log.info("String_Node_Str" + this + "String_Node_Str"+ exitValue);
  }
 else {
    log.warn("String_Node_Str" + this + "String_Node_Str"+ maxWait+ "String_Node_Str");
    heritrixProcess.destroy();
    exitValue=ProcessUtils.waitFor(heritrixProcess,maxWait);
    if (exitValue != null) {
      log.info("String_Node_Str" + this + "String_Node_Str"+ exitValue);
    }
 else {
      log.warn("String_Node_Str" + this + "String_Node_Str");
    }
  }
  Runtime.getRuntime().removeShutdownHook(processKillerHook);
  int attempt=0;
  do {
    boolean anyAlive=false;
    for (    Thread t : collectionThreads) {
      if (t.isAlive()) {
        anyAlive=true;
      }
    }
    if (!anyAlive) {
      break;
    }
    TimeUtils.exponentialBackoffSleep(attempt);
  }
 while (attempt++ < JMXUtils.MAX_TRIES);
}

Fixed version (ground truth):
/** 
 * Cleanup after an Heritrix process. This entails sending the shutdown command to the Heritrix process, and killing it forcefully, if it is still alive after waiting  the period of time specified by the CommonSettings.PROCESS_TIMEOUT setting.
 * @see HeritrixController#cleanup() 
 */
public void cleanup(){
  try {
    executeHeritrixCommand(SHUTDOWN_COMMAND);
  }
 catch (  IOFailure e) {
    log.error("String_Node_Str",e);
  }
  final long maxWait=Settings.getLong(CommonSettings.PROCESS_TIMEOUT);
  Integer exitValue=ProcessUtils.waitFor(heritrixProcess,maxWait);
  if (exitValue != null) {
    log.info("String_Node_Str" + this + "String_Node_Str"+ exitValue);
  }
 else {
    log.warn("String_Node_Str" + this + "String_Node_Str"+ maxWait+ "String_Node_Str");
    heritrixProcess.destroy();
    exitValue=ProcessUtils.waitFor(heritrixProcess,maxWait);
    if (exitValue != null) {
      log.info("String_Node_Str" + this + "String_Node_Str"+ exitValue);
    }
 else {
      log.warn("String_Node_Str" + this + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
      NotificationsFactory.getInstance().errorEvent("String_Node_Str" + this + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
      System.exit(1);
    }
  }
  Runtime.getRuntime().removeShutdownHook(processKillerHook);
  int attempt=0;
  do {
    boolean anyAlive=false;
    for (    Thread t : collectionThreads) {
      if (t.isAlive()) {
        anyAlive=true;
      }
    }
    if (!anyAlive) {
      break;
    }
    TimeUtils.exponentialBackoffSleep(attempt);
  }
 while (attempt++ < JMXUtils.MAX_TRIES);
}
Program: 89983
Project: 89983
Buggy source:
/** 
 * Creates a new BitarchiveAdmin object for an existing bit archive. Reads the directories to use from settings.
 * @throws PermissionDenied If any of the directories cannot be created orare not writeable.
 */
private BitarchiveAdmin(){
  String[] filedirnames=Settings.getAll(ArchiveSettings.BITARCHIVE_SERVER_FILEDIR);
  minSpaceLeft=Settings.getLong(ArchiveSettings.BITARCHIVE_MIN_SPACE_LEFT);
  if (minSpaceLeft <= 0L) {
    log.warn("String_Node_Str" + minSpaceLeft);
    throw new ArgumentNotValid("String_Node_Str" + minSpaceLeft);
  }
  log.info("String_Node_Str" + minSpaceLeft + "String_Node_Str");
  for (int i=0; i < filedirnames.length; i++) {
    File basedir=new File(filedirnames[i]);
    File filedir=new File(basedir,Constants.FILE_DIRECTORY_NAME);
    ApplicationUtils.dirMustExist(filedir);
    File tempdir=new File(basedir,Constants.TEMPORARY_DIRECTORY_NAME);
    ApplicationUtils.dirMustExist(tempdir);
    File atticdir=new File(basedir,Constants.ATTIC_DIRECTORY_NAME);
    ApplicationUtils.dirMustExist(atticdir);
    archivePaths.add(basedir);
    final Long bytesUsedInDir=new Long(calculateBytesUsed(basedir));
    log.info("String_Node_Str" + basedir + "String_Node_Str"+ bytesUsedInDir+ "String_Node_Str"+ FileUtils.getBytesFree(basedir)+ "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Creates a new BitarchiveAdmin object for an existing bit archive. Reads the directories to use from settings.
 * @throws ArgumentNotValid If the settings for minSpaceLeft is non-positiveor the setting for minSpaceRequired is negative. 
 * @throws PermissionDenied If any of the directories cannot be created orare not writeable.
 */
private BitarchiveAdmin(){
  String[] filedirnames=Settings.getAll(ArchiveSettings.BITARCHIVE_SERVER_FILEDIR);
  minSpaceLeft=Settings.getLong(ArchiveSettings.BITARCHIVE_MIN_SPACE_LEFT);
  if (minSpaceLeft <= 0L) {
    log.warn("String_Node_Str" + minSpaceLeft);
    throw new ArgumentNotValid("String_Node_Str" + minSpaceLeft);
  }
  minSpaceRequired=Settings.getLong(ArchiveSettings.BITARCHIVE_MIN_SPACE_REQUIRED);
  if (minSpaceLeft < 0L) {
    log.warn("String_Node_Str" + minSpaceLeft);
    throw new ArgumentNotValid("String_Node_Str" + minSpaceLeft);
  }
  log.info("String_Node_Str" + minSpaceRequired + "String_Node_Str");
  log.info("String_Node_Str" + minSpaceLeft + "String_Node_Str");
  for (  String filedirname : filedirnames) {
    File basedir=new File(filedirname);
    File filedir=new File(basedir,Constants.FILE_DIRECTORY_NAME);
    ApplicationUtils.dirMustExist(filedir);
    File tempdir=new File(basedir,Constants.TEMPORARY_DIRECTORY_NAME);
    ApplicationUtils.dirMustExist(tempdir);
    File atticdir=new File(basedir,Constants.ATTIC_DIRECTORY_NAME);
    ApplicationUtils.dirMustExist(atticdir);
    archivePaths.add(basedir);
    final Long bytesUsedInDir=calculateBytesUsed(basedir);
    log.info("String_Node_Str" + basedir + "String_Node_Str"+ bytesUsedInDir+ "String_Node_Str"+ FileUtils.getBytesFree(basedir)+ "String_Node_Str");
  }
}
Program: 89984
Project: 89984
Buggy source:
/** 
 * Return the path that a given arc file can be found in.
 * @param arcFileName Name of an arc file (with no path)
 * @return A BitarchiveARCFile for the given file, or null if thefile does not exist.
 */
public BitarchiveARCFile lookup(String arcFileName){
  ArgumentNotValid.checkNotNullOrEmpty(arcFileName,"String_Node_Str");
  for (Iterator<File> i=archivePaths.iterator(); i.hasNext(); ) {
    File archiveDir=new File(i.next(),Constants.FILE_DIRECTORY_NAME);
    if (checkArchiveDir(archiveDir)) {
      File filename=new File(archiveDir,arcFileName);
      if (filename.exists()) {
        if (filename.isFile()) {
          return new BitarchiveARCFile(arcFileName,filename);
        }
        log.fatal("String_Node_Str" + filename + "String_Node_Str"+ "String_Node_Str");
      }
    }
  }
  log.trace("String_Node_Str" + arcFileName + "String_Node_Str");
  return null;
}

Fixed version (ground truth):
/** 
 * Return the path that a given arc file can be found in.
 * @param arcFileName Name of an arc file (with no path)
 * @return A BitarchiveARCFile for the given file, or null if thefile does not exist.
 */
public BitarchiveARCFile lookup(String arcFileName){
  ArgumentNotValid.checkNotNullOrEmpty(arcFileName,"String_Node_Str");
  for (  File archivePath : archivePaths) {
    File archiveDir=new File(archivePath,Constants.FILE_DIRECTORY_NAME);
    if (checkArchiveDir(archiveDir)) {
      File filename=new File(archiveDir,arcFileName);
      if (filename.exists()) {
        if (filename.isFile()) {
          return new BitarchiveARCFile(arcFileName,filename);
        }
        log.fatal("String_Node_Str" + filename + "String_Node_Str"+ "String_Node_Str");
      }
    }
  }
  log.trace("String_Node_Str" + arcFileName + "String_Node_Str");
  return null;
}
Program: 89985
Project: 89985
Buggy source:
/** 
 * Return array with references to all files in the archive.
 * @return array with references to all files in the archive
 */
public File[] getFiles(){
  List<File> files=new ArrayList<File>();
  for (Iterator<File> i=archivePaths.iterator(); i.hasNext(); ) {
    File archiveDir=new File(i.next(),Constants.FILE_DIRECTORY_NAME);
    if (checkArchiveDir(archiveDir)) {
      File[] filesHere=archiveDir.listFiles();
      for (      File file : filesHere) {
        if (!file.isFile()) {
          log.warn("String_Node_Str" + file.getAbsolutePath() + "String_Node_Str");
        }
 else {
          files.add(file);
        }
      }
    }
  }
  return (files.toArray(new File[0]));
}

Fixed version (ground truth):
/** 
 * Return array with references to all files in the archive.
 * @return array with references to all files in the archive
 */
public File[] getFiles(){
  List<File> files=new ArrayList<File>();
  for (  File archivePath : archivePaths) {
    File archiveDir=new File(archivePath,Constants.FILE_DIRECTORY_NAME);
    if (checkArchiveDir(archiveDir)) {
      File[] filesHere=archiveDir.listFiles();
      for (      File file : filesHere) {
        if (!file.isFile()) {
          log.warn("String_Node_Str" + file.getAbsolutePath() + "String_Node_Str");
        }
 else {
          files.add(file);
        }
      }
    }
  }
  return files.toArray(new File[files.size()]);
}