Program: 108678
Project: 108678
Buggy source:
public void createCriteriaAndDefinition(ModelConfiguration config){
  config.removeAllCriteria();
  for (  String attr : config.getInput().getDefinition().getQuasiIdentifyingAttributes()) {
    Hierarchy hierarchy=config.getHierarchy(attr);
    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;
      }
    }
    config.getInput().getDefinition().setAttributeType(attr,hierarchy);
    config.setMinimumGeneralization(attr,min);
    config.setMaximumGeneralization(attr,max);
  }
  if (this.kAnonymityModel != null && this.kAnonymityModel.isActive() && this.kAnonymityModel.isEnabled()) {
    config.addCriterion(this.kAnonymityModel.getCriterion(this));
  }
  if (this.dPresenceModel != null && this.dPresenceModel.isActive() && this.dPresenceModel.isEnabled()) {
    config.addCriterion(this.dPresenceModel.getCriterion(this));
  }
  for (  Entry<String,ModelLDiversityCriterion> entry : this.lDiversityModel.entrySet()) {
    if (entry.getValue() != null && entry.getValue().isActive() && entry.getValue().isEnabled()) {
      config.addCriterion(entry.getValue().getCriterion(this));
    }
  }
  for (  Entry<String,ModelTClosenessCriterion> entry : this.tClosenessModel.entrySet()) {
    if (entry.getValue() != null && entry.getValue().isActive() && entry.getValue().isEnabled()) {
      config.addCriterion(entry.getValue().getCriterion(this));
    }
  }
  if (!config.containsCriterion(DPresence.class)) {
    if (getInputConfig() != null && getInputConfig().getInput() != null && getInputConfig().getResearchSubset() != null) {
      DataSubset subset=DataSubset.create(getInputConfig().getInput(),getInputConfig().getResearchSubset());
      config.addCriterion(new Inclusion(subset));
    }
  }
}

Fixed version (ground truth):
public void createCriteriaAndDefinition(ModelConfiguration config){
  config.removeAllCriteria();
  for (  String attr : config.getInput().getDefinition().getQuasiIdentifyingAttributes()) {
    Hierarchy hierarchy=config.getHierarchy(attr);
    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;
      }
    }
    config.getInput().getDefinition().setAttributeType(attr,hierarchy);
    config.getInput().getDefinition().setMinimumGeneralization(attr,min);
    config.getInput().getDefinition().setMaximumGeneralization(attr,max);
  }
  if (this.kAnonymityModel != null && this.kAnonymityModel.isActive() && this.kAnonymityModel.isEnabled()) {
    config.addCriterion(this.kAnonymityModel.getCriterion(this));
  }
  if (this.dPresenceModel != null && this.dPresenceModel.isActive() && this.dPresenceModel.isEnabled()) {
    config.addCriterion(this.dPresenceModel.getCriterion(this));
  }
  for (  Entry<String,ModelLDiversityCriterion> entry : this.lDiversityModel.entrySet()) {
    if (entry.getValue() != null && entry.getValue().isActive() && entry.getValue().isEnabled()) {
      config.addCriterion(entry.getValue().getCriterion(this));
    }
  }
  for (  Entry<String,ModelTClosenessCriterion> entry : this.tClosenessModel.entrySet()) {
    if (entry.getValue() != null && entry.getValue().isActive() && entry.getValue().isEnabled()) {
      config.addCriterion(entry.getValue().getCriterion(this));
    }
  }
  if (!config.containsCriterion(DPresence.class)) {
    if (getInputConfig() != null && getInputConfig().getInput() != null && getInputConfig().getResearchSubset() != null) {
      DataSubset subset=DataSubset.create(getInputConfig().getInput(),getInputConfig().getResearchSubset());
      config.addCriterion(new Inclusion(subset));
    }
  }
}