Program: 14906
Project: 14906
Buggy source:
public AuthorizeSecurityGroupIngressResponseType authorize(final AuthorizeSecurityGroupIngressType request) throws Exception {
  final Context ctx=Contexts.lookup();
  final AuthorizeSecurityGroupIngressResponseType reply=(AuthorizeSecurityGroupIngressResponseType)request.getReply();
  final NetworkGroup ruleGroup=NetworkGroups.lookup(ctx.getUserFullName(),request.getGroupName());
  if (!ctx.hasAdministrativePrivileges() && !RestrictedTypes.filterPrivileged().apply(ruleGroup)) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getGroupName() + "String_Node_Str"+ ctx.getUser());
  }
  final List<NetworkRule> ruleList=Lists.newArrayList();
  for (  final IpPermissionType ipPerm : request.getIpPermissions()) {
    try {
      ruleList.addAll(NetworkGroups.IpPermissionTypeAsNetworkRule.INSTANCE.apply(ipPerm));
    }
 catch (    final IllegalArgumentException ex) {
      LOG.error(ex.getMessage());
      reply.set_return(false);
      return reply;
    }
  }
  if (Iterables.any(ruleGroup.getNetworkRules(),new Predicate<NetworkRule>(){
    @Override public boolean apply(    final NetworkRule rule){
      for (      final NetworkRule r : ruleList) {
        if (r.equals(rule) && r.getNetworkPeers().equals(rule.getNetworkPeers()) && r.getIpRanges().equals(rule.getIpRanges())) {
          return true || !r.isValid();
        }
      }
      return false;
    }
  }
)) {
    reply.set_return(false);
    return reply;
  }
 else {
    ruleGroup.getNetworkRules().addAll(ruleList);
    EntityWrapper.get(ruleGroup).mergeAndCommit(ruleGroup);
    reply.set_return(true);
  }
  return reply;
}

Fixed version (ground truth):
public AuthorizeSecurityGroupIngressResponseType authorize(final AuthorizeSecurityGroupIngressType request) throws Exception {
  final Context ctx=Contexts.lookup();
  final AuthorizeSecurityGroupIngressResponseType reply=(AuthorizeSecurityGroupIngressResponseType)request.getReply();
  final NetworkGroup ruleGroup=NetworkGroups.lookup(ctx.getUserFullName().asAccountFullName(),request.getGroupName());
  if (!RestrictedTypes.filterPrivileged().apply(ruleGroup)) {
    throw new EucalyptusCloudException("String_Node_Str" + request.getGroupName() + "String_Node_Str"+ ctx.getUser());
  }
  final List<NetworkRule> ruleList=Lists.newArrayList();
  for (  final IpPermissionType ipPerm : request.getIpPermissions()) {
    try {
      ruleList.addAll(NetworkGroups.IpPermissionTypeAsNetworkRule.INSTANCE.apply(ipPerm));
    }
 catch (    final IllegalArgumentException ex) {
      LOG.error(ex.getMessage());
      reply.set_return(false);
      return reply;
    }
  }
  if (Iterables.any(ruleGroup.getNetworkRules(),new Predicate<NetworkRule>(){
    @Override public boolean apply(    final NetworkRule rule){
      for (      final NetworkRule r : ruleList) {
        if (r.equals(rule) && r.getNetworkPeers().equals(rule.getNetworkPeers()) && r.getIpRanges().equals(rule.getIpRanges())) {
          return true || !r.isValid();
        }
      }
      return false;
    }
  }
)) {
    reply.set_return(false);
    return reply;
  }
 else {
    ruleGroup.getNetworkRules().addAll(ruleList);
    EntityWrapper.get(ruleGroup).mergeAndCommit(ruleGroup);
    reply.set_return(true);
  }
  return reply;
}