Program: 14141
Project: 14141
Buggy source:
/** 
 * Checks grants and transforms grantees into canonicalId from eucalyptus account id or email address
 * @param acl
 * @return
 */
public static AccessControlList scrubAcl(AccessControlList acl){
  AccessControlList scrubbed=new AccessControlList();
  if (acl == null || acl.getGrants() == null || acl.getGrants().size() == 0) {
    return scrubbed;
  }
  String canonicalId=null;
  Grantee grantee;
  CanonicalUser canonicalUser;
  Group group;
  String email;
  for (  Grant g : acl.getGrants()) {
    grantee=g.getGrantee();
    if (grantee == null) {
      continue;
    }
 else {
      canonicalUser=grantee.getCanonicalUser();
      group=grantee.getGroup();
      email=grantee.getEmailAddress();
    }
    canonicalId=canonicalUser == null ? null : resolveCanonicalId(canonicalUser.getID());
    if (canonicalId == null) {
      try {
        User user=Accounts.lookupUserByEmailAddress(email);
        if (user != null && user.isAccountAdmin() && user.getAccount() != null) {
          canonicalId=user.getAccount().getCanonicalId();
        }
      }
 catch (      AuthException authEx) {
      }
    }
    if (canonicalId == null && group != null && !Strings.isNullOrEmpty(group.getUri())) {
      ObjectStorageProperties.S3_GROUP foundGroup=AclUtils.getGroupFromUri(group.getUri());
      if (foundGroup == null) {
        throw new NoSuchElementException("String_Node_Str" + group.getUri() + "String_Node_Str");
      }
      canonicalId=group.getUri();
    }
    if (email != null && !"String_Node_Str".equals(email)) {
      UnresolvableGrantByEmailAddressException ugbeae=new UnresolvableGrantByEmailAddressException();
      ugbeae.setEmailAddress(email);
      throw new RuntimeException(ugbeae);
    }
 else     if (canonicalId == null) {
      InvalidArgumentException iae=new InvalidArgumentException();
      iae.setMessage("String_Node_Str");
      iae.setArgumentName("String_Node_Str");
      iae.setArgumentValue(canonicalUser.getID());
      throw new RuntimeException(iae);
    }
 else {
      if (grantee.getCanonicalUser() == null) {
        grantee.setCanonicalUser(new CanonicalUser(canonicalId,"String_Node_Str"));
      }
 else {
        grantee.getCanonicalUser().setID(canonicalId);
      }
    }
  }
  return acl;
}

Fixed version (ground truth):
/** 
 * Checks grants and transforms grantees into canonicalId from eucalyptus account id or email address
 * @param acl
 * @return
 */
public static AccessControlList scrubAcl(AccessControlList acl){
  AccessControlList scrubbed=new AccessControlList();
  if (acl == null || acl.getGrants() == null || acl.getGrants().size() == 0) {
    return scrubbed;
  }
  String canonicalId=null;
  Grantee grantee;
  CanonicalUser canonicalUser;
  Group group;
  String email;
  for (  Grant g : acl.getGrants()) {
    grantee=g.getGrantee();
    if (grantee == null) {
      continue;
    }
 else {
      canonicalUser=grantee.getCanonicalUser();
      group=grantee.getGroup();
      email=grantee.getEmailAddress();
    }
    canonicalId=canonicalUser == null ? null : resolveCanonicalId(canonicalUser.getID());
    if (canonicalId == null) {
      try {
        User user=Accounts.lookupUserByEmailAddress(email);
        if (user != null && user.isAccountAdmin() && user.getAccount() != null) {
          canonicalId=user.getAccount().getCanonicalId();
        }
      }
 catch (      AuthException authEx) {
      }
    }
    if (canonicalId == null && group != null && !Strings.isNullOrEmpty(group.getUri())) {
      ObjectStorageProperties.S3_GROUP foundGroup=AclUtils.getGroupFromUri(group.getUri());
      if (foundGroup == null) {
        throw new NoSuchElementException("String_Node_Str" + group.getUri() + "String_Node_Str");
      }
      canonicalId=group.getUri();
    }
    if (email != null && !"String_Node_Str".equals(email) && canonicalId == null) {
      UnresolvableGrantByEmailAddressException ugbeae=new UnresolvableGrantByEmailAddressException();
      ugbeae.setEmailAddress(email);
      throw new RuntimeException(ugbeae);
    }
 else     if (canonicalId == null) {
      InvalidArgumentException iae=new InvalidArgumentException();
      iae.setMessage("String_Node_Str");
      iae.setArgumentName("String_Node_Str");
      iae.setArgumentValue(canonicalUser.getID());
      throw new RuntimeException(iae);
    }
 else {
      if (grantee.getCanonicalUser() == null) {
        grantee.setCanonicalUser(new CanonicalUser(canonicalId,"String_Node_Str"));
      }
 else {
        grantee.getCanonicalUser().setID(canonicalId);
      }
    }
  }
  return acl;
}