Program: 89672
Project: 89672
Buggy source:
/** 
 * This method makes sure the actual caching of underlying data is done using the index server. It will convert calls into an IndexRequestMessage which is sent to the server. The Set&lt;Long&gt; of found jobs, and  the side effect of caching the index, is done using this communication  with the server. The resulting files will be unzipped into the cache dir. This method should not be called directly! Instead call cache() or getIndex().
 * @param jobSet The set of job IDs.
 * @return The set of found job IDs.
 * @throws ArgumentNotValid on null argument; or on wrong parameters inreplied message.
 * @throws IOFailure on trouble in communication or invalid reply types.
 * @throws IllegalState if message is not OK.
 * @see dk.netarkivet.archive.indexserver.FileBasedCache#cache
 * @see dk.netarkivet.archive.indexserver.FileBasedCache#getIndex
 */
protected Set<Long> cacheData(Set<Long> jobSet) throws IOFailure, IllegalState, ArgumentNotValid {
  ArgumentNotValid.checkNotNull(jobSet,"String_Node_Str");
  log.info("String_Node_Str" + this.requestType + "String_Node_Str"+ StringUtils.conjoin("String_Node_Str",jobSet)+ "String_Node_Str");
  IndexRequestMessage irMsg=new IndexRequestMessage(requestType,jobSet);
  log.debug("String_Node_Str" + getIndexTimeout() + "String_Node_Str");
  NetarkivetMessage msg=getSynchronizer().sendAndWaitForOneReply(irMsg,getIndexTimeout());
  checkMessageValid(jobSet,msg);
  IndexRequestMessage reply=(IndexRequestMessage)msg;
  Set<Long> foundJobs=reply.getFoundJobs();
  if (jobSet.equals(foundJobs)) {
    log.debug("String_Node_Str" + this.requestType + "String_Node_Str"+ StringUtils.conjoin("String_Node_Str",jobSet)+ "String_Node_Str");
    try {
      if (reply.isIndexIsStoredInDirectory()) {
        gunzipToDir(reply.getResultFiles(),getCacheFile(jobSet));
      }
 else {
        unzipAndDeleteRemoteFile(reply.getResultFile(),getCacheFile(jobSet));
      }
    }
 catch (    IOFailure e) {
      log.warn("String_Node_Str",e);
      return new HashSet<Long>();
    }
  }
  return foundJobs;
}

Fixed version (ground truth):
/** 
 * This method makes sure the actual caching of underlying data is done using the index server. It will convert calls into an IndexRequestMessage which is sent to the server. The Set&lt;Long&gt; of found jobs, and  the side effect of caching the index, is done using this communication  with the server. The resulting files will be unzipped into the cache dir. This method should not be called directly! Instead call cache() or getIndex().
 * @param jobSet The set of job IDs.
 * @return The set of found job IDs.
 * @throws ArgumentNotValid on null argument; or on wrong parameters inreplied message.
 * @throws IOFailure on trouble in communication or invalid reply types.
 * @throws IllegalState if message is not OK.
 * @see dk.netarkivet.archive.indexserver.FileBasedCache#cache
 * @see dk.netarkivet.archive.indexserver.FileBasedCache#getIndex
 */
protected Set<Long> cacheData(Set<Long> jobSet) throws IOFailure, IllegalState, ArgumentNotValid {
  ArgumentNotValid.checkNotNull(jobSet,"String_Node_Str");
  log.info("String_Node_Str" + this.requestType + "String_Node_Str"+ StringUtils.conjoin("String_Node_Str",jobSet)+ "String_Node_Str");
  IndexRequestMessage irMsg=new IndexRequestMessage(requestType,jobSet);
  log.debug("String_Node_Str" + TimeUtils.readableTimeInterval(getIndexTimeout()) + "String_Node_Str");
  NetarkivetMessage msg=getSynchronizer().sendAndWaitForOneReply(irMsg,getIndexTimeout());
  checkMessageValid(jobSet,msg);
  IndexRequestMessage reply=(IndexRequestMessage)msg;
  Set<Long> foundJobs=reply.getFoundJobs();
  if (jobSet.equals(foundJobs)) {
    log.debug("String_Node_Str" + this.requestType + "String_Node_Str"+ StringUtils.conjoin("String_Node_Str",jobSet)+ "String_Node_Str");
    try {
      if (reply.isIndexIsStoredInDirectory()) {
        gunzipToDir(reply.getResultFiles(),getCacheFile(jobSet));
      }
 else {
        unzipAndDeleteRemoteFile(reply.getResultFile(),getCacheFile(jobSet));
      }
    }
 catch (    IOFailure e) {
      log.warn("String_Node_Str",e);
      return new HashSet<Long>();
    }
  }
  return foundJobs;
}