Program: 116724
Project: 116724
Buggy source:
@Override public boolean validateDeploymentPolicy(String cartridgeType,Partition[] partitions) throws InvalidPartitionException, InvalidCartridgeTypeException {
  Map<String,IaasProvider> partitionToIaasProviders=new ConcurrentHashMap<String,IaasProvider>();
  Cartridge cartridge=dataHolder.getCartridge(cartridgeType);
  if (cartridge == null) {
    String msg="String_Node_Str" + cartridgeType;
    log.error(msg);
    throw new InvalidCartridgeTypeException(msg);
  }
  for (  Partition partition : partitions) {
    String provider=partition.getProvider();
    IaasProvider iaasProvider=cartridge.getIaasProvider(provider);
    if (iaasProvider == null) {
      String msg="String_Node_Str" + partition.toString() + "String_Node_Str"+ provider;
      log.error(msg);
      throw new InvalidPartitionException(msg);
    }
    Iaas iaas=iaasProvider.getIaas();
    if (iaas == null) {
      try {
        iaas=setIaas(iaasProvider);
      }
 catch (      InvalidIaasProviderException e) {
        String msg="String_Node_Str" + partition.toString() + "String_Node_Str"+ provider;
        log.error(msg,e);
        throw new InvalidPartitionException(msg,e);
      }
    }
    PartitionValidator validator=iaas.getPartitionValidator();
    validator.setIaasProvider(iaasProvider);
    IaasProvider updatedIaasProvider=validator.validate(partition.getId(),CloudControllerUtil.toJavaUtilProperties(partition.getProperties()));
    partitionToIaasProviders.put(partition.getId(),updatedIaasProvider);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + partition.toString() + "String_Node_Str"+ "String_Node_Str"+ cartridgeType);
    }
  }
  cartridge.addIaasProviders(partitionToIaasProviders);
  log.info("String_Node_Str" + cartridgeType);
  return true;
}

Fixed version (ground truth):
@Override public boolean validateDeploymentPolicy(String cartridgeType,Partition[] partitions) throws InvalidPartitionException, InvalidCartridgeTypeException {
  Map<String,IaasProvider> partitionToIaasProviders=new ConcurrentHashMap<String,IaasProvider>();
  Cartridge cartridge=dataHolder.getCartridge(cartridgeType);
  if (cartridge == null) {
    String msg="String_Node_Str" + cartridgeType;
    log.error(msg);
    throw new InvalidCartridgeTypeException(msg);
  }
  for (  Partition partition : partitions) {
    String provider=partition.getProvider();
    IaasProvider iaasProvider=cartridge.getIaasProvider(provider);
    if (iaasProvider == null) {
      String msg="String_Node_Str" + partition.toString() + "String_Node_Str"+ provider;
      log.error(msg);
      throw new InvalidPartitionException(msg);
    }
    Iaas iaas=iaasProvider.getIaas();
    if (iaas == null) {
      try {
        iaas=setIaas(iaasProvider);
      }
 catch (      InvalidIaasProviderException e) {
        String msg="String_Node_Str" + partition.toString() + "String_Node_Str"+ provider;
        log.error(msg,e);
        throw new InvalidPartitionException(msg,e);
      }
    }
    PartitionValidator validator=iaas.getPartitionValidator();
    validator.setIaasProvider(iaasProvider);
    IaasProvider updatedIaasProvider=validator.validate(partition.getId(),CloudControllerUtil.toJavaUtilProperties(partition.getProperties()));
    partitionToIaasProviders.put(partition.getId(),updatedIaasProvider);
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + partition.toString() + "String_Node_Str"+ "String_Node_Str"+ cartridgeType);
    }
  }
  cartridge.addIaasProviders(partitionToIaasProviders);
  log.info("String_Node_Str" + CloudControllerUtil.getPartitionIds(partitions) + "String_Node_Str"+ cartridgeType);
  return true;
}