Program: 113364
Project: 113364
Buggy source:
@Override public void startRequest(MRCRequest rq) throws Throwable {
  final xtreemfs_renew_capabilityRequest renewCapabilityRequest=(xtreemfs_renew_capabilityRequest)rq.getRequestArgs();
  Capability cap=new Capability(renewCapabilityRequest.getXcap(),master.getConfig().getCapabilitySecret());
  Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + cap.getFileId() + "String_Node_Str"+ cap.getClientIdentity()+ "String_Node_Str"+ "String_Node_Str"+ renewCapabilityRequest.getIncreaseVoucher());
  if (!cap.hasValidSignature())   throw new UserException(POSIXErrno.POSIX_ERROR_EPERM,cap + "String_Node_Str");
  if (cap.hasExpired() && !renewTimedOutCaps)   throw new UserException(POSIXErrno.POSIX_ERROR_EPERM,cap + "String_Node_Str");
  long newExpireMs=TimeSync.getGlobalTime() + master.getConfig().getCapabilityTimeout() * 1000;
  long voucherSize=cap.getVoucherSize();
  if (renewCapabilityRequest.getIncreaseVoucher()) {
    GlobalFileIdResolver globalFileIdResolver=new GlobalFileIdResolver(cap.getFileId());
    StorageManager sMan=master.getVolumeManager().getStorageManager(globalFileIdResolver.getVolumeId());
    AtomicDBUpdate update=sMan.createAtomicDBUpdate(null,null);
    voucherSize=master.getMrcVoucherManager().checkAndRenewVoucher(cap.getFileId(),cap.getClientIdentity(),cap.getExpireMs(),newExpireMs,update);
    update.execute();
  }
 else {
    master.getMrcVoucherManager().addRenewedTimestamp(cap.getFileId(),cap.getClientIdentity(),cap.getExpireMs(),newExpireMs);
  }
  Capability newCap=new Capability(cap.getFileId(),cap.getAccessMode(),master.getConfig().getCapabilityTimeout(),TimeSync.getGlobalTime() / 1000 + master.getConfig().getCapabilityTimeout(),cap.getClientIdentity(),cap.getEpochNo(),cap.isReplicateOnClose(),cap.getSnapConfig(),cap.getSnapTimestamp(),voucherSize,newExpireMs,master.getConfig().getCapabilitySecret());
  rq.setResponse(newCap.getXCap());
  finishRequest(rq);
}

Fixed version (ground truth):
@Override public void startRequest(MRCRequest rq) throws Throwable {
  final xtreemfs_renew_capabilityRequest renewCapabilityRequest=(xtreemfs_renew_capabilityRequest)rq.getRequestArgs();
  Capability cap=new Capability(renewCapabilityRequest.getXcap(),master.getConfig().getCapabilitySecret());
  Logging.logMessage(Logging.LEVEL_DEBUG,this,"String_Node_Str" + cap.getFileId() + "String_Node_Str"+ cap.getClientIdentity()+ "String_Node_Str"+ "String_Node_Str"+ renewCapabilityRequest.getIncreaseVoucher());
  if (!cap.hasValidSignature())   throw new UserException(POSIXErrno.POSIX_ERROR_EPERM,cap + "String_Node_Str");
  if (cap.hasExpired() && !renewTimedOutCaps)   throw new UserException(POSIXErrno.POSIX_ERROR_EPERM,cap + "String_Node_Str");
  long newExpireMs=TimeSync.getGlobalTime() + master.getConfig().getCapabilityTimeout() * 1000;
  long voucherSize=cap.getVoucherSize();
  if (MRCVoucherManager.checkManageableAccess(cap.getAccessMode())) {
    if (renewCapabilityRequest.getIncreaseVoucher()) {
      GlobalFileIdResolver globalFileIdResolver=new GlobalFileIdResolver(cap.getFileId());
      StorageManager sMan=master.getVolumeManager().getStorageManager(globalFileIdResolver.getVolumeId());
      AtomicDBUpdate update=sMan.createAtomicDBUpdate(null,null);
      voucherSize=master.getMrcVoucherManager().checkAndRenewVoucher(cap.getFileId(),cap.getClientIdentity(),cap.getExpireMs(),newExpireMs,update);
      update.execute();
    }
 else {
      master.getMrcVoucherManager().addRenewedTimestamp(cap.getFileId(),cap.getClientIdentity(),cap.getExpireMs(),newExpireMs);
    }
  }
  Capability newCap=new Capability(cap.getFileId(),cap.getAccessMode(),master.getConfig().getCapabilityTimeout(),TimeSync.getGlobalTime() / 1000 + master.getConfig().getCapabilityTimeout(),cap.getClientIdentity(),cap.getEpochNo(),cap.isReplicateOnClose(),cap.getSnapConfig(),cap.getSnapTimestamp(),voucherSize,newExpireMs,master.getConfig().getCapabilitySecret());
  rq.setResponse(newCap.getXCap());
  finishRequest(rq);
}