Program: 14321
Project: 14321
Buggy source:
public DescribeLoadBalancersResponseType describeLoadBalancers(DescribeLoadBalancersType request) throws EucalyptusCloudException {
  DescribeLoadBalancersResponseType reply=request.getReply();
  final Context ctx=Contexts.lookup();
  final AccountFullName ownerFullName=ctx.getUserFullName().asAccountFullName();
  final Set<String> requestedNames=Sets.newHashSet();
  if (!request.getLoadBalancerNames().getMember().isEmpty()) {
    requestedNames.addAll(request.getLoadBalancerNames().getMember());
  }
  Set<String> allowedLBNames=null;
  String marker=request.getMarker();
  if (marker != null && marker.startsWith("String_Node_Str")) {
    String instanceId=marker.replace("String_Node_Str","String_Node_Str");
    return describeLoadBalancersServo(instanceId,reply);
  }
 else {
    final Function<Set<String>,Set<String>> lookupLBNames=new Function<Set<String>,Set<String>>(){
      @Override public Set<String> apply(      final Set<String> identifiers){
        final Predicate<? super LoadBalancer> requestedAndAccessible=LoadBalancingMetadatas.filteringFor(LoadBalancer.class).byId(identifiers).byPrivileges().buildPredicate();
        final List<LoadBalancer> lbs=Entities.query(LoadBalancer.named(ownerFullName,null),true);
        return Sets.newHashSet(Iterables.transform(Iterables.filter(lbs,requestedAndAccessible),LoadBalancingMetadatas.toDisplayName()));
      }
    }
;
    allowedLBNames=Entities.asTransaction(LoadBalancer.class,lookupLBNames).apply(requestedNames);
  }
  final Function<String,LoadBalancer> getLoadBalancer=new Function<String,LoadBalancer>(){
    @Override public LoadBalancer apply(    final String lbName){
      try {
        return Entities.uniqueResult(LoadBalancer.named(ownerFullName,lbName));
      }
 catch (      NoSuchElementException ex) {
        return null;
      }
catch (      Exception ex) {
        LOG.warn("String_Node_Str" + lbName,ex);
        return null;
      }
    }
  }
;
  final Function<Set<String>,Set<LoadBalancerDescription>> lookupLBDescriptions=new Function<Set<String>,Set<LoadBalancerDescription>>(){
    public Set<LoadBalancerDescription> apply(    final Set<String> input){
      final Set<LoadBalancerDescription> descs=Sets.newHashSet();
      for (      String lbName : input) {
        LoadBalancerDescription desc=new LoadBalancerDescription();
        final LoadBalancer lb=Entities.asTransaction(LoadBalancer.class,getLoadBalancer).apply(lbName);
        if (lb == null)         continue;
        desc.setLoadBalancerName(lbName);
        desc.setCreatedTime(lb.getCreationTimestamp());
        final LoadBalancerDnsRecord dns=lb.getDns();
        desc.setDnsName(dns.getDnsName());
        if (lb.getBackendInstances().size() > 0) {
          desc.setInstances(new Instances());
          desc.getInstances().setMember(new ArrayList<Instance>(Collections2.transform(lb.getBackendInstances(),new Function<LoadBalancerBackendInstance,Instance>(){
            @Override public Instance apply(            final LoadBalancerBackendInstance be){
              Instance instance=new Instance();
              instance.setInstanceId(be.getInstanceId());
              return instance;
            }
          }
)));
        }
        if (lb.getZones().size() > 0) {
          desc.setAvailabilityZones(new AvailabilityZones());
          desc.getAvailabilityZones().setMember(new ArrayList<String>(Collections2.transform(lb.getZones(),new Function<LoadBalancerZone,String>(){
            @Override public String apply(            final LoadBalancerZone zone){
              return zone.getName();
            }
          }
)));
        }
        if (lb.getListeners().size() > 0) {
          desc.setListenerDescriptions(new ListenerDescriptions());
          desc.getListenerDescriptions().setMember(new ArrayList<ListenerDescription>(Collections2.transform(lb.getListeners(),new Function<LoadBalancerListener,ListenerDescription>(){
            @Override public ListenerDescription apply(            final LoadBalancerListener input){
              ListenerDescription desc=new ListenerDescription();
              Listener listener=new Listener();
              listener.setLoadBalancerPort(input.getLoadbalancerPort());
              listener.setInstancePort(input.getInstancePort());
              if (input.getInstanceProtocol() != PROTOCOL.NONE)               listener.setInstanceProtocol(input.getInstanceProtocol().name());
              listener.setProtocol(input.getProtocol().name());
              if (input.getCertificateId() != null)               listener.setSslCertificateId(input.getCertificateId());
              desc.setListener(listener);
              return desc;
            }
          }
)));
        }
        try {
          int interval=lb.getHealthCheckInterval();
          String target=lb.getHealthCheckTarget();
          int timeout=lb.getHealthCheckTimeout();
          int healthyThresholds=lb.getHealthyThreshold();
          int unhealthyThresholds=lb.getHealthCheckUnhealthyThreshold();
          final HealthCheck hc=new HealthCheck();
          hc.setInterval(interval);
          hc.setHealthyThreshold(healthyThresholds);
          hc.setTarget(target);
          hc.setTimeout(timeout);
          hc.setUnhealthyThreshold(unhealthyThresholds);
          desc.setHealthCheck(hc);
        }
 catch (        IllegalStateException ex) {
          ;
        }
catch (        Exception ex) {
          ;
        }
        descs.add(desc);
      }
      return descs;
    }
  }
;
  Set<LoadBalancerDescription> descs=lookupLBDescriptions.apply(allowedLBNames);
  DescribeLoadBalancersResult descResult=new DescribeLoadBalancersResult();
  LoadBalancerDescriptions lbDescs=new LoadBalancerDescriptions();
  lbDescs.setMember(new ArrayList<LoadBalancerDescription>(descs));
  descResult.setLoadBalancerDescriptions(lbDescs);
  reply.setDescribeLoadBalancersResult(descResult);
  reply.set_return(true);
  return reply;
}

