Program: 105847
Project: 105847
Buggy source:
@Override public Map<String,Object> listCapabilities(ListCapabilitiesCmd cmd){
  Map<String,Object> capabilities=new HashMap<String,Object>();
  Account caller=CallContext.current().getCallingAccount();
  boolean securityGroupsEnabled=false;
  boolean elasticLoadBalancerEnabled=false;
  boolean KVMSnapshotEnabled=false;
  String supportELB="String_Node_Str";
  List<NetworkVO> networks=_networkDao.listSecurityGroupEnabledNetworks();
  if (networks != null && !networks.isEmpty()) {
    securityGroupsEnabled=true;
    String elbEnabled=_configDao.getValue(Config.ElasticLoadBalancerEnabled.key());
    elasticLoadBalancerEnabled=elbEnabled == null ? false : Boolean.parseBoolean(elbEnabled);
    if (elasticLoadBalancerEnabled) {
      String networkType=_configDao.getValue(Config.ElasticLoadBalancerNetwork.key());
      if (networkType != null) {
        supportELB=networkType;
      }
    }
  }
  long diskOffMaxSize=_volumeMgr.CustomDiskOfferingMaxSize.value();
  KVMSnapshotEnabled=Boolean.parseBoolean(_configDao.getValue("String_Node_Str"));
  boolean userPublicTemplateEnabled=TemplateManager.AllowPublicUserTemplates.valueIn(caller.getId());
  boolean apiLimitEnabled=Boolean.parseBoolean(_configDao.getValue(Config.ApiLimitEnabled.key()));
  Integer apiLimitInterval=Integer.valueOf(_configDao.getValue(Config.ApiLimitInterval.key()));
  Integer apiLimitMax=Integer.valueOf(_configDao.getValue(Config.ApiLimitMax.key()));
  boolean regionSecondaryEnabled=false;
  List<ImageStoreVO> imgStores=_imgStoreDao.findRegionImageStores();
  if (imgStores != null && imgStores.size() > 0) {
    regionSecondaryEnabled=true;
  }
  capabilities.put("String_Node_Str",securityGroupsEnabled);
  capabilities.put("String_Node_Str",userPublicTemplateEnabled);
  capabilities.put("String_Node_Str",getVersion());
  capabilities.put("String_Node_Str",supportELB);
  capabilities.put("String_Node_Str",_projectMgr.projectInviteRequired());
  capabilities.put("String_Node_Str",_projectMgr.allowUserToCreateProject());
  capabilities.put("String_Node_Str",diskOffMaxSize);
  capabilities.put("String_Node_Str",regionSecondaryEnabled);
  capabilities.put("String_Node_Str",KVMSnapshotEnabled);
  if (apiLimitEnabled) {
    capabilities.put("String_Node_Str",apiLimitInterval);
    capabilities.put("String_Node_Str",apiLimitMax);
  }
  return capabilities;
}

Fixed version (ground truth):
@Override public Map<String,Object> listCapabilities(ListCapabilitiesCmd cmd){
  Map<String,Object> capabilities=new HashMap<String,Object>();
  Account caller=CallContext.current().getCallingAccount();
  boolean securityGroupsEnabled=false;
  boolean elasticLoadBalancerEnabled=false;
  boolean KVMSnapshotEnabled=false;
  String supportELB="String_Node_Str";
  List<NetworkVO> networks=_networkDao.listSecurityGroupEnabledNetworks();
  if (networks != null && !networks.isEmpty()) {
    securityGroupsEnabled=true;
    String elbEnabled=_configDao.getValue(Config.ElasticLoadBalancerEnabled.key());
    elasticLoadBalancerEnabled=elbEnabled == null ? false : Boolean.parseBoolean(elbEnabled);
    if (elasticLoadBalancerEnabled) {
      String networkType=_configDao.getValue(Config.ElasticLoadBalancerNetwork.key());
      if (networkType != null) {
        supportELB=networkType;
      }
    }
  }
  long diskOffMaxSize=VolumeOrchestrationService.CustomDiskOfferingMaxSize.value();
  KVMSnapshotEnabled=Boolean.parseBoolean(_configDao.getValue("String_Node_Str"));
  boolean userPublicTemplateEnabled=TemplateManager.AllowPublicUserTemplates.valueIn(caller.getId());
  boolean apiLimitEnabled=Boolean.parseBoolean(_configDao.getValue(Config.ApiLimitEnabled.key()));
  Integer apiLimitInterval=Integer.valueOf(_configDao.getValue(Config.ApiLimitInterval.key()));
  Integer apiLimitMax=Integer.valueOf(_configDao.getValue(Config.ApiLimitMax.key()));
  boolean regionSecondaryEnabled=false;
  List<ImageStoreVO> imgStores=_imgStoreDao.findRegionImageStores();
  if (imgStores != null && imgStores.size() > 0) {
    regionSecondaryEnabled=true;
  }
  capabilities.put("String_Node_Str",securityGroupsEnabled);
  capabilities.put("String_Node_Str",userPublicTemplateEnabled);
  capabilities.put("String_Node_Str",getVersion());
  capabilities.put("String_Node_Str",supportELB);
  capabilities.put("String_Node_Str",_projectMgr.projectInviteRequired());
  capabilities.put("String_Node_Str",_projectMgr.allowUserToCreateProject());
  capabilities.put("String_Node_Str",diskOffMaxSize);
  capabilities.put("String_Node_Str",regionSecondaryEnabled);
  capabilities.put("String_Node_Str",KVMSnapshotEnabled);
  if (apiLimitEnabled) {
    capabilities.put("String_Node_Str",apiLimitInterval);
    capabilities.put("String_Node_Str",apiLimitMax);
  }
  return capabilities;
}