Program: 14292
Project: 14292
Buggy source:
public static void addZone(final String lbName,final Context ctx,final Collection<String> zones) throws LoadBalancingException {
  List<ClusterInfoType> clusters=null;
  try {
    clusters=EucalyptusActivityTasks.getInstance().describeAvailabilityZones(false);
  }
 catch (  Exception ex) {
    throw new InternalFailure400Exception("String_Node_Str");
  }
  for (  String zone : zones) {
    boolean found=false;
    for (    ClusterInfoType cluster : clusters) {
      if (zone.equals(cluster.getZoneName())) {
        found=true;
        break;
      }
    }
    if (!found)     throw new InvalidConfigurationRequestException("String_Node_Str" + zone + "String_Node_Str");
  }
  LoadBalancer lb=null;
  try {
    lb=LoadBalancers.getLoadbalancer(ctx,lbName);
  }
 catch (  Exception ex) {
    throw new AccessPointNotFoundException();
  }
  try {
    for (    String zone : zones) {
      final EntityTransaction db=Entities.get(LoadBalancerZone.class);
      try {
        final LoadBalancerZone sample=LoadBalancerZone.named(lb,zone);
        final LoadBalancerZone exist=Entities.uniqueResult(sample);
        exist.setState(LoadBalancerZone.STATE.InService);
        Entities.persist(exist);
        db.commit();
      }
 catch (      NoSuchElementException ex) {
        final LoadBalancerZone newZone=LoadBalancerZone.named(lb,zone);
        newZone.setState(LoadBalancerZone.STATE.InService);
        Entities.persist(newZone);
        db.commit();
      }
catch (      Exception ex) {
        db.rollback();
        LOG.error("String_Node_Str" + zone,ex);
        throw ex;
      }
    }
  }
 catch (  Exception ex) {
    throw new InternalFailure400Exception("String_Node_Str");
  }
}

Fixed version (ground truth):
public static void addZone(final String lbName,final Context ctx,final Collection<String> zones) throws LoadBalancingException {
  List<ClusterInfoType> clusters=null;
  try {
    clusters=EucalyptusActivityTasks.getInstance().describeAvailabilityZones(false);
  }
 catch (  Exception ex) {
    throw new InternalFailure400Exception("String_Node_Str");
  }
  for (  String zone : zones) {
    boolean found=false;
    for (    ClusterInfoType cluster : clusters) {
      if (zone.equals(cluster.getZoneName())) {
        found=true;
        break;
      }
    }
    if (!found)     throw new InvalidConfigurationRequestException("String_Node_Str" + zone + "String_Node_Str");
  }
  LoadBalancer lb=null;
  try {
    lb=LoadBalancers.getLoadbalancer(ctx,lbName);
  }
 catch (  Exception ex) {
    throw new AccessPointNotFoundException();
  }
  try {
    for (    String zone : zones) {
      final EntityTransaction db=Entities.get(LoadBalancerZone.class);
      try {
        final LoadBalancerZone sample=LoadBalancerZone.named(lb,zone);
        final LoadBalancerZone exist=Entities.uniqueResult(sample);
        exist.setState(LoadBalancerZone.STATE.InService);
        Entities.persist(exist);
        db.commit();
      }
 catch (      NoSuchElementException ex) {
        final LoadBalancerZone newZone=LoadBalancerZone.named(lb,zone);
        newZone.setState(LoadBalancerZone.STATE.InService);
        Entities.persist(newZone);
        db.commit();
      }
catch (      Exception ex) {
        db.rollback();
        LOG.error("String_Node_Str" + zone,ex);
        throw ex;
      }
 finally {
        if (db.isActive())         db.rollback();
      }
    }
  }
 catch (  Exception ex) {
    throw new InternalFailure400Exception("String_Node_Str");
  }
}