Program: 14568
Project: 14568
Buggy source:
public CreateStorageVolumeResponseType CreateStorageVolume(CreateStorageVolumeType request) throws EucalyptusCloudException {
  CreateStorageVolumeResponseType reply=(CreateStorageVolumeResponseType)request.getReply();
  if (!StorageProperties.enableStorage) {
    LOG.error("String_Node_Str");
    return reply;
  }
  String snapshotId=request.getSnapshotId();
  String parentVolumeId=request.getParentVolumeId();
  String userId=request.getUserId();
  String volumeId=request.getVolumeId();
  String size=request.getSize();
  int sizeAsInt=0;
  if (StorageProperties.shouldEnforceUsageLimits && StorageProperties.trackUsageStatistics) {
    if (size != null) {
      sizeAsInt=Integer.parseInt(size);
      int totalVolumeSize=(int)(blockStorageStatistics.getTotalSpaceUsed() / StorageProperties.GB);
      ;
      if (((totalVolumeSize + sizeAsInt) > StorageInfo.getStorageInfo().getMaxTotalVolumeSizeInGb()) || (sizeAsInt > StorageInfo.getStorageInfo().getMaxVolumeSizeInGB()))       throw new EntityTooLargeException(volumeId);
    }
  }
  EntityWrapper<VolumeInfo> db=StorageProperties.getEntityWrapper();
  VolumeInfo volumeInfo=new VolumeInfo(volumeId);
  List<VolumeInfo> volumeInfos=db.query(volumeInfo);
  if (volumeInfos.size() > 0) {
    db.rollback();
    throw new VolumeAlreadyExistsException(volumeId);
  }
  if (snapshotId != null) {
    SnapshotInfo snapInfo=new SnapshotInfo(snapshotId);
    snapInfo.setScName(null);
    snapInfo.setStatus(StorageProperties.Status.available.toString());
    EntityWrapper<SnapshotInfo> dbSnap=db.recast(SnapshotInfo.class);
    List<SnapshotInfo> snapInfos=dbSnap.query(snapInfo);
    if (snapInfos.size() == 0) {
      db.rollback();
      throw new NoSuchEntityException("String_Node_Str" + snapshotId + "String_Node_Str");
    }
    volumeInfo.setSnapshotId(snapshotId);
    reply.setSnapshotId(snapshotId);
  }
  volumeInfo.setUserName(userId);
  volumeInfo.setSize(sizeAsInt);
  volumeInfo.setStatus(StorageProperties.Status.creating.toString());
  Date creationDate=new Date();
  volumeInfo.setCreateTime(creationDate);
  db.add(volumeInfo);
  reply.setVolumeId(volumeId);
  reply.setCreateTime(DateUtils.format(creationDate.getTime(),DateUtils.ISO8601_DATETIME_PATTERN) + "String_Node_Str");
  reply.setSize(size);
  reply.setStatus(volumeInfo.getStatus());
  db.commit();
  VolumeCreator volumeCreator=new VolumeCreator(volumeId,"String_Node_Str",snapshotId,parentVolumeId,sizeAsInt);
  volumeService.add(volumeCreator);
  return reply;
}

Fixed version (ground truth):
public CreateStorageVolumeResponseType CreateStorageVolume(CreateStorageVolumeType request) throws EucalyptusCloudException {
  CreateStorageVolumeResponseType reply=(CreateStorageVolumeResponseType)request.getReply();
  if (!StorageProperties.enableStorage) {
    LOG.error("String_Node_Str");
    return reply;
  }
  String snapshotId=request.getSnapshotId();
  String parentVolumeId=request.getParentVolumeId();
  String userId=request.getUserId();
  String volumeId=request.getVolumeId();
  String size=request.getSize();
  int sizeAsInt=0;
  if (StorageProperties.shouldEnforceUsageLimits && StorageProperties.trackUsageStatistics) {
    if (size != null) {
      sizeAsInt=Integer.parseInt(size);
      int totalVolumeSize=(int)(blockStorageStatistics.getTotalSpaceUsed() / StorageProperties.GB);
      if (((totalVolumeSize + sizeAsInt) > StorageInfo.getStorageInfo().getMaxTotalVolumeSizeInGb())) {
        throw new VolumeSizeExceededException(volumeId,"String_Node_Str");
      }
      if (sizeAsInt > StorageInfo.getStorageInfo().getMaxVolumeSizeInGB()) {
        throw new VolumeSizeExceededException(volumeId,"String_Node_Str");
      }
    }
  }
  EntityWrapper<VolumeInfo> db=StorageProperties.getEntityWrapper();
  VolumeInfo volumeInfo=new VolumeInfo(volumeId);
  List<VolumeInfo> volumeInfos=db.query(volumeInfo);
  if (volumeInfos.size() > 0) {
    db.rollback();
    throw new VolumeAlreadyExistsException(volumeId);
  }
  if (snapshotId != null) {
    SnapshotInfo snapInfo=new SnapshotInfo(snapshotId);
    snapInfo.setScName(null);
    snapInfo.setStatus(StorageProperties.Status.available.toString());
    EntityWrapper<SnapshotInfo> dbSnap=db.recast(SnapshotInfo.class);
    List<SnapshotInfo> snapInfos=dbSnap.query(snapInfo);
    if (snapInfos.size() == 0) {
      db.rollback();
      throw new NoSuchEntityException("String_Node_Str" + snapshotId + "String_Node_Str");
    }
    volumeInfo.setSnapshotId(snapshotId);
    reply.setSnapshotId(snapshotId);
  }
  volumeInfo.setUserName(userId);
  volumeInfo.setSize(sizeAsInt);
  volumeInfo.setStatus(StorageProperties.Status.creating.toString());
  Date creationDate=new Date();
  volumeInfo.setCreateTime(creationDate);
  db.add(volumeInfo);
  reply.setVolumeId(volumeId);
  reply.setCreateTime(DateUtils.format(creationDate.getTime(),DateUtils.ISO8601_DATETIME_PATTERN) + "String_Node_Str");
  reply.setSize(size);
  reply.setStatus(volumeInfo.getStatus());
  db.commit();
  VolumeCreator volumeCreator=new VolumeCreator(volumeId,"String_Node_Str",snapshotId,parentVolumeId,sizeAsInt);
  volumeService.add(volumeCreator);
  return reply;
}