Program: 15293
Project: 15293
Buggy source:
public CreateVolumeResponseType CreateVolume(final CreateVolumeType request) throws EucalyptusCloudException {
  Context ctx=Contexts.lookup();
  String action=PolicySpec.requestToAction(request);
  if (!ctx.hasAdministrativePrivileges() && !Permissions.isAuthorized(PolicySpec.VENDOR_EC2,PolicySpec.EC2_RESOURCE_VOLUME,"String_Node_Str",ctx.getAccount(),action,ctx.getUser())) {
    throw new EucalyptusCloudException("String_Node_Str" + ctx.getUser().getName());
  }
  Long volSize=Long.parseLong(request.getSize());
  final String snapId=request.getSnapshotId();
  String partition=request.getAvailabilityZone();
  if (!ctx.hasAdministrativePrivileges() && !Permissions.canAllocate(PolicySpec.VENDOR_EC2,PolicySpec.EC2_RESOURCE_VOLUME,"String_Node_Str",action,ctx.getUser(),volSize)) {
    throw new EucalyptusCloudException("String_Node_Str" + ctx.getUser().getName());
  }
  if ((request.getSnapshotId() == null && request.getSize() == null)) {
    throw new EucalyptusCloudException("String_Node_Str");
  }
  if (snapId != null) {
    try {
      Snapshots.lookup(snapId);
    }
 catch (    ExecutionException ex) {
      throw new EucalyptusCloudException("String_Node_Str" + snapId);
    }
  }
  Integer newSize=new Integer(request.getSize() != null ? request.getSize() : "String_Node_Str");
  Exception lastEx=null;
  for (int i=0; i < VOL_CREATE_RETRIES; i++) {
    try {
      final ServiceConfiguration sc=Partitions.lookupService(Storage.class,partition);
      UserFullName owner=ctx.getUserFullName();
      Volume newVol=Volumes.createStorageVolume(sc,owner,snapId,newSize,request);
      CreateVolumeResponseType reply=request.getReply();
      reply.setVolume(newVol.morph(new edu.ucsb.eucalyptus.msgs.Volume()));
      return reply;
    }
 catch (    ExecutionException ex) {
      LOG.error(ex,ex);
      lastEx=ex;
    }
  }
  throw new EucalyptusCloudException("String_Node_Str" + VOL_CREATE_RETRIES + "String_Node_Str"+ lastEx,lastEx);
}

Fixed version (ground truth):
public CreateVolumeResponseType CreateVolume(final CreateVolumeType request) throws EucalyptusCloudException {
  Context ctx=Contexts.lookup();
  String action=PolicySpec.requestToAction(request);
  if (!ctx.hasAdministrativePrivileges() && !Permissions.isAuthorized(PolicySpec.VENDOR_EC2,PolicySpec.EC2_RESOURCE_VOLUME,"String_Node_Str",ctx.getAccount(),action,ctx.getUser())) {
    throw new EucalyptusCloudException("String_Node_Str" + ctx.getUser().getName());
  }
  Long volSize=request.getSize() != null ? Long.parseLong(request.getSize()) : null;
  final String snapId=request.getSnapshotId();
  String partition=request.getAvailabilityZone();
  if (!ctx.hasAdministrativePrivileges() && !Permissions.canAllocate(PolicySpec.VENDOR_EC2,PolicySpec.EC2_RESOURCE_VOLUME,"String_Node_Str",action,ctx.getUser(),volSize)) {
    throw new EucalyptusCloudException("String_Node_Str" + ctx.getUser().getName());
  }
  if ((request.getSnapshotId() == null && request.getSize() == null)) {
    throw new EucalyptusCloudException("String_Node_Str");
  }
  if (snapId != null) {
    try {
      Snapshots.lookup(snapId);
    }
 catch (    ExecutionException ex) {
      throw new EucalyptusCloudException("String_Node_Str" + snapId);
    }
  }
  Integer newSize=new Integer(request.getSize() != null ? request.getSize() : "String_Node_Str");
  Exception lastEx=null;
  for (int i=0; i < VOL_CREATE_RETRIES; i++) {
    try {
      final ServiceConfiguration sc=Partitions.lookupService(Storage.class,partition);
      UserFullName owner=ctx.getUserFullName();
      Volume newVol=Volumes.createStorageVolume(sc,owner,snapId,newSize,request);
      CreateVolumeResponseType reply=request.getReply();
      reply.setVolume(newVol.morph(new edu.ucsb.eucalyptus.msgs.Volume()));
      return reply;
    }
 catch (    ExecutionException ex) {
      LOG.error(ex,ex);
      lastEx=ex;
    }
  }
  throw new EucalyptusCloudException("String_Node_Str" + VOL_CREATE_RETRIES + "String_Node_Str"+ lastEx,lastEx);
}