Program: 113715
Project: 113715
Buggy source:
@Override public void startRequest(MRCRequest rq){
  try {
    final xtreemfs_replica_removeRequest rqArgs=(xtreemfs_replica_removeRequest)rq.getRequestArgs();
    final FileAccessManager faMan=master.getFileAccessManager();
    final VolumeManager vMan=master.getVolumeManager();
    validateContext(rq);
    long fileId=0;
    String volumeId=null;
    try {
      String globalFileId=rqArgs.getFile_id();
      int i=globalFileId.indexOf(':');
      volumeId=rqArgs.getFile_id().substring(0,i);
      fileId=Long.parseLong(rqArgs.getFile_id().substring(i + 1));
    }
 catch (    Exception exc) {
      throw new UserException("String_Node_Str" + rqArgs.getFile_id() + "String_Node_Str");
    }
    StorageManager sMan=vMan.getStorageManager(volumeId);
    FileMetadata file=sMan.getMetadata(fileId);
    if (file == null)     throw new UserException(ErrNo.ENOENT,"String_Node_Str" + fileId + "String_Node_Str");
    String target=sMan.getSoftlinkTarget(file.getId());
    if (target != null) {
      String path=target;
      Path p=new Path(path);
      if (!vMan.hasVolume(p.getComp(0))) {
        finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,ErrNo.ENOENT,"String_Node_Str" + target + "String_Node_Str"));
        return;
      }
      VolumeInfo volume=vMan.getVolumeByName(p.getComp(0));
      sMan=vMan.getStorageManager(volume.getId());
      PathResolver res=new PathResolver(sMan,p);
      file=res.getFile();
    }
    if (file.isDirectory())     throw new UserException(ErrNo.EPERM,"String_Node_Str");
    faMan.checkPrivilegedPermissions(sMan,file,rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
    XLocList xLocList=file.getXLocList();
    int i=0;
    for (; i < xLocList.getReplicaCount(); i++) {
      XLoc replica=xLocList.getReplica(i);
      if (replica.getOSD(0).equals(rqArgs.getOsd_uuid()))       break;
    }
    XLoc[] newReplList=new XLoc[xLocList.getReplicaCount() - 1];
    for (int j=0, count=0; j < xLocList.getReplicaCount(); j++)     if (j != i)     newReplList[count++]=xLocList.getReplica(j);
    xLocList=sMan.createXLocList(newReplList,xLocList.getVersion() + 1);
    file.setXLocList(xLocList);
    AtomicDBUpdate update=sMan.createAtomicDBUpdate(master,rq);
    sMan.setMetadata(file,FileMetadata.XLOC_METADATA,update);
    rq.setResponse(new xtreemfs_replica_removeResponse());
    update.execute();
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Exception exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
}

Fixed version (ground truth):
@Override public void startRequest(MRCRequest rq){
  try {
    final xtreemfs_replica_removeRequest rqArgs=(xtreemfs_replica_removeRequest)rq.getRequestArgs();
    final FileAccessManager faMan=master.getFileAccessManager();
    final VolumeManager vMan=master.getVolumeManager();
    validateContext(rq);
    long fileId=0;
    String volumeId=null;
    try {
      String globalFileId=rqArgs.getFile_id();
      int i=globalFileId.indexOf(':');
      volumeId=rqArgs.getFile_id().substring(0,i);
      fileId=Long.parseLong(rqArgs.getFile_id().substring(i + 1));
    }
 catch (    Exception exc) {
      throw new UserException("String_Node_Str" + rqArgs.getFile_id() + "String_Node_Str");
    }
    StorageManager sMan=vMan.getStorageManager(volumeId);
    FileMetadata file=sMan.getMetadata(fileId);
    if (file == null)     throw new UserException(ErrNo.ENOENT,"String_Node_Str" + fileId + "String_Node_Str");
    String target=sMan.getSoftlinkTarget(file.getId());
    if (target != null) {
      String path=target;
      Path p=new Path(path);
      if (!vMan.hasVolume(p.getComp(0))) {
        finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,ErrNo.ENOENT,"String_Node_Str" + target + "String_Node_Str"));
        return;
      }
      VolumeInfo volume=vMan.getVolumeByName(p.getComp(0));
      sMan=vMan.getStorageManager(volume.getId());
      PathResolver res=new PathResolver(sMan,p);
      file=res.getFile();
    }
    if (file.isDirectory())     throw new UserException(ErrNo.EPERM,"String_Node_Str");
    faMan.checkPrivilegedPermissions(sMan,file,rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
    XLocList xLocList=file.getXLocList();
    int i=0;
    for (; i < xLocList.getReplicaCount(); i++) {
      XLoc replica=xLocList.getReplica(i);
      if (replica.getOSD(0).equals(rqArgs.getOsd_uuid()))       break;
    }
    XLoc[] newReplList=new XLoc[xLocList.getReplicaCount() - 1];
    for (int j=0, count=0; j < xLocList.getReplicaCount(); j++)     if (j != i)     newReplList[count++]=xLocList.getReplica(j);
    xLocList=sMan.createXLocList(newReplList,xLocList.getVersion() + 1);
    file.setXLocList(xLocList);
    AtomicDBUpdate update=sMan.createAtomicDBUpdate(master,rq);
    sMan.setMetadata(file,FileMetadata.XLOC_METADATA,update);
    rq.setResponse(new xtreemfs_replica_removeResponse());
    update.execute();
  }
 catch (  UserException exc) {
    Logging.logMessage(Logging.LEVEL_TRACE,this,exc);
    finishRequest(rq,new ErrorRecord(ErrorClass.USER_EXCEPTION,exc.getErrno(),exc.getMessage(),exc));
  }
catch (  Throwable exc) {
    finishRequest(rq,new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR,"String_Node_Str",exc));
  }
}