Program: 113327
Project: 113327
Buggy source:
public ReplicatingFile(String fileID,XLocations xLoc,Capability cap,CowPolicy cow,OSDRequestDispatcher master){
  this.master=master;
  this.osdAvailability=master.getServiceAvailability();
  this.fileID=fileID;
  this.xLoc=xLoc;
  this.cap=cap;
  this.cow=cow;
  this.cancelled=false;
  this.objectsInProgress=new HashMap<Long,ReplicatingObject>();
  this.waitingRequests=new HashMap<Long,ReplicatingObject>();
  StripingPolicyImpl sp=xLoc.getLocalReplica().getStripingPolicy();
  assert(checkEqualStripeSizeOfReplicas(xLoc.getReplicas()));
  this.lastObject=sp.getObjectNoForOffset(xLoc.getXLocSet().getReadOnlyFileSize() - 1);
  if (ReplicationFlags.isRandomStrategy(xLoc.getLocalReplica().getTransferStrategyFlags()))   strategy=new RandomStrategy(fileID,xLoc,osdAvailability);
 else   if (ReplicationFlags.isSequentialStrategy(xLoc.getLocalReplica().getTransferStrategyFlags()))   strategy=new SequentialStrategy(fileID,xLoc,osdAvailability);
 else   if (ReplicationFlags.isSequentialPrefetchingStrategy(xLoc.getLocalReplica().getTransferStrategyFlags()))   strategy=new SequentialPrefetchingStrategy(fileID,xLoc,osdAvailability);
 else   if (ReplicationFlags.isRarestFirstStrategy(xLoc.getLocalReplica().getTransferStrategyFlags()))   strategy=new RarestFirstStrategy(fileID,xLoc,osdAvailability);
 else   throw new IllegalArgumentException("String_Node_Str" + xLoc.getLocalReplica().getTransferStrategyFlags() + "String_Node_Str");
  if (Logging.isDebug())   Logging.logMessage(Logging.LEVEL_DEBUG,Category.replication,this,"String_Node_Str",fileID,strategy.getClass().getName());
  isFullReplica=!xLoc.getLocalReplica().isPartialReplica();
  if (isFullReplica) {
    int coloumn=xLoc.getLocalReplica().getOSDs().indexOf(master.getConfig().getUUID());
    Iterator<Long> objectsIt=sp.getObjectsOfOSD(coloumn,0,lastObject);
    while (objectsIt.hasNext()) {
      strategy.addObject(objectsIt.next(),false);
    }
  }
}

Fixed version (ground truth):
public ReplicatingFile(String fileID,XLocations xLoc,Capability cap,CowPolicy cow,OSDRequestDispatcher master){
  this.master=master;
  this.osdAvailability=master.getServiceAvailability();
  this.fileID=fileID;
  this.xLoc=xLoc;
  this.cap=cap;
  this.cow=cow;
  this.cancelled=false;
  this.viewOutdated=false;
  this.objectsInProgress=new HashMap<Long,ReplicatingObject>();
  this.waitingRequests=new HashMap<Long,ReplicatingObject>();
  StripingPolicyImpl sp=xLoc.getLocalReplica().getStripingPolicy();
  assert(checkEqualStripeSizeOfReplicas(xLoc.getReplicas()));
  this.lastObject=sp.getObjectNoForOffset(xLoc.getXLocSet().getReadOnlyFileSize() - 1);
  if (ReplicationFlags.isRandomStrategy(xLoc.getLocalReplica().getTransferStrategyFlags()))   strategy=new RandomStrategy(fileID,xLoc,osdAvailability);
 else   if (ReplicationFlags.isSequentialStrategy(xLoc.getLocalReplica().getTransferStrategyFlags()))   strategy=new SequentialStrategy(fileID,xLoc,osdAvailability);
 else   if (ReplicationFlags.isSequentialPrefetchingStrategy(xLoc.getLocalReplica().getTransferStrategyFlags()))   strategy=new SequentialPrefetchingStrategy(fileID,xLoc,osdAvailability);
 else   if (ReplicationFlags.isRarestFirstStrategy(xLoc.getLocalReplica().getTransferStrategyFlags()))   strategy=new RarestFirstStrategy(fileID,xLoc,osdAvailability);
 else   throw new IllegalArgumentException("String_Node_Str" + xLoc.getLocalReplica().getTransferStrategyFlags() + "String_Node_Str");
  if (Logging.isDebug())   Logging.logMessage(Logging.LEVEL_DEBUG,Category.replication,this,"String_Node_Str",fileID,strategy.getClass().getName());
  isFullReplica=!xLoc.getLocalReplica().isPartialReplica();
  if (isFullReplica) {
    int coloumn=xLoc.getLocalReplica().getOSDs().indexOf(master.getConfig().getUUID());
    Iterator<Long> objectsIt=sp.getObjectsOfOSD(coloumn,0,lastObject);
    while (objectsIt.hasNext()) {
      strategy.addObject(objectsIt.next(),false);
    }
  }
}