Program: 106671
Project: 106671
Buggy source:
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  _name=name;
  ComponentLocator locator=ComponentLocator.getCurrentLocator();
  ConfigurationDao configDao=locator.getDao(ConfigurationDao.class);
  if (configDao == null) {
    s_logger.error("String_Node_Str");
    return false;
  }
  Map<String,String> configs=configDao.getConfiguration("String_Node_Str",params);
  String emailAddressList=configs.get("String_Node_Str");
  String[] emailAddresses=null;
  if (emailAddressList != null) {
    emailAddresses=emailAddressList.split("String_Node_Str");
  }
  String smtpHost=configs.get("String_Node_Str");
  int smtpPort=NumbersUtil.parseInt(configs.get("String_Node_Str"),25);
  String useAuthStr=configs.get("String_Node_Str");
  boolean useAuth=((useAuthStr == null) ? false : Boolean.parseBoolean(useAuthStr));
  String smtpUsername=configs.get("String_Node_Str");
  String smtpPassword=configs.get("String_Node_Str");
  String emailSender=configs.get("String_Node_Str");
  String smtpDebugStr=configs.get("String_Node_Str");
  boolean smtpDebug=false;
  if (smtpDebugStr != null) {
    smtpDebug=Boolean.parseBoolean(smtpDebugStr);
  }
  _emailAlert=new EmailAlert(emailAddresses,smtpHost,smtpPort,useAuth,smtpUsername,smtpPassword,emailSender,smtpDebug);
  String storageCapacityThreshold=_configDao.getValue(Config.StorageCapacityThreshold.key());
  configs.get("String_Node_Str");
  String cpuCapacityThreshold=_configDao.getValue(Config.CPUCapacityThreshold.key());
  configs.get("String_Node_Str");
  String memoryCapacityThreshold=_configDao.getValue(Config.MemoryCapacityThreshold.key());
  configs.get("String_Node_Str");
  String storageAllocCapacityThreshold=_configDao.getValue(Config.StorageAllocatedCapacityThreshold.key());
  configs.get("String_Node_Str");
  String publicIPCapacityThreshold=_configDao.getValue(Config.PublicIpCapacityThreshold.key());
  configs.get("String_Node_Str");
  String privateIPCapacityThreshold=_configDao.getValue(Config.PrivateIpCapacityThreshold.key());
  configs.get("String_Node_Str");
  String secondaryStorageCapacityThreshold=_configDao.getValue(Config.SecondaryStorageCapacityThreshold.key());
  configs.get("String_Node_Str");
  String vlanCapacityThreshold=_configDao.getValue(Config.VlanCapacityThreshold.key());
  configs.get("String_Node_Str");
  String directNetworkPublicIpCapacityThreshold=_configDao.getValue(Config.DirectNetworkPublicIpCapacityThreshold.key());
  configs.get("String_Node_Str");
  String localStorageCapacityThreshold=_configDao.getValue(Config.LocalStorageCapacityThreshold.key());
  configs.get("String_Node_Str");
  if (storageCapacityThreshold != null) {
    _storageCapacityThreshold=Double.parseDouble(storageCapacityThreshold);
  }
  if (storageAllocCapacityThreshold != null) {
    _storageAllocCapacityThreshold=Double.parseDouble(storageAllocCapacityThreshold);
  }
  if (cpuCapacityThreshold != null) {
    _cpuCapacityThreshold=Double.parseDouble(cpuCapacityThreshold);
  }
  if (memoryCapacityThreshold != null) {
    _memoryCapacityThreshold=Double.parseDouble(memoryCapacityThreshold);
  }
  if (publicIPCapacityThreshold != null) {
    _publicIPCapacityThreshold=Double.parseDouble(publicIPCapacityThreshold);
  }
  if (privateIPCapacityThreshold != null) {
    _privateIPCapacityThreshold=Double.parseDouble(privateIPCapacityThreshold);
  }
  if (secondaryStorageCapacityThreshold != null) {
    _secondaryStorageCapacityThreshold=Double.parseDouble(secondaryStorageCapacityThreshold);
  }
  if (vlanCapacityThreshold != null) {
    _vlanCapacityThreshold=Double.parseDouble(vlanCapacityThreshold);
  }
  if (directNetworkPublicIpCapacityThreshold != null) {
    _directNetworkPublicIpCapacityThreshold=Double.parseDouble(directNetworkPublicIpCapacityThreshold);
  }
  if (localStorageCapacityThreshold != null) {
    _localStorageCapacityThreshold=Double.parseDouble(localStorageCapacityThreshold);
  }
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_STORAGE,_storageCapacityThreshold);
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED,_storageAllocCapacityThreshold);
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_CPU,_cpuCapacityThreshold);
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_MEMORY,_memoryCapacityThreshold);
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_VIRTUAL_NETWORK_PUBLIC_IP,_publicIPCapacityThreshold);
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_PRIVATE_IP,_privateIPCapacityThreshold);
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_SECONDARY_STORAGE,_secondaryStorageCapacityThreshold);
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_VLAN,_vlanCapacityThreshold);
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_DIRECT_ATTACHED_PUBLIC_IP,_directNetworkPublicIpCapacityThreshold);
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_LOCAL_STORAGE,_localStorageCapacityThreshold);
  String capacityCheckPeriodStr=configs.get("String_Node_Str");
  if (capacityCheckPeriodStr != null) {
    _capacityCheckPeriod=Long.parseLong(capacityCheckPeriodStr);
    if (_capacityCheckPeriod <= 0)     _capacityCheckPeriod=Long.parseLong(Config.CapacityCheckPeriod.getDefaultValue());
  }
  String cpuOverProvisioningFactorStr=configs.get("String_Node_Str");
  if (cpuOverProvisioningFactorStr != null) {
    _cpuOverProvisioningFactor=NumbersUtil.parseFloat(cpuOverProvisioningFactorStr,1);
    if (_cpuOverProvisioningFactor < 1) {
      _cpuOverProvisioningFactor=1;
    }
  }
  _timer=new Timer("String_Node_Str");
  return true;
}