Fixed version (ground truth):
public DescribeLoadBalancersResponseType describeLoadBalancers(DescribeLoadBalancersType request) throws EucalyptusCloudException {
  DescribeLoadBalancersResponseType reply=request.getReply();
  final Context ctx=Contexts.lookup();
  final UserFullName ownerFullName=ctx.getUserFullName();
  final Set<String> requestedNames=Sets.newHashSet();
  if (!request.getLoadBalancerNames().getMember().isEmpty()) {
    requestedNames.addAll(request.getLoadBalancerNames().getMember());
  }
  Set<String> allowedLBNames=null;
  String marker=request.getMarker();
  if (marker != null && marker.startsWith("String_Node_Str")) {
    String instanceId=marker.replace("String_Node_Str","String_Node_Str");
    return describeLoadBalancersServo(instanceId,reply);
  }
 else {
    final Function<Set<String>,Set<String>> lookupLBNames=new Function<Set<String>,Set<String>>(){
      @Override public Set<String> apply(      final Set<String> identifiers){
        final Predicate<? super LoadBalancer> requestedAndAccessible=LoadBalancingMetadatas.filteringFor(LoadBalancer.class).byId(identifiers).byPrivileges().buildPredicate();
        final List<LoadBalancer> lbs=Entities.query(LoadBalancer.named(ownerFullName.getAccountName(),null),true);
        return Sets.newHashSet(Iterables.transform(Iterables.filter(lbs,requestedAndAccessible),LoadBalancingMetadatas.toDisplayName()));
      }
    }
;
    allowedLBNames=Entities.asTransaction(LoadBalancer.class,lookupLBNames).apply(requestedNames);
  }
  final Function<String,LoadBalancer> getLoadBalancer=new Function<String,LoadBalancer>(){
    @Override public LoadBalancer apply(    final String lbName){
      try {
        return Entities.uniqueResult(LoadBalancer.named(ownerFullName.getAccountName(),lbName));
      }
 catch (      NoSuchElementException ex) {
        return null;
      }
catch (      Exception ex) {
        LOG.warn("String_Node_Str" + lbName,ex);
        return null;
      }
    }
  }
;
  final Function<Set<String>,Set<LoadBalancerDescription>> lookupLBDescriptions=new Function<Set<String>,Set<LoadBalancerDescription>>(){
    public Set<LoadBalancerDescription> apply(    final Set<String> input){
      final Set<LoadBalancerDescription> descs=Sets.newHashSet();
      for (      String lbName : input) {
        LoadBalancerDescription desc=new LoadBalancerDescription();
        final LoadBalancer lb=Entities.asTransaction(LoadBalancer.class,getLoadBalancer).apply(lbName);
        if (lb == null)         continue;
        desc.setLoadBalancerName(lbName);
        desc.setCreatedTime(lb.getCreationTimestamp());
        final LoadBalancerDnsRecord dns=lb.getDns();
        desc.setDnsName(dns.getDnsName());
        if (lb.getBackendInstances().size() > 0) {
          desc.setInstances(new Instances());
          desc.getInstances().setMember(new ArrayList<Instance>(Collections2.transform(lb.getBackendInstances(),new Function<LoadBalancerBackendInstance,Instance>(){
            @Override public Instance apply(            final LoadBalancerBackendInstance be){
              Instance instance=new Instance();
              instance.setInstanceId(be.getInstanceId());
              return instance;
            }
          }
)));
        }
        if (lb.getZones().size() > 0) {
          desc.setAvailabilityZones(new AvailabilityZones());
          desc.getAvailabilityZones().setMember(new ArrayList<String>(Collections2.transform(lb.getZones(),new Function<LoadBalancerZone,String>(){
            @Override public String apply(            final LoadBalancerZone zone){
              return zone.getName();
            }
          }
)));
        }
        if (lb.getListeners().size() > 0) {
          desc.setListenerDescriptions(new ListenerDescriptions());
          desc.getListenerDescriptions().setMember(new ArrayList<ListenerDescription>(Collections2.transform(lb.getListeners(),new Function<LoadBalancerListener,ListenerDescription>(){
            @Override public ListenerDescription apply(            final LoadBalancerListener input){
              ListenerDescription desc=new ListenerDescription();
              Listener listener=new Listener();
              listener.setLoadBalancerPort(input.getLoadbalancerPort());
              listener.setInstancePort(input.getInstancePort());
              if (input.getInstanceProtocol() != PROTOCOL.NONE)               listener.setInstanceProtocol(input.getInstanceProtocol().name());
              listener.setProtocol(input.getProtocol().name());
              if (input.getCertificateId() != null)               listener.setSslCertificateId(input.getCertificateId());
              desc.setListener(listener);
              return desc;
            }
          }
)));
        }
        try {
          int interval=lb.getHealthCheckInterval();
          String target=lb.getHealthCheckTarget();
          int timeout=lb.getHealthCheckTimeout();
          int healthyThresholds=lb.getHealthyThreshold();
          int unhealthyThresholds=lb.getHealthCheckUnhealthyThreshold();
          final HealthCheck hc=new HealthCheck();
          hc.setInterval(interval);
          hc.setHealthyThreshold(healthyThresholds);
          hc.setTarget(target);
          hc.setTimeout(timeout);
          hc.setUnhealthyThreshold(unhealthyThresholds);
          desc.setHealthCheck(hc);
        }
 catch (        IllegalStateException ex) {
          ;
        }
catch (        Exception ex) {
          ;
        }
        descs.add(desc);
      }
      return descs;
    }
  }
;
  Set<LoadBalancerDescription> descs=lookupLBDescriptions.apply(allowedLBNames);
  DescribeLoadBalancersResult descResult=new DescribeLoadBalancersResult();
  LoadBalancerDescriptions lbDescs=new LoadBalancerDescriptions();
  lbDescs.setMember(new ArrayList<LoadBalancerDescription>(descs));
  descResult.setLoadBalancerDescriptions(lbDescs);
  reply.setDescribeLoadBalancersResult(descResult);
  reply.set_return(true);
  return reply;
}