Program: 107913
Project: 107913
Buggy source:
/** 
 * Clones this config and projects everything onto the given subset.<br> - All privacy models will be cloned<br> - Subsets in d-presence will be projected accordingly<br> - Utility measures will be cloned<br> - Replaces estimated k-map with according k-anonymity<br>
 * @param gsFactor 
 * @return
 */
protected ARXConfiguration getInstanceForLocalRecoding(RowSet rowset,double gsFactor){
  for (  PrivacyCriterion criterion : this.getPrivacyModels()) {
    if (!criterion.isLocalRecodingSupported()) {
      throw new IllegalStateException("String_Node_Str");
    }
  }
  DataSubset subset=this.getSubset();
  if (subset != null) {
    subset=subset.getSubsetInstance(rowset);
  }
 else {
    subset=DataSubset.create(rowset.length(),rowset);
  }
  boolean subsetAdded=false;
  HashSet<PrivacyCriterion> criteria=new HashSet<PrivacyCriterion>();
  for (  PrivacyCriterion criterion : this.getPrivacyModels()) {
    PrivacyCriterion clone=criterion.clone(subset);
    subsetAdded|=criterion.isSubsetAvailable();
    if (clone instanceof KAnonymity) {
      Iterator<PrivacyCriterion> iter=criteria.iterator();
      while (iter.hasNext()) {
        PrivacyCriterion other=iter.next();
        if (other instanceof KAnonymity) {
          if (((KAnonymity)other).getK() <= ((KAnonymity)clone).getK()) {
            iter.remove();
          }
 else {
            clone=null;
          }
        }
      }
      if (clone != null) {
        criteria.add(clone);
      }
    }
 else {
      criteria.add(clone);
    }
  }
  if (!subsetAdded) {
    criteria.add(new Inclusion(subset));
  }
  ARXConfiguration result=this.clone();
  result.aCriteria=null;
  result.criteria=criteria;
  MetricConfiguration utilityConfig=result.getQualityModel().getConfiguration();
  utilityConfig.setGsFactor(gsFactor);
  result.metric=result.getQualityModel().getDescription().createInstance(utilityConfig);
  return result;
}

Fixed version (ground truth):
/** 
 * Clones this config and projects everything onto the given subset.<br> - All privacy models will be cloned<br> - Subsets in d-presence will be projected accordingly<br> - Utility measures will be cloned<br> - Replaces estimated k-map with according k-anonymity<br>
 * @param gsFactor 
 * @return
 */
protected ARXConfiguration getInstanceForLocalRecoding(RowSet rowset,double gsFactor){
  for (  PrivacyCriterion criterion : this.getPrivacyModels()) {
    if (!criterion.isLocalRecodingSupported()) {
      throw new IllegalStateException("String_Node_Str");
    }
  }
  DataSubset subset=this.getSubset();
  if (subset != null) {
    subset=subset.getSubsetInstance(rowset);
  }
  HashSet<PrivacyCriterion> criteria=new HashSet<PrivacyCriterion>();
  for (  PrivacyCriterion criterion : this.getPrivacyModels()) {
    PrivacyCriterion clone=criterion.clone(subset);
    if (clone instanceof KAnonymity) {
      Iterator<PrivacyCriterion> iter=criteria.iterator();
      while (iter.hasNext()) {
        PrivacyCriterion other=iter.next();
        if (other instanceof KAnonymity) {
          if (((KAnonymity)other).getK() <= ((KAnonymity)clone).getK()) {
            iter.remove();
          }
 else {
            clone=null;
          }
        }
      }
      if (clone != null) {
        criteria.add(clone);
      }
    }
 else {
      criteria.add(clone);
    }
  }
  ARXConfiguration result=this.clone();
  result.aCriteria=null;
  result.criteria=criteria;
  MetricConfiguration utilityConfig=result.getQualityModel().getConfiguration();
  utilityConfig.setGsFactor(gsFactor);
  result.metric=result.getQualityModel().getDescription().createInstance(utilityConfig);
  return result;
}