Program: 14139
Project: 14139
Buggy source:
public DeleteSnapshotResponseType delete(final DeleteSnapshotType request) throws EucalyptusCloudException {
  final DeleteSnapshotResponseType reply=(DeleteSnapshotResponseType)request.getReply();
  final Context ctx=Contexts.lookup();
  final String snapshotId=normalizeSnapshotIdentifier(request.getSnapshotId());
  Predicate<Snapshot> deleteSnapshot=new Predicate<Snapshot>(){
    @Override public boolean apply(    Snapshot snap){
      if (!State.EXTANT.equals(snap.getState()) && !State.FAIL.equals(snap.getState())) {
        return false;
      }
 else       if (!RestrictedTypes.filterPrivileged().apply(snap)) {
        throw Exceptions.toUndeclared(new EucalyptusCloudException("String_Node_Str" + request.getSnapshotId() + "String_Node_Str"+ ctx.getUser().getName()));
      }
 else       if (isReservedSnapshot(snapshotId)) {
        throw Exceptions.toUndeclared(new EucalyptusCloudException("String_Node_Str" + request.getSnapshotId() + "String_Node_Str"));
      }
 else {
        fireUsageEvent(snap,SnapShotEvent.forSnapShotDelete());
        final String partition=snap.getPartition();
        final String snapshotId=snap.getDisplayName();
        Callable<Boolean> deleteBroadcast=new Callable<Boolean>(){
          public Boolean call(){
            final DeleteStorageSnapshotType deleteMsg=new DeleteStorageSnapshotType(snapshotId);
            return Iterables.all(Topology.enabledServices(Storage.class),new Predicate<ServiceConfiguration>(){
              @Override public boolean apply(              ServiceConfiguration arg0){
                if (!arg0.getPartition().equals(partition)) {
                  try {
                    AsyncRequests.sendSync(arg0,deleteMsg);
                  }
 catch (                  Exception ex) {
                    LOG.error(ex);
                    Logs.extreme().error(ex,ex);
                  }
                }
                return true;
              }
            }
);
          }
        }
;
        ServiceConfiguration sc=null;
        try {
          sc=Topology.lookup(Storage.class,Partitions.lookupByName(snap.getPartition()));
        }
 catch (        final Exception ex) {
          sc=null;
        }
        if (sc != null) {
          try {
            DeleteStorageSnapshotResponseType scReply=AsyncRequests.sendSync(sc,new DeleteStorageSnapshotType(snap.getDisplayName()));
            if (scReply.get_return()) {
              Threads.enqueue(Eucalyptus.class,Snapshots.class,deleteBroadcast);
            }
 else {
              throw Exceptions.toUndeclared(new EucalyptusCloudException("String_Node_Str" + snap));
            }
          }
 catch (          Exception ex1) {
            throw Exceptions.toUndeclared(ex1.getMessage(),ex1);
          }
        }
 else {
          Threads.enqueue(Eucalyptus.class,Snapshots.class,deleteBroadcast);
        }
        return true;
      }
    }
  }
;
  boolean result=false;
  try {
    result=Transactions.delete(Snapshot.named(ctx.getUserFullName().asAccountFullName(),snapshotId),deleteSnapshot);
  }
 catch (  NoSuchElementException ex2) {
    try {
      result=Transactions.delete(Snapshot.named(null,snapshotId),deleteSnapshot);
    }
 catch (    ExecutionException ex3) {
      throw new EucalyptusCloudException(ex3.getCause());
    }
catch (    NoSuchElementException ex4) {
      throw new ClientComputeException("String_Node_Str","String_Node_Str" + request.getSnapshotId() + "String_Node_Str");
    }
  }
catch (  ExecutionException ex1) {
    throw new EucalyptusCloudException(ex1.getCause());
  }
  reply.set_return(result);
  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();
  final String snapshotId=normalizeSnapshotIdentifier(request.getSnapshotId());
  Predicate<Snapshot> deleteSnapshot=new Predicate<Snapshot>(){
    @Override public boolean apply(    Snapshot snap){
      if (!State.EXTANT.equals(snap.getState()) && !State.FAIL.equals(snap.getState())) {
        return false;
      }
 else       if (!RestrictedTypes.filterPrivileged().apply(snap)) {
        throw Exceptions.toUndeclared(new ClientUnauthorizedComputeException("String_Node_Str" + request.getSnapshotId() + "String_Node_Str"+ ctx.getUser().getName()));
      }
 else       if (isReservedSnapshot(snapshotId)) {
        throw Exceptions.toUndeclared(new ClientComputeException("String_Node_Str","String_Node_Str" + request.getSnapshotId() + "String_Node_Str"));
      }
 else {
        fireUsageEvent(snap,SnapShotEvent.forSnapShotDelete());
        final String partition=snap.getPartition();
        final String snapshotId=snap.getDisplayName();
        Callable<Boolean> deleteBroadcast=new Callable<Boolean>(){
          public Boolean call(){
            final DeleteStorageSnapshotType deleteMsg=new DeleteStorageSnapshotType(snapshotId);
            return Iterables.all(Topology.enabledServices(Storage.class),new Predicate<ServiceConfiguration>(){
              @Override public boolean apply(              ServiceConfiguration arg0){
                if (!arg0.getPartition().equals(partition)) {
                  try {
                    AsyncRequests.sendSync(arg0,deleteMsg);
                  }
 catch (                  Exception ex) {
                    LOG.error(ex);
                    Logs.extreme().error(ex,ex);
                  }
                }
                return true;
              }
            }
);
          }
        }
;
        ServiceConfiguration sc=null;
        try {
          sc=Topology.lookup(Storage.class,Partitions.lookupByName(snap.getPartition()));
        }
 catch (        final Exception ex) {
          sc=null;
        }
        if (sc != null) {
          try {
            DeleteStorageSnapshotResponseType scReply=AsyncRequests.sendSync(sc,new DeleteStorageSnapshotType(snap.getDisplayName()));
            if (scReply.get_return()) {
              Threads.enqueue(Eucalyptus.class,Snapshots.class,deleteBroadcast);
            }
 else {
              throw Exceptions.toUndeclared(new EucalyptusCloudException("String_Node_Str" + snap));
            }
          }
 catch (          Exception ex1) {
            throw Exceptions.toUndeclared(ex1.getMessage(),ex1);
          }
        }
 else {
          Threads.enqueue(Eucalyptus.class,Snapshots.class,deleteBroadcast);
        }
        return true;
      }
    }
  }
;
  boolean result=false;
  try {
    result=Transactions.delete(Snapshot.named(ctx.getUserFullName().asAccountFullName(),snapshotId),deleteSnapshot);
  }
 catch (  NoSuchElementException ex2) {
    try {
      result=Transactions.delete(Snapshot.named(null,snapshotId),deleteSnapshot);
    }
 catch (    ExecutionException ex3) {
      throw handleException(ex3.getCause());
    }
catch (    NoSuchElementException ex4) {
      throw new ClientComputeException("String_Node_Str","String_Node_Str" + request.getSnapshotId() + "String_Node_Str");
    }
  }
catch (  ExecutionException ex1) {
    throw new EucalyptusCloudException(ex1.getCause());
  }
  reply.set_return(result);
  return reply;
}