Program: 113838
Project: 113838
Buggy source:
@Override public void startRequest(MRCRequest rq){
  try {
    String capString=rq.getPinkyRequest().requestHeaders.getHeader(HTTPHeaders.HDR_XCAPABILITY);
    String newSizeString=rq.getPinkyRequest().requestHeaders.getHeader(HTTPHeaders.HDR_XNEWFILESIZE);
    if (capString == null)     throw new UserException("String_Node_Str" + HTTPHeaders.HDR_XCAPABILITY + "String_Node_Str");
    if (newSizeString == null)     throw new UserException("String_Node_Str" + HTTPHeaders.HDR_XNEWFILESIZE + "String_Node_Str");
    Capability cap=new Capability(capString,master.getConfig().getCapabilitySecret());
    if (!cap.isValid())     throw new UserException(capString + "String_Node_Str");
    long fileId=0;
    String volumeId=null;
    try {
      String globalFileId=cap.getFileId();
      int i=globalFileId.indexOf(':');
      volumeId=cap.getFileId().substring(0,i);
      fileId=Long.parseLong(cap.getFileId().substring(i + 1));
    }
 catch (    Exception exc) {
      throw new UserException("String_Node_Str" + cap.getFileId() + "String_Node_Str");
    }
    StorageManager sMan=master.getVolumeManager().getStorageManager(volumeId);
    FileMetadata file=sMan.getMetadata(fileId);
    if (file == null)     throw new UserException(ErrNo.ENOENT,"String_Node_Str" + fileId + "String_Node_Str");
    int index=newSizeString.indexOf(',');
    if (index == -1)     throw new UserException(ErrNo.EINVAL,"String_Node_Str" + HTTPHeaders.HDR_XNEWFILESIZE + "String_Node_Str");
    long newFileSize=0;
    int epochNo=0;
    try {
      newFileSize=Long.parseLong(newSizeString.substring(1,index));
      epochNo=Integer.parseInt(newSizeString.substring(index + 1,newSizeString.length() - 1));
    }
 catch (    NumberFormatException exc) {
      throw new UserException("String_Node_Str" + newSizeString);
    }
    rq.setData(ReusableBuffer.wrap(JSONParser.writeJSON(null).getBytes()));
    if (epochNo < file.getEpoch()) {
      finishRequest(rq);
      return;
    }
    if (epochNo > file.getEpoch() || newFileSize > file.getSize()) {
      file.setSize(newFileSize);
      file.setEpoch(epochNo);
      AtomicDBUpdate update=sMan.createAtomicDBUpdate(master,rq);
      sMan.setMetadata(file,FileMetadata.FC_METADATA,update);
      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 {
    String capString=rq.getPinkyRequest().requestHeaders.getHeader(HTTPHeaders.HDR_XCAPABILITY);
    String newSizeString=rq.getPinkyRequest().requestHeaders.getHeader(HTTPHeaders.HDR_XNEWFILESIZE);
    if (capString == null)     throw new UserException("String_Node_Str" + HTTPHeaders.HDR_XCAPABILITY + "String_Node_Str");
    if (newSizeString == null)     throw new UserException("String_Node_Str" + HTTPHeaders.HDR_XNEWFILESIZE + "String_Node_Str");
    Capability cap=new Capability(capString,master.getConfig().getCapabilitySecret());
    if (!cap.isValid())     throw new UserException(capString + "String_Node_Str");
    long fileId=0;
    String volumeId=null;
    try {
      String globalFileId=cap.getFileId();
      int i=globalFileId.indexOf(':');
      volumeId=cap.getFileId().substring(0,i);
      fileId=Long.parseLong(cap.getFileId().substring(i + 1));
    }
 catch (    Exception exc) {
      throw new UserException("String_Node_Str" + cap.getFileId() + "String_Node_Str");
    }
    StorageManager sMan=master.getVolumeManager().getStorageManager(volumeId);
    FileMetadata file=sMan.getMetadata(fileId);
    if (file == null)     throw new UserException(ErrNo.ENOENT,"String_Node_Str" + fileId + "String_Node_Str");
    int index=newSizeString.indexOf(',');
    if (index == -1)     throw new UserException(ErrNo.EINVAL,"String_Node_Str" + HTTPHeaders.HDR_XNEWFILESIZE + "String_Node_Str");
    long newFileSize=0;
    int epochNo=0;
    try {
      newFileSize=Long.parseLong(newSizeString.substring(1,index));
      epochNo=Integer.parseInt(newSizeString.substring(index + 1,newSizeString.length() - 1));
    }
 catch (    NumberFormatException exc) {
      throw new UserException("String_Node_Str" + newSizeString);
    }
    rq.setData(ReusableBuffer.wrap(JSONParser.writeJSON(null).getBytes()));
    if (epochNo < file.getEpoch()) {
      finishRequest(rq);
      return;
    }
    if (epochNo > file.getEpoch() || newFileSize > file.getSize()) {
      int time=(int)(TimeSync.getGlobalTime() / 1000);
      file.setSize(newFileSize);
      file.setEpoch(epochNo);
      file.setCtime(time);
      file.setMtime(time);
      AtomicDBUpdate update=sMan.createAtomicDBUpdate(master,rq);
      sMan.setMetadata(file,FileMetadata.FC_METADATA,update);
      sMan.setMetadata(file,FileMetadata.RC_METADATA,update);
      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));
  }
}