Program: 113843
Project: 113843
Buggy source:
@Override public void startRequest(MRCRequest rq){
  try {
    Args rqArgs=(Args)rq.getRequestArgs();
    final VolumeManager vMan=master.getVolumeManager();
    final FileAccessManager faMan=master.getFileAccessManager();
    Path p=new Path(rqArgs.path);
    VolumeInfo volume=vMan.getVolumeByName(p.getComp(0));
    StorageManager sMan=vMan.getStorageManager(volume.getId());
    PathResolver res=new PathResolver(sMan,p);
    faMan.checkSearchPermission(sMan,res,rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
    res.checkIfFileDoesNotExist();
    FileMetadata file=res.getFile();
    String target=sMan.getSoftlinkTarget(file.getId());
    if (target != null) {
      rqArgs.path=target;
      p=new Path(rqArgs.path);
      if (!vMan.hasVolume(p.getComp(0))) {
        finishRequest(rq,new ErrorRecord(ErrorClass.REDIRECT,target));
        return;
      }
      volume=vMan.getVolumeByName(p.getComp(0));
      sMan=vMan.getStorageManager(volume.getId());
      res=new PathResolver(sMan,p);
      file=res.getFile();
    }
    if (file.isDirectory())     throw new UserException(ErrNo.EISDIR,"String_Node_Str");
    AccessMode mode=null;
    try {
      mode=AccessMode.valueOf(rqArgs.accessMode);
    }
 catch (    IllegalArgumentException exc) {
      throw new UserException(ErrNo.EINVAL,"String_Node_Str" + rqArgs.accessMode);
    }
    if ((mode == AccessMode.w || mode == AccessMode.a || mode == AccessMode.ga || mode == AccessMode.t) && file.isReadOnly())     throw new UserException(ErrNo.EPERM,"String_Node_Str");
    AtomicDBUpdate update=null;
    if (mode == AccessMode.t) {
      update=sMan.createAtomicDBUpdate(master,rq);
      file.setIssuedEpoch(file.getIssuedEpoch() + 1);
      sMan.setMetadata(file,FileMetadata.RC_METADATA,update);
    }
    faMan.checkPermission(rqArgs.accessMode,sMan,file,res.getParentDirId(),rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
    String capability=MRCOpHelper.createCapability(rqArgs.accessMode,volume.getId(),file.getId(),file.getIssuedEpoch(),master.getConfig().getCapabilitySecret()).toString();
    XLocList xLocList=file.getXLocList();
    if (xLocList == null || !xLocList.iterator().hasNext()) {
      xLocList=MRCOpHelper.createXLocList(xLocList,sMan,master.getOSDStatusManager(),res.toString(),file.getId(),res.getParentDirId(),volume,rq.getPinkyRequest().getClientAddress());
      file.setXLocList(xLocList);
      if (update == null)       update=sMan.createAtomicDBUpdate(master,rq);
      sMan.setMetadata(file,FileMetadata.XLOC_METADATA,update);
    }
    HTTPHeaders headers=MRCOpHelper.createXCapHeaders(capability,xLocList);
    rq.setAdditionalResponseHeaders(headers);
    rq.setData(ReusableBuffer.wrap(JSONParser.writeJSON(null).getBytes()));
    if (update == null)     update=sMan.createAtomicDBUpdate(master,rq);
    if (!master.getConfig().isNoAtime())     MRCOpHelper.updateFileTimes(res.getParentsParentId(),res.getParentDir(),true,false,false,sMan,update);
    if (update != null)     update.execute();
 else     finishRequest(rq);
  }
 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 {
    Args rqArgs=(Args)rq.getRequestArgs();
    final VolumeManager vMan=master.getVolumeManager();
    final FileAccessManager faMan=master.getFileAccessManager();
    Path p=new Path(rqArgs.path);
    VolumeInfo volume=vMan.getVolumeByName(p.getComp(0));
    StorageManager sMan=vMan.getStorageManager(volume.getId());
    PathResolver res=new PathResolver(sMan,p);
    faMan.checkSearchPermission(sMan,res,rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
    res.checkIfFileDoesNotExist();
    FileMetadata file=res.getFile();
    String target=sMan.getSoftlinkTarget(file.getId());
    if (target != null) {
      rqArgs.path=target;
      p=new Path(rqArgs.path);
      if (!vMan.hasVolume(p.getComp(0))) {
        finishRequest(rq,new ErrorRecord(ErrorClass.REDIRECT,target));
        return;
      }
      volume=vMan.getVolumeByName(p.getComp(0));
      sMan=vMan.getStorageManager(volume.getId());
      res=new PathResolver(sMan,p);
      file=res.getFile();
    }
    if (file.isDirectory())     throw new UserException(ErrNo.EISDIR,"String_Node_Str");
    AccessMode mode=null;
    try {
      mode=AccessMode.valueOf(rqArgs.accessMode);
    }
 catch (    IllegalArgumentException exc) {
      throw new UserException(ErrNo.EINVAL,"String_Node_Str" + rqArgs.accessMode);
    }
    if ((mode == AccessMode.w || mode == AccessMode.a || mode == AccessMode.ga || mode == AccessMode.t) && file.isReadOnly())     throw new UserException(ErrNo.EPERM,"String_Node_Str");
    faMan.checkPermission(rqArgs.accessMode,sMan,file,res.getParentDirId(),rq.getDetails().userId,rq.getDetails().superUser,rq.getDetails().groupIds);
    AtomicDBUpdate update=null;
    if (mode == AccessMode.t) {
      update=sMan.createAtomicDBUpdate(master,rq);
      file.setIssuedEpoch(file.getIssuedEpoch() + 1);
      sMan.setMetadata(file,FileMetadata.RC_METADATA,update);
    }
    String capability=MRCOpHelper.createCapability(rqArgs.accessMode,volume.getId(),file.getId(),file.getIssuedEpoch(),master.getConfig().getCapabilitySecret()).toString();
    XLocList xLocList=file.getXLocList();
    if (xLocList == null || !xLocList.iterator().hasNext()) {
      StripingPolicy sp=sMan.getDefaultStripingPolicy(file.getId());
      xLocList=MRCOpHelper.createXLocList(sp,xLocList,sMan,master.getOSDStatusManager(),res.toString(),file.getId(),res.getParentDirId(),volume,rq.getPinkyRequest().getClientAddress());
      file.setXLocList(xLocList);
      if (update == null)       update=sMan.createAtomicDBUpdate(master,rq);
      sMan.setMetadata(file,FileMetadata.XLOC_METADATA,update);
    }
    HTTPHeaders headers=MRCOpHelper.createXCapHeaders(capability,xLocList);
    rq.setAdditionalResponseHeaders(headers);
    rq.setData(ReusableBuffer.wrap(JSONParser.writeJSON(null).getBytes()));
    if (update == null)     update=sMan.createAtomicDBUpdate(master,rq);
    if (!master.getConfig().isNoAtime())     MRCOpHelper.updateFileTimes(res.getParentsParentId(),res.getParentDir(),true,false,false,sMan,update);
    if (update != null)     update.execute();
 else     finishRequest(rq);
  }
 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));
  }
}