Fixed version (ground truth):
@Override public boolean configure(String name,Map<String,Object> params) throws ConfigurationException {
  _name=name;
  ComponentLocator locator=ComponentLocator.getCurrentLocator();
  ConfigurationDao configDao=locator.getDao(ConfigurationDao.class);
  if (configDao == null) {
    s_logger.error("String_Node_Str");
    return false;
  }
  Map<String,String> configs=configDao.getConfiguration("String_Node_Str",params);
  String emailAddressList=configs.get("String_Node_Str");
  String[] emailAddresses=null;
  if (emailAddressList != null) {
    emailAddresses=emailAddressList.split("String_Node_Str");
  }
  String smtpHost=configs.get("String_Node_Str");
  int smtpPort=NumbersUtil.parseInt(configs.get("String_Node_Str"),25);
  String useAuthStr=configs.get("String_Node_Str");
  boolean useAuth=((useAuthStr == null) ? false : Boolean.parseBoolean(useAuthStr));
  String smtpUsername=configs.get("String_Node_Str");
  String smtpPassword=configs.get("String_Node_Str");
  String emailSender=configs.get("String_Node_Str");
  String smtpDebugStr=configs.get("String_Node_Str");
  boolean smtpDebug=false;
  if (smtpDebugStr != null) {
    smtpDebug=Boolean.parseBoolean(smtpDebugStr);
  }
  _emailAlert=new EmailAlert(emailAddresses,smtpHost,smtpPort,useAuth,smtpUsername,smtpPassword,emailSender,smtpDebug);
  String storageCapacityThreshold=_configDao.getValue(Config.StorageCapacityThreshold.key());
  String cpuCapacityThreshold=_configDao.getValue(Config.CPUCapacityThreshold.key());
  String memoryCapacityThreshold=_configDao.getValue(Config.MemoryCapacityThreshold.key());
  String storageAllocCapacityThreshold=_configDao.getValue(Config.StorageAllocatedCapacityThreshold.key());
  String publicIPCapacityThreshold=_configDao.getValue(Config.PublicIpCapacityThreshold.key());
  String privateIPCapacityThreshold=_configDao.getValue(Config.PrivateIpCapacityThreshold.key());
  String secondaryStorageCapacityThreshold=_configDao.getValue(Config.SecondaryStorageCapacityThreshold.key());
  String vlanCapacityThreshold=_configDao.getValue(Config.VlanCapacityThreshold.key());
  String directNetworkPublicIpCapacityThreshold=_configDao.getValue(Config.DirectNetworkPublicIpCapacityThreshold.key());
  String localStorageCapacityThreshold=_configDao.getValue(Config.LocalStorageCapacityThreshold.key());
  if (storageCapacityThreshold != null) {
    _storageCapacityThreshold=Double.parseDouble(storageCapacityThreshold);
  }
  if (storageAllocCapacityThreshold != null) {
    _storageAllocCapacityThreshold=Double.parseDouble(storageAllocCapacityThreshold);
  }
  if (cpuCapacityThreshold != null) {
    _cpuCapacityThreshold=Double.parseDouble(cpuCapacityThreshold);
  }
  if (memoryCapacityThreshold != null) {
    _memoryCapacityThreshold=Double.parseDouble(memoryCapacityThreshold);
  }
  if (publicIPCapacityThreshold != null) {
    _publicIPCapacityThreshold=Double.parseDouble(publicIPCapacityThreshold);
  }
  if (privateIPCapacityThreshold != null) {
    _privateIPCapacityThreshold=Double.parseDouble(privateIPCapacityThreshold);
  }
  if (secondaryStorageCapacityThreshold != null) {
    _secondaryStorageCapacityThreshold=Double.parseDouble(secondaryStorageCapacityThreshold);
  }
  if (vlanCapacityThreshold != null) {
    _vlanCapacityThreshold=Double.parseDouble(vlanCapacityThreshold);
  }
  if (directNetworkPublicIpCapacityThreshold != null) {
    _directNetworkPublicIpCapacityThreshold=Double.parseDouble(directNetworkPublicIpCapacityThreshold);
  }
  if (localStorageCapacityThreshold != null) {
    _localStorageCapacityThreshold=Double.parseDouble(localStorageCapacityThreshold);
  }
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_STORAGE,_storageCapacityThreshold);
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED,_storageAllocCapacityThreshold);
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_CPU,_cpuCapacityThreshold);
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_MEMORY,_memoryCapacityThreshold);
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_VIRTUAL_NETWORK_PUBLIC_IP,_publicIPCapacityThreshold);
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_PRIVATE_IP,_privateIPCapacityThreshold);
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_SECONDARY_STORAGE,_secondaryStorageCapacityThreshold);
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_VLAN,_vlanCapacityThreshold);
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_DIRECT_ATTACHED_PUBLIC_IP,_directNetworkPublicIpCapacityThreshold);
  _capacityTypeThresholdMap.put(Capacity.CAPACITY_TYPE_LOCAL_STORAGE,_localStorageCapacityThreshold);
  String capacityCheckPeriodStr=configs.get("String_Node_Str");
  if (capacityCheckPeriodStr != null) {
    _capacityCheckPeriod=Long.parseLong(capacityCheckPeriodStr);
    if (_capacityCheckPeriod <= 0)     _capacityCheckPeriod=Long.parseLong(Config.CapacityCheckPeriod.getDefaultValue());
  }
  String cpuOverProvisioningFactorStr=configs.get("String_Node_Str");
  if (cpuOverProvisioningFactorStr != null) {
    _cpuOverProvisioningFactor=NumbersUtil.parseFloat(cpuOverProvisioningFactorStr,1);
    if (_cpuOverProvisioningFactor < 1) {
      _cpuOverProvisioningFactor=1;
    }
  }
  _timer=new Timer("String_Node_Str");
  return true;
}