Program: 108063
Project: 108063
Buggy source:
/** 
 * Constructor.
 * @param solutions The solution space
 * @param complete Is the solution space characterized by an optimal algorithm
 * @param optimum The optimum
 * @param header The header
 * @param config The config
 */
ARXLattice(final SolutionSpace solutions,final boolean complete,final Transformation optimum,final String[] header,final ARXConfigurationInternal config){
  this.solutions=solutions;
  this.metric=config.getMetric();
  this.monotonicNonAnonymous=metric.isMonotonic() || !config.isSuppressionAlwaysEnabled();
  this.monotonicAnonymous=metric.isMonotonic() || config.getAbsoluteMaxOutliers() == 0;
  this.complete=complete;
  this.virtualSize=solutions.getSize();
  this.uncertainty=config.isPracticalMonotonicity() && (config.getMonotonicityOfUtility() != Monotonicity.FULL || config.getMonotonicityOfPrivacy() != Monotonicity.FULL);
  final Map<String,Integer> headermap=new HashMap<String,Integer>();
  int index=0;
  for (int i=0; i < header.length; i++) {
    headermap.put(header[i],index++);
  }
  final LongObjectOpenHashMap<ARXNode> map=new LongObjectOpenHashMap<ARXNode>();
  final IntObjectOpenHashMap<List<ARXNode>> levels=new IntObjectOpenHashMap<List<ARXNode>>();
  int size=0;
  int maxlevel=0;
  for (Iterator<Long> iterator=complete ? solutions.unsafeGetAllTransformations() : solutions.getMaterializedTransformations(); iterator.hasNext(); ) {
    Transformation transformation=solutions.getTransformation(iterator.next());
    if (!levels.containsKey(transformation.getLevel())) {
      levels.put(transformation.getLevel(),new ArrayList<ARXNode>());
    }
    ARXNode node=new ARXNode(this,solutions,transformation,headermap);
    map.put(transformation.getIdentifier(),node);
    levels.get(transformation.getLevel()).add(node);
    if (optimum != null && transformation.getIdentifier() == optimum.getIdentifier()) {
      this.optimum=node;
    }
    maxlevel=Math.max(maxlevel,transformation.getLevel());
    size++;
  }
  if (!complete) {
    Transformation top=solutions.getTop();
    Transformation bottom=solutions.getBottom();
    if (!map.containsKey(top.getIdentifier())) {
      if (!levels.containsKey(top.getLevel())) {
        levels.put(top.getLevel(),new ArrayList<ARXNode>());
      }
      ARXNode node=new ARXNode(this,solutions,top,headermap);
      map.put(top.getIdentifier(),node);
      levels.get(top.getLevel()).add(node);
      maxlevel=top.getLevel();
      size++;
    }
    if (!map.containsKey(bottom.getIdentifier())) {
      if (!levels.containsKey(bottom.getLevel())) {
        levels.put(bottom.getLevel(),new ArrayList<ARXNode>());
      }
      ARXNode node=new ARXNode(this,solutions,bottom,headermap);
      map.put(bottom.getIdentifier(),node);
      levels.get(bottom.getLevel()).add(node);
      size++;
    }
  }
  this.size=size;
  this.levels=new ARXNode[maxlevel + 1][];
  for (int i=0; i < this.levels.length; i++) {
    if (levels.containsKey(i)) {
      this.levels[i]=levels.get(i).toArray(new ARXNode[levels.get(i).size()]);
    }
 else {
      this.levels[i]=new ARXNode[0];
    }
  }
  for (Iterator<Long> iterator=complete ? solutions.unsafeGetAllTransformations() : solutions.getMaterializedTransformations(); iterator.hasNext(); ) {
    createRelationships(solutions,map,iterator.next());
  }
  if (!complete) {
    createRelationships(solutions,map,solutions.getTop().getIdentifier());
    createRelationships(solutions,map,solutions.getBottom().getIdentifier());
  }
  outer:   for (int i=0; i < this.levels.length; i++) {
    final ARXNode[] level=this.levels[i];
    for (int j=0; j < level.length; j++) {
      final ARXNode node=level[j];
      if (node != null) {
        bottom=node;
        break outer;
      }
    }
  }
  outer:   for (int i=this.levels.length - 1; i >= 0; i--) {
    final ARXNode[] level=this.levels[i];
    for (int j=0; j < level.length; j++) {
      final ARXNode node=level[j];
      if (node != null) {
        top=node;
        break outer;
      }
    }
  }
  estimateInformationLoss();
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param solutions The solution space
 * @param complete Is the solution space characterized by an optimal algorithm
 * @param optimum The optimum
 * @param header The header
 * @param config The config
 */
ARXLattice(final SolutionSpace solutions,final boolean complete,final Transformation optimum,final String[] header,final ARXConfigurationInternal config){
  this.solutions=solutions;
  this.metric=config.getMetric();
  this.monotonicNonAnonymous=metric.isMonotonic() || !config.isSuppressionAlwaysEnabled();
  this.monotonicAnonymous=metric.isMonotonic() || config.getAbsoluteMaxOutliers() == 0;
  this.complete=complete;
  this.virtualSize=solutions.getSize();
  this.uncertainty=config.isPracticalMonotonicity();
  final Map<String,Integer> headermap=new HashMap<String,Integer>();
  int index=0;
  for (int i=0; i < header.length; i++) {
    headermap.put(header[i],index++);
  }
  final LongObjectOpenHashMap<ARXNode> map=new LongObjectOpenHashMap<ARXNode>();
  final IntObjectOpenHashMap<List<ARXNode>> levels=new IntObjectOpenHashMap<List<ARXNode>>();
  int size=0;
  int maxlevel=0;
  for (Iterator<Long> iterator=complete ? solutions.unsafeGetAllTransformations() : solutions.getMaterializedTransformations(); iterator.hasNext(); ) {
    Transformation transformation=solutions.getTransformation(iterator.next());
    if (!levels.containsKey(transformation.getLevel())) {
      levels.put(transformation.getLevel(),new ArrayList<ARXNode>());
    }
    ARXNode node=new ARXNode(this,solutions,transformation,headermap);
    map.put(transformation.getIdentifier(),node);
    levels.get(transformation.getLevel()).add(node);
    if (optimum != null && transformation.getIdentifier() == optimum.getIdentifier()) {
      this.optimum=node;
    }
    maxlevel=Math.max(maxlevel,transformation.getLevel());
    size++;
  }
  if (!complete) {
    Transformation top=solutions.getTop();
    Transformation bottom=solutions.getBottom();
    if (!map.containsKey(top.getIdentifier())) {
      if (!levels.containsKey(top.getLevel())) {
        levels.put(top.getLevel(),new ArrayList<ARXNode>());
      }
      ARXNode node=new ARXNode(this,solutions,top,headermap);
      map.put(top.getIdentifier(),node);
      levels.get(top.getLevel()).add(node);
      maxlevel=top.getLevel();
      size++;
    }
    if (!map.containsKey(bottom.getIdentifier())) {
      if (!levels.containsKey(bottom.getLevel())) {
        levels.put(bottom.getLevel(),new ArrayList<ARXNode>());
      }
      ARXNode node=new ARXNode(this,solutions,bottom,headermap);
      map.put(bottom.getIdentifier(),node);
      levels.get(bottom.getLevel()).add(node);
      size++;
    }
  }
  this.size=size;
  this.levels=new ARXNode[maxlevel + 1][];
  for (int i=0; i < this.levels.length; i++) {
    if (levels.containsKey(i)) {
      this.levels[i]=levels.get(i).toArray(new ARXNode[levels.get(i).size()]);
    }
 else {
      this.levels[i]=new ARXNode[0];
    }
  }
  for (Iterator<Long> iterator=complete ? solutions.unsafeGetAllTransformations() : solutions.getMaterializedTransformations(); iterator.hasNext(); ) {
    createRelationships(solutions,map,iterator.next());
  }
  if (!complete) {
    createRelationships(solutions,map,solutions.getTop().getIdentifier());
    createRelationships(solutions,map,solutions.getBottom().getIdentifier());
  }
  outer:   for (int i=0; i < this.levels.length; i++) {
    final ARXNode[] level=this.levels[i];
    for (int j=0; j < level.length; j++) {
      final ARXNode node=level[j];
      if (node != null) {
        bottom=node;
        break outer;
      }
    }
  }
  outer:   for (int i=this.levels.length - 1; i >= 0; i--) {
    final ARXNode[] level=this.levels[i];
    for (int j=0; j < level.length; j++) {
      final ARXNode node=level[j];
      if (node != null) {
        top=node;
        break outer;
      }
    }
  }
  estimateInformationLoss();
}