Program: 113326
Project: 113326
Buggy source:
/** 
 * saves the request and fetches the object
 */
public void fetchObject(String fileID,long objectNo,XLocations xLoc,Capability capability,CowPolicy cow,final StageRequest rq){
  ReplicatingFile file=this.filesInProgress.get(fileID);
  if (file == null) {
    file=this.lastCompletedFilesCache.get(fileID);
    if (file == null || (file != null && file.hasXLocChanged(xLoc))) {
      file=new ReplicatingFile(fileID,xLoc,capability,cow,master);
    }
    this.filesInProgress.put(fileID,file);
    ReplicatingFile.setMaxObjectsInProgressPerFile(MAX_OBJECTS_IN_PROGRESS_OVERALL / filesInProgress.size());
    if (Logging.isDebug())     Logging.logMessage(Logging.LEVEL_DEBUG,Category.replication,this,"String_Node_Str",fileID);
  }
  file.update(capability,xLoc,cow);
  if (file.isObjectInProgress(objectNo)) {
    file.addObjectForReplication(objectNo,rq);
  }
 else {
    file.addObjectForReplication(objectNo,rq);
    try {
      file.replicate();
    }
 catch (    TransferStrategyException e) {
      if (e.getErrorCode() == TransferStrategyException.ErrorCode.NO_OSD_FOUND)       file.reportError(ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EIO,"String_Node_Str",e.getStackTrace().toString()));
 else       if (e.getErrorCode() == TransferStrategyException.ErrorCode.NO_OSD_REACHABLE)       file.reportError(ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EIO,"String_Node_Str",e.getStackTrace().toString()));
    }
    if (!file.isReplicating())     fileCompleted(file.fileID);
  }
}

Fixed version (ground truth):
/** 
 * saves the request and fetches the object
 */
public void fetchObject(String fileID,long objectNo,XLocations xLoc,Capability capability,CowPolicy cow,final StageRequest rq){
  ReplicatingFile file=this.filesInProgress.get(fileID);
  if (file == null) {
    file=this.lastCompletedFilesCache.get(fileID);
    if (file == null || (file != null && file.hasXLocChanged(xLoc))) {
      file=new ReplicatingFile(fileID,xLoc,capability,cow,master);
    }
    this.filesInProgress.put(fileID,file);
    ReplicatingFile.setMaxObjectsInProgressPerFile(MAX_OBJECTS_IN_PROGRESS_OVERALL / filesInProgress.size());
    if (Logging.isDebug())     Logging.logMessage(Logging.LEVEL_DEBUG,Category.replication,this,"String_Node_Str",fileID);
  }
  file.update(capability,xLoc,cow);
  if (file.isViewOutdated()) {
    file.reportError(ErrorUtils.getErrorResponse(ErrorType.INVALID_VIEW,POSIXErrno.POSIX_ERROR_NONE,"String_Node_Str"));
  }
  if (file.isObjectInProgress(objectNo)) {
    file.addObjectForReplication(objectNo,rq);
  }
 else {
    file.addObjectForReplication(objectNo,rq);
    try {
      file.replicate();
    }
 catch (    TransferStrategyException e) {
      if (e.getErrorCode() == TransferStrategyException.ErrorCode.NO_OSD_FOUND)       file.reportError(ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EIO,"String_Node_Str",e));
 else       if (e.getErrorCode() == TransferStrategyException.ErrorCode.NO_OSD_REACHABLE)       file.reportError(ErrorUtils.getErrorResponse(ErrorType.ERRNO,POSIXErrno.POSIX_ERROR_EIO,"String_Node_Str",e));
    }
    if (!file.isReplicating())     fileCompleted(file.fileID);
  }
}