Program: 113719
Project: 113719
Buggy source:
@Override public void startRequest(MRCRequest rq){
  try {
    if (!rq.getDetails().superUser)     throw new UserException(ErrNo.EACCES,"String_Node_Str");
    final xtreemfs_restore_fileRequest rqArgs=(xtreemfs_restore_fileRequest)rq.getRequestArgs();
    final VolumeManager vMan=master.getVolumeManager();
    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");
    }
    final Path p=new Path(vMan.getVolumeById(volumeId).getName() + "String_Node_Str" + rqArgs.getFile_path());
    final StorageManager sMan=vMan.getStorageManager(volumeId);
    AtomicDBUpdate update=sMan.createAtomicDBUpdate(master,rq);
    int time=(int)(TimeSync.getGlobalTime() / 1000);
    long nextFileId=sMan.getNextFileId();
    FileMetadata[] path=sMan.resolvePath(p);
    long parentId=1;
    for (int i=0; i < p.getCompCount(); i++)     try {
      if (path[i] != null)       parentId=path[i].getId();
 else {
        sMan.createDir(nextFileId,parentId,p.getComp(i),time,time,time,rq.getDetails().userId,rq.getDetails().groupIds.get(0),509,0,update);
        parentId=nextFileId;
        nextFileId++;
        sMan.setLastFileId(nextFileId,update);
      }
    }
 catch (    DatabaseException exc) {
      if (exc.getType() != ExceptionType.FILE_EXISTS)       throw exc;
    }
    FileMetadata file=sMan.createFile(fileId,parentId,rqArgs.getFile_id(),time,time,time,rq.getDetails().userId,rq.getDetails().groupIds.get(0),511,0,rqArgs.getFile_size(),false,0,0,update);
    int size=(rqArgs.getStripe_size() < 1024 ? 1 : (rqArgs.getStripe_size() % 1024 != 0) ? rqArgs.getStripe_size() / 1024 + 1 : rqArgs.getStripe_size() / 1024);
    StripingPolicy sp=sMan.createStripingPolicy("String_Node_Str",size,1);
    XLoc replica=sMan.createXLoc(sp,new String[]{rqArgs.getOsd_uuid()});
    XLocList xLocList=sMan.createXLocList(new XLoc[]{replica},0);
    file.setXLocList(xLocList);
    sMan.setMetadata(file,FileMetadata.XLOC_METADATA,update);
    rq.setResponse(new xtreemfs_restore_fileResponse());
    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 {
    if (!rq.getDetails().superUser)     throw new UserException(ErrNo.EACCES,"String_Node_Str");
    final xtreemfs_restore_fileRequest rqArgs=(xtreemfs_restore_fileRequest)rq.getRequestArgs();
    final VolumeManager vMan=master.getVolumeManager();
    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");
    }
    final Path p=new Path(vMan.getVolumeById(volumeId).getName() + "String_Node_Str" + rqArgs.getFile_path());
    final StorageManager sMan=vMan.getStorageManager(volumeId);
    AtomicDBUpdate update=sMan.createAtomicDBUpdate(master,rq);
    int time=(int)(TimeSync.getGlobalTime() / 1000);
    long nextFileId=sMan.getNextFileId();
    FileMetadata[] path=sMan.resolvePath(p);
    long parentId=1;
    for (int i=0; i < p.getCompCount(); i++)     try {
      if (path[i] != null)       parentId=path[i].getId();
 else {
        sMan.createDir(nextFileId,parentId,p.getComp(i),time,time,time,rq.getDetails().userId,rq.getDetails().groupIds.get(0),509,0,update);
        parentId=nextFileId;
        nextFileId++;
        sMan.setLastFileId(nextFileId,update);
      }
    }
 catch (    DatabaseException exc) {
      if (exc.getType() != ExceptionType.FILE_EXISTS)       throw exc;
    }
    FileMetadata file=sMan.createFile(fileId,parentId,rqArgs.getFile_id(),time,time,time,rq.getDetails().userId,rq.getDetails().groupIds.get(0),511,0,rqArgs.getFile_size(),false,0,0,update);
    int size=(rqArgs.getStripe_size() < 1024 ? 1 : (rqArgs.getStripe_size() % 1024 != 0) ? rqArgs.getStripe_size() / 1024 + 1 : rqArgs.getStripe_size() / 1024);
    StripingPolicy sp=sMan.createStripingPolicy("String_Node_Str",size,1);
    XLoc replica=sMan.createXLoc(sp,new String[]{rqArgs.getOsd_uuid()});
    XLocList xLocList=sMan.createXLocList(new XLoc[]{replica},0);
    file.setXLocList(xLocList);
    sMan.setMetadata(file,FileMetadata.XLOC_METADATA,update);
    rq.setResponse(new xtreemfs_restore_fileResponse());
    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));
  }
}