Program: 113635
Project: 113635
Buggy source:
@Override public void startRequest(MRCRequest rq) throws Throwable {
  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();
  GlobalFileIdResolver idRes=new GlobalFileIdResolver(rqArgs.getFile_id());
  final Path p=new Path(vMan.getVolumeById(idRes.getVolumeId()).getName() + "String_Node_Str" + rqArgs.getFile_path());
  final StorageManager sMan=vMan.getStorageManager(idRes.getVolumeId());
  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(idRes.getLocalFileId(),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},Constants.REPL_UPDATE_PC_NONE,0);
  file.setXLocList(xLocList);
  sMan.setMetadata(file,FileMetadata.XLOC_METADATA,update);
  rq.setResponse(new xtreemfs_restore_fileResponse());
  update.execute();
}

Fixed version (ground truth):
@Override public void startRequest(MRCRequest rq) throws Throwable {
  final xtreemfs_restore_fileRequest rqArgs=(xtreemfs_restore_fileRequest)rq.getRequestArgs();
  final VolumeManager vMan=master.getVolumeManager();
  GlobalFileIdResolver idRes=new GlobalFileIdResolver(rqArgs.getFile_id());
  final Path p=new Path(vMan.getVolumeById(idRes.getVolumeId()).getName() + "String_Node_Str" + rqArgs.getFile_path());
  final StorageManager sMan=vMan.getStorageManager(idRes.getVolumeId());
  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(idRes.getLocalFileId(),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},Constants.REPL_UPDATE_PC_NONE,0);
  file.setXLocList(xLocList);
  sMan.setMetadata(file,FileMetadata.XLOC_METADATA,update);
  rq.setResponse(new xtreemfs_restore_fileResponse());
  update.execute();
}