Program: 108503
Project: 108503
Buggy source:
public void createConfig(){
  ModelConfiguration config=getInputConfig();
  DataDefinition definition=getInputDefinition();
  config.removeAllCriteria();
  for (  String attr : definition.getQuasiIdentifyingAttributes()) {
    Hierarchy hierarchy=config.getHierarchy(attr);
    if (hierarchy == null || hierarchy.getHierarchy() == null) {
      hierarchy=Hierarchy.create();
      config.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.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()) {
      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);
    }
  }
  if (!config.containsCriterion(DPresence.class)) {
    if (getInputConfig() != null && getInputConfig().getInput() != null && getInputConfig().getResearchSubset() != null) {
      DataSubset subset=DataSubset.create(config.getInput(),config.getResearchSubset());
      config.addCriterion(new Inclusion(subset));
    }
  }
}

Fixed version (ground truth):
public void createConfig(){
  ModelConfiguration config=getInputConfig();
  DataDefinition definition=getInputDefinition();
  config.removeAllCriteria();
  if (definition == null)   return;
  for (  String attr : definition.getQuasiIdentifyingAttributes()) {
    Hierarchy hierarchy=config.getHierarchy(attr);
    if (hierarchy == null || hierarchy.getHierarchy() == null) {
      hierarchy=Hierarchy.create();
      config.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.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()) {
      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);
    }
  }
  if (!config.containsCriterion(DPresence.class)) {
    if (getInputConfig() != null && getInputConfig().getInput() != null && getInputConfig().getResearchSubset() != null) {
      DataSubset subset=DataSubset.create(config.getInput(),config.getResearchSubset());
      config.addCriterion(new Inclusion(subset));
    }
  }
}