Program: 105996
Project: 105996
Buggy source:
@Override public ApplicationLoadBalancerResponse createLoadBalancerContainerReponse(ApplicationLoadBalancerRule lb,Map<Ip,UserVm> lbInstances){
  ApplicationLoadBalancerResponse lbResponse=new ApplicationLoadBalancerResponse();
  lbResponse.setId(lb.getUuid());
  lbResponse.setName(lb.getName());
  lbResponse.setDescription(lb.getDescription());
  lbResponse.setAlgorithm(lb.getAlgorithm());
  Network nw=ApiDBUtils.findNetworkById(lb.getNetworkId());
  lbResponse.setNetworkId(nw.getUuid());
  populateOwner(lbResponse,lb);
  if (lb.getScheme() == Scheme.Internal) {
    lbResponse.setSourceIp(lb.getSourceIp().addr());
    Network network=ApiDBUtils.findNetworkById(lb.getNetworkId());
    lbResponse.setSourceIpNetworkId(network.getUuid());
  }
 else {
    IpAddress publicIp=ApiDBUtils.findIpAddressById(lb.getSourceIpAddressId());
    lbResponse.setSourceIp(publicIp.getAddress().addr());
    Network ntwk=ApiDBUtils.findNetworkById(publicIp.getNetworkId());
    lbResponse.setSourceIpNetworkId(ntwk.getUuid());
  }
  List<ApplicationLoadBalancerRuleResponse> ruleResponses=new ArrayList<ApplicationLoadBalancerRuleResponse>();
  ApplicationLoadBalancerRuleResponse ruleResponse=new ApplicationLoadBalancerRuleResponse();
  ruleResponse.setInstancePort(lb.getDefaultPortStart());
  ruleResponse.setSourcePort(lb.getSourcePortStart());
  String stateToSet=lb.getState().toString();
  if (stateToSet.equals(FirewallRule.State.Revoke)) {
    stateToSet="String_Node_Str";
  }
  ruleResponse.setState(stateToSet);
  ruleResponse.setObjectName("String_Node_Str");
  ruleResponses.add(ruleResponse);
  lbResponse.setLbRules(ruleResponses);
  List<ApplicationLoadBalancerInstanceResponse> instanceResponses=new ArrayList<ApplicationLoadBalancerInstanceResponse>();
  for (  Ip ip : lbInstances.keySet()) {
    ApplicationLoadBalancerInstanceResponse instanceResponse=new ApplicationLoadBalancerInstanceResponse();
    instanceResponse.setIpAddress(ip.addr());
    UserVm vm=lbInstances.get(ip);
    instanceResponse.setId(vm.getUuid());
    instanceResponse.setName(vm.getInstanceName());
    instanceResponse.setObjectName("String_Node_Str");
    instanceResponses.add(instanceResponse);
  }
  lbResponse.setLbInstances(instanceResponses);
  List<? extends ResourceTag> tags=ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.LoadBalancer,lb.getId());
  List<ResourceTagResponse> tagResponses=new ArrayList<ResourceTagResponse>();
  for (  ResourceTag tag : tags) {
    ResourceTagResponse tagResponse=createResourceTagResponse(tag,true);
    tagResponses.add(tagResponse);
  }
  lbResponse.setTags(tagResponses);
  lbResponse.setObjectName("String_Node_Str");
  return lbResponse;
}

Fixed version (ground truth):
@Override public ApplicationLoadBalancerResponse createLoadBalancerContainerReponse(ApplicationLoadBalancerRule lb,Map<Ip,UserVm> lbInstances){
  ApplicationLoadBalancerResponse lbResponse=new ApplicationLoadBalancerResponse();
  lbResponse.setId(lb.getUuid());
  lbResponse.setName(lb.getName());
  lbResponse.setDescription(lb.getDescription());
  lbResponse.setAlgorithm(lb.getAlgorithm());
  Network nw=ApiDBUtils.findNetworkById(lb.getNetworkId());
  lbResponse.setNetworkId(nw.getUuid());
  populateOwner(lbResponse,lb);
  if (lb.getScheme() == Scheme.Internal) {
    lbResponse.setSourceIp(lb.getSourceIp().addr());
    Network network=ApiDBUtils.findNetworkById(lb.getNetworkId());
    lbResponse.setSourceIpNetworkId(network.getUuid());
  }
 else {
    IpAddress publicIp=ApiDBUtils.findIpAddressById(lb.getSourceIpAddressId());
    lbResponse.setSourceIp(publicIp.getAddress().addr());
    Network ntwk=ApiDBUtils.findNetworkById(publicIp.getNetworkId());
    lbResponse.setSourceIpNetworkId(ntwk.getUuid());
  }
  List<ApplicationLoadBalancerRuleResponse> ruleResponses=new ArrayList<ApplicationLoadBalancerRuleResponse>();
  ApplicationLoadBalancerRuleResponse ruleResponse=new ApplicationLoadBalancerRuleResponse();
  ruleResponse.setInstancePort(lb.getDefaultPortStart());
  ruleResponse.setSourcePort(lb.getSourcePortStart());
  FirewallRule.State stateToSet=lb.getState();
  if (stateToSet.equals(FirewallRule.State.Revoke)) {
    stateToSet=FirewallRule.State.Deleting;
  }
  ruleResponse.setState(stateToSet.toString());
  ruleResponse.setObjectName("String_Node_Str");
  ruleResponses.add(ruleResponse);
  lbResponse.setLbRules(ruleResponses);
  List<ApplicationLoadBalancerInstanceResponse> instanceResponses=new ArrayList<ApplicationLoadBalancerInstanceResponse>();
  for (  Ip ip : lbInstances.keySet()) {
    ApplicationLoadBalancerInstanceResponse instanceResponse=new ApplicationLoadBalancerInstanceResponse();
    instanceResponse.setIpAddress(ip.addr());
    UserVm vm=lbInstances.get(ip);
    instanceResponse.setId(vm.getUuid());
    instanceResponse.setName(vm.getInstanceName());
    instanceResponse.setObjectName("String_Node_Str");
    instanceResponses.add(instanceResponse);
  }
  lbResponse.setLbInstances(instanceResponses);
  List<? extends ResourceTag> tags=ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.LoadBalancer,lb.getId());
  List<ResourceTagResponse> tagResponses=new ArrayList<ResourceTagResponse>();
  for (  ResourceTag tag : tags) {
    ResourceTagResponse tagResponse=createResourceTagResponse(tag,true);
    tagResponses.add(tagResponse);
  }
  lbResponse.setTags(tagResponses);
  lbResponse.setObjectName("String_Node_Str");
  return lbResponse;
}