Program: 108135
Project: 108135
Buggy source:
/** 
 * Creates an ARXConfiguration.
 */
public void createConfig(){
  ModelConfiguration config=getInputConfig();
  DataDefinition definition=getInputDefinition();
  config.removeAllCriteria();
  if (definition == null)   return;
  config.setMetric(this.getMetricDescription().createInstance(this.getMetricConfiguration()));
  for (  String attr : definition.getQuasiIdentifyingAttributes()) {
    if (config.getTransformationMode(attr) == ModelTransformationMode.MICRO_AGGREGATION) {
      MicroAggregationFunction function=config.getMicroAggregationFunction(attr).createInstance(config.getMicroAggregationIgnoreMissingData(attr));
      definition.setAttributeType(attr,AttributeType.QUASI_IDENTIFYING_ATTRIBUTE);
      definition.setMicroAggregationFunction(attr,function);
    }
 else {
      if (this.getUseFunctionalHierarchies() && config.getHierarchyBuilder(attr) != null) {
        definition.setHierarchy(attr,config.getHierarchyBuilder(attr));
      }
 else {
        definition.setHierarchy(attr,(HierarchyBuilder<?>)null);
      }
      definition.setMicroAggregationFunction(attr,null);
      Hierarchy hierarchy=config.getHierarchy(attr);
      if (hierarchy != null && hierarchy.getHierarchy() != null) {
        definition.setHierarchy(attr,hierarchy);
      }
      Integer min=config.getMinimumGeneralization(attr);
      Integer max=config.getMaximumGeneralization(attr);
      if (min == null) {
        min=0;
      }
      if (max == null) {
        if (hierarchy.getHierarchy().length == 0) {
          max=0;
        }
 else {
          max=hierarchy.getHierarchy()[0].length - 1;
        }
      }
      definition.setAttributeType(attr,hierarchy);
      definition.setMinimumGeneralization(attr,min);
      definition.setMaximumGeneralization(attr,max);
    }
  }
  if (this.kAnonymityModel != null && this.kAnonymityModel.isEnabled()) {
    config.addCriterion(this.kAnonymityModel.getCriterion(this));
  }
  if (this.dPresenceModel != null && this.dPresenceModel.isEnabled()) {
    config.addCriterion(this.dPresenceModel.getCriterion(this));
  }
  for (  Entry<String,ModelLDiversityCriterion> entry : this.lDiversityModel.entrySet()) {
    if (entry.getValue() != null && entry.getValue().isEnabled()) {
      config.addCriterion(entry.getValue().getCriterion(this));
    }
  }
  for (  Entry<String,ModelTClosenessCriterion> entry : this.tClosenessModel.entrySet()) {
    if (entry.getValue() != null && entry.getValue().isEnabled()) {
      if (entry.getValue().getVariant() == 1) {
        if (config.getHierarchy(entry.getValue().getAttribute()) == null) {
          config.setHierarchy(entry.getValue().getAttribute(),Hierarchy.create());
        }
      }
      PrivacyCriterion criterion=entry.getValue().getCriterion(this);
      config.addCriterion(criterion);
    }
  }
  for (  ModelRiskBasedCriterion entry : this.riskBasedModel) {
    if (entry != null && entry.isEnabled()) {
      PrivacyCriterion criterion=entry.getCriterion(this);
      config.addCriterion(criterion);
    }
  }
  if (!config.containsCriterion(DPresence.class)) {
    if (config.getInput() != null && config.getResearchSubset() != null && config.getResearchSubset().size() != config.getInput().getHandle().getNumRows()) {
      DataSubset subset=DataSubset.create(config.getInput(),config.getResearchSubset());
      config.addCriterion(new Inclusion(subset));
    }
  }
}

Fixed version (ground truth):
/** 
 * Creates an ARXConfiguration.
 */
public void createConfig(){
  ModelConfiguration config=getInputConfig();
  DataDefinition definition=getInputDefinition();
  config.removeAllCriteria();
  if (definition == null)   return;
  config.setMetric(this.getMetricDescription().createInstance(this.getMetricConfiguration()));
  for (  String attr : definition.getQuasiIdentifyingAttributes()) {
    definition.resetAttributeType(attr);
    definition.resetHierarchy(attr);
    definition.resetHierarchyBuilder(attr);
    definition.resetMaximumGeneralization(attr);
    definition.resetMicroAggregationFunction(attr);
    definition.resetMinimumGeneralization(attr);
    if (this.getUseFunctionalHierarchies() && config.getHierarchyBuilder(attr) != null) {
      definition.setHierarchy(attr,config.getHierarchyBuilder(attr));
    }
 else {
      definition.setHierarchy(attr,(HierarchyBuilder<?>)null);
    }
    Hierarchy hierarchy=config.getHierarchy(attr);
    if (hierarchy != null && hierarchy.getHierarchy() != null) {
      definition.setHierarchy(attr,hierarchy);
    }
    definition.setAttributeType(attr,AttributeType.QUASI_IDENTIFYING_ATTRIBUTE);
    if (config.getTransformationMode(attr) == ModelTransformationMode.MICRO_AGGREGATION) {
      MicroAggregationFunction function=config.getMicroAggregationFunction(attr).createInstance(config.getMicroAggregationIgnoreMissingData(attr));
      definition.setMicroAggregationFunction(attr,function);
    }
 else {
      definition.setMicroAggregationFunction(attr,null);
      Integer min=config.getMinimumGeneralization(attr);
      Integer max=config.getMaximumGeneralization(attr);
      if (min != null) {
        definition.setMinimumGeneralization(attr,min);
      }
      if (max != null) {
        definition.setMaximumGeneralization(attr,max);
      }
    }
  }
  if (this.kAnonymityModel != null && this.kAnonymityModel.isEnabled()) {
    config.addCriterion(this.kAnonymityModel.getCriterion(this));
  }
  if (this.dPresenceModel != null && this.dPresenceModel.isEnabled()) {
    config.addCriterion(this.dPresenceModel.getCriterion(this));
  }
  for (  Entry<String,ModelLDiversityCriterion> entry : this.lDiversityModel.entrySet()) {
    if (entry.getValue() != null && entry.getValue().isEnabled()) {
      config.addCriterion(entry.getValue().getCriterion(this));
    }
  }
  for (  Entry<String,ModelTClosenessCriterion> entry : this.tClosenessModel.entrySet()) {
    if (entry.getValue() != null && entry.getValue().isEnabled()) {
      if (entry.getValue().getVariant() == 1) {
        if (config.getHierarchy(entry.getValue().getAttribute()) == null) {
          config.setHierarchy(entry.getValue().getAttribute(),Hierarchy.create());
        }
      }
      PrivacyCriterion criterion=entry.getValue().getCriterion(this);
      config.addCriterion(criterion);
    }
  }
  for (  ModelRiskBasedCriterion entry : this.riskBasedModel) {
    if (entry != null && entry.isEnabled()) {
      PrivacyCriterion criterion=entry.getCriterion(this);
      config.addCriterion(criterion);
    }
  }
  if (!config.containsCriterion(DPresence.class)) {
    if (config.getInput() != null && config.getResearchSubset() != null && config.getResearchSubset().size() != config.getInput().getHandle().getNumRows()) {
      DataSubset subset=DataSubset.create(config.getInput(),config.getResearchSubset());
      config.addCriterion(new Inclusion(subset));
    }
  }
}