Program: 15290
Project: 15290
Buggy source:
public DeleteSnapshotResponseType delete(final DeleteSnapshotType request) throws EucalyptusCloudException {
  final DeleteSnapshotResponseType reply=(DeleteSnapshotResponseType)request.getReply();
  reply.set_return(false);
  final Context ctx=Contexts.lookup();
  try {
    Transactions.one(Snapshot.named(ctx.getUserFullName(),request.getSnapshotId()),new Callback<Snapshot>(){
      @Override public void fire(      Snapshot snap){
        if (!State.EXTANT.equals(snap.getState())) {
          reply.set_return(false);
          return;
        }
        if (!Lookups.checkPrivilege(request,PolicySpec.VENDOR_EC2,PolicySpec.EC2_RESOURCE_SNAPSHOT,request.getSnapshotId(),snap.getOwner())) {
          throw Exceptions.undeclared("String_Node_Str" + request.getSnapshotId() + "String_Node_Str"+ ctx.getUser().getName(),new EucalyptusCloudException());
        }
        Transactions.join().delete(snap);
        ServiceConfiguration sc=Partitions.lookupService(Storage.class,snap.getVolumePartition());
        try {
          DeleteStorageSnapshotResponseType scReply=ServiceDispatcher.lookup(sc).send(new DeleteStorageSnapshotType(snap.getDisplayName()));
          if (scReply.get_return()) {
            StorageUtil.dispatchAll(new DeleteStorageSnapshotType(snap.getDisplayName()));
            try {
              ListenerRegistry.getInstance().fireEvent(new StorageEvent(StorageEvent.EventType.EbsSnapshot,true,snap.getVolumeSize(),snap.getOwnerUserId(),snap.getOwnerAccountId(),snap.getVolumeCluster(),snap.getVolumePartition()));
            }
 catch (            EventFailedException ex) {
              LOG.error(ex,ex);
            }
          }
 else {
            throw Exceptions.undeclared("String_Node_Str",new EucalyptusCloudException());
          }
        }
 catch (        EucalyptusCloudException ex1) {
          throw Exceptions.undeclared(ex1.getMessage(),ex1);
        }
      }
    }
);
  }
 catch (  ExecutionException ex1) {
    throw new EucalyptusCloudException(ex1.getCause());
  }
  reply.set_return(true);
  return reply;
}

Fixed version (ground truth):
public DeleteSnapshotResponseType delete(final DeleteSnapshotType request) throws EucalyptusCloudException {
  final DeleteSnapshotResponseType reply=(DeleteSnapshotResponseType)request.getReply();
  final Context ctx=Contexts.lookup();
  boolean result=false;
  try {
    result=Transactions.delete(Snapshot.named(ctx.getUserFullName(),request.getSnapshotId()),new Predicate<Snapshot>(){
      @Override public boolean apply(      Snapshot snap){
        if (!State.EXTANT.equals(snap.getState())) {
          return false;
        }
 else         if (!Lookups.checkPrivilege(request,PolicySpec.VENDOR_EC2,PolicySpec.EC2_RESOURCE_SNAPSHOT,request.getSnapshotId(),snap.getOwner())) {
          throw Exceptions.undeclared("String_Node_Str" + request.getSnapshotId() + "String_Node_Str"+ ctx.getUser().getName(),new EucalyptusCloudException());
        }
 else {
          ServiceConfiguration sc=Partitions.lookupService(Storage.class,snap.getVolumePartition());
          try {
            DeleteStorageSnapshotResponseType scReply=ServiceDispatcher.lookup(sc).send(new DeleteStorageSnapshotType(snap.getDisplayName()));
            if (scReply.get_return()) {
              StorageUtil.dispatchAll(new DeleteStorageSnapshotType(snap.getDisplayName()));
              try {
                ListenerRegistry.getInstance().fireEvent(new StorageEvent(StorageEvent.EventType.EbsSnapshot,true,snap.getVolumeSize(),snap.getOwnerUserId(),snap.getOwnerAccountId(),snap.getVolumeCluster(),snap.getVolumePartition()));
              }
 catch (              EventFailedException ex) {
                LOG.error(ex,ex);
              }
            }
 else {
              throw Exceptions.undeclared("String_Node_Str" + snap,new EucalyptusCloudException());
            }
          }
 catch (          EucalyptusCloudException ex1) {
            throw Exceptions.undeclared(ex1.getMessage(),ex1);
          }
          return true;
        }
      }
    }
);
  }
 catch (  ExecutionException ex1) {
    throw new EucalyptusCloudException(ex1.getCause());
  }
  reply.set_return(result);
  return reply;
}