Program: 14136
Project: 14136
Buggy source:
public DeleteVolumeResponseType DeleteVolume(final DeleteVolumeType request) throws EucalyptusCloudException {
  DeleteVolumeResponseType reply=(DeleteVolumeResponseType)request.getReply();
  final Context ctx=Contexts.lookup();
  reply.set_return(false);
  final Function<String,Volume> deleteVolume=new Function<String,Volume>(){
    @Override public Volume apply(    final String input){
      try {
        Volume vol=null;
        try {
          vol=Entities.uniqueResult(Volume.named(ctx.getUserFullName().asAccountFullName(),input));
        }
 catch (        NoSuchElementException e) {
          try {
            vol=Entities.uniqueResult(Volume.named(null,input));
          }
 catch (          NoSuchElementException e2) {
            throw Exceptions.toUndeclared(new ClientComputeException("String_Node_Str","String_Node_Str" + input + "String_Node_Str"));
          }
        }
        if (!RestrictedTypes.filterPrivileged().apply(vol)) {
          throw Exceptions.toUndeclared("String_Node_Str" + ctx.getUser().getName());
        }
        try {
          VmVolumeAttachment attachment=VmInstances.lookupVolumeAttachment(input);
          throw Exceptions.toUndeclared(new ClientComputeException("String_Node_Str","String_Node_Str" + attachment.getVmInstance().getDisplayName()));
        }
 catch (        NoSuchElementException ex) {
        }
        if (State.FAIL.equals(vol.getState()) || State.ANNIHILATED.equals(vol.getState())) {
          Entities.delete(vol);
          return vol;
        }
 else {
          try {
            ServiceConfiguration sc=Topology.lookup(Storage.class,Partitions.lookupByName(vol.getPartition()));
            DeleteStorageVolumeResponseType scReply=AsyncRequests.sendSync(sc,new DeleteStorageVolumeType(vol.getDisplayName()));
            if (scReply.get_return()) {
              Volumes.annihilateStorageVolume(vol);
              return vol;
            }
 else {
              throw Exceptions.toUndeclared("String_Node_Str");
            }
          }
 catch (          Exception ex) {
            throw Exceptions.toUndeclared("String_Node_Str" + ex.getMessage(),ex);
          }
        }
      }
 catch (      NoSuchElementException ex) {
        throw ex;
      }
catch (      TransactionException ex) {
        throw Exceptions.toUndeclared("String_Node_Str",ex);
      }
    }
  }
;
  try {
    Entities.asTransaction(Volume.class,deleteVolume).apply(normalizeVolumeIdentifier(request.getVolumeId()));
    reply.set_return(true);
    return reply;
  }
 catch (  NoSuchElementException ex) {
    return reply;
  }
catch (  RuntimeException ex) {
    Exceptions.rethrow(ex,ComputeException.class);
    throw ex;
  }
}

Fixed version (ground truth):
public DeleteVolumeResponseType DeleteVolume(final DeleteVolumeType request) throws EucalyptusCloudException {
  DeleteVolumeResponseType reply=(DeleteVolumeResponseType)request.getReply();
  final Context ctx=Contexts.lookup();
  reply.set_return(false);
  final Function<String,Volume> deleteVolume=new Function<String,Volume>(){
    @Override public Volume apply(    final String input){
      try {
        Volume vol=null;
        try {
          vol=Entities.uniqueResult(Volume.named(ctx.getUserFullName().asAccountFullName(),input));
        }
 catch (        NoSuchElementException e) {
          try {
            vol=Entities.uniqueResult(Volume.named(null,input));
          }
 catch (          NoSuchElementException e2) {
            throw Exceptions.toUndeclared(new ClientComputeException("String_Node_Str","String_Node_Str" + input + "String_Node_Str"));
          }
        }
        if (!RestrictedTypes.filterPrivileged().apply(vol)) {
          throw Exceptions.toUndeclared(new ClientUnauthorizedComputeException("String_Node_Str" + ctx.getUser().getName()));
        }
        try {
          VmVolumeAttachment attachment=VmInstances.lookupVolumeAttachment(input);
          throw Exceptions.toUndeclared(new ClientComputeException("String_Node_Str","String_Node_Str" + attachment.getVmInstance().getDisplayName()));
        }
 catch (        NoSuchElementException ex) {
        }
        if (State.FAIL.equals(vol.getState()) || State.ANNIHILATED.equals(vol.getState())) {
          Entities.delete(vol);
          return vol;
        }
 else {
          try {
            ServiceConfiguration sc=Topology.lookup(Storage.class,Partitions.lookupByName(vol.getPartition()));
            DeleteStorageVolumeResponseType scReply=AsyncRequests.sendSync(sc,new DeleteStorageVolumeType(vol.getDisplayName()));
            if (scReply.get_return()) {
              Volumes.annihilateStorageVolume(vol);
              return vol;
            }
 else {
              throw Exceptions.toUndeclared("String_Node_Str");
            }
          }
 catch (          Exception ex) {
            throw Exceptions.toUndeclared("String_Node_Str" + ex.getMessage(),ex);
          }
        }
      }
 catch (      NoSuchElementException ex) {
        throw ex;
      }
catch (      TransactionException ex) {
        throw Exceptions.toUndeclared("String_Node_Str",ex);
      }
    }
  }
;
  try {
    Entities.asTransaction(Volume.class,deleteVolume).apply(normalizeVolumeIdentifier(request.getVolumeId()));
    reply.set_return(true);
    return reply;
  }
 catch (  NoSuchElementException ex) {
    return reply;
  }
catch (  RuntimeException ex) {
    Exceptions.rethrow(ex,ComputeException.class);
    throw ex;
  }
}