Program: 108117
Project: 108117
Buggy source:
/** 
 * Constructor.
 * @param solutions The solution space
 * @param optimum The optimum
 * @param header The header
 * @param config The config
 */
ARXLattice(final SolutionSpace solutions,final Transformation optimum,final String[] header,final ARXConfigurationInternal config){
  this.metric=config.getMetric();
  this.monotonicNonAnonymous=metric.isMonotonic() || !config.isSuppressionAlwaysEnabled();
  this.monotonicAnonymous=metric.isMonotonic() || config.getAbsoluteMaxOutliers() == 0;
  this.uncertainty=config.isPracticalMonotonicity() && config.getMaxOutliers() != 0d && (!config.isCriterionMonotonic() || !config.getMetric().isMonotonic());
  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=solutions.unsafeGetAllTransformations(); iterator.hasNext(); ) {
    Transformation transformation=solutions.getTransformation(iterator.next());
    if (!levels.containsKey(transformation.getLevel())) {
      levels.put(transformation.getLevel(),new ArrayList<ARXNode>());
    }
    ARXNode node=new ARXNode(solutions,transformation,headermap);
    size++;
    map.put(transformation.getId(),node);
    levels.get(transformation.getLevel()).add(node);
    if (transformation.getId() == optimum.getId()) {
      this.optimum=node;
    }
    maxlevel=Math.max(maxlevel,transformation.getLevel());
  }
  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=solutions.unsafeGetAllTransformations(); iterator.hasNext(); ) {
    final long id=iterator.next();
    final ARXNode fnode=map.get(id);
    List<ARXNode> successors=new ArrayList<ARXNode>();
    List<ARXNode> predecessors=new ArrayList<ARXNode>();
    for (Iterator<Long> iter1=solutions.getSuccessors(id); iter1.hasNext(); ) {
      ARXNode node=map.get(iter1.next());
      if (node != null) {
        successors.add(node);
      }
    }
    for (Iterator<Long> iter2=solutions.getPredecessors(id); iter2.hasNext(); ) {
      ARXNode node=map.get(iter2.next());
      if (node != null) {
        predecessors.add(node);
      }
    }
    fnode.successors=successors.toArray(new ARXNode[successors.size()]);
    fnode.predecessors=predecessors.toArray(new ARXNode[predecessors.size()]);
  }
  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 optimum The optimum
 * @param header The header
 * @param config The config
 */
ARXLattice(final SolutionSpace solutions,final Transformation optimum,final String[] header,final ARXConfigurationInternal config){
  this.metric=config.getMetric();
  this.monotonicNonAnonymous=metric.isMonotonic() || !config.isSuppressionAlwaysEnabled();
  this.monotonicAnonymous=metric.isMonotonic() || config.getAbsoluteMaxOutliers() == 0;
  this.uncertainty=config.isPracticalMonotonicity() && config.getMaxOutliers() != 0d && (!config.isCriterionMonotonic() || !config.getMetric().isMonotonic());
  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=solutions.unsafeGetAllTransformations(); iterator.hasNext(); ) {
    Transformation transformation=solutions.getTransformation(iterator.next());
    if (!levels.containsKey(transformation.getLevel())) {
      levels.put(transformation.getLevel(),new ArrayList<ARXNode>());
    }
    ARXNode node=new ARXNode(solutions,transformation,headermap);
    size++;
    map.put(transformation.getId(),node);
    levels.get(transformation.getLevel()).add(node);
    if (optimum != null && transformation.getId() == optimum.getId()) {
      this.optimum=node;
    }
    maxlevel=Math.max(maxlevel,transformation.getLevel());
  }
  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=solutions.unsafeGetAllTransformations(); iterator.hasNext(); ) {
    final long id=iterator.next();
    final ARXNode fnode=map.get(id);
    List<ARXNode> successors=new ArrayList<ARXNode>();
    List<ARXNode> predecessors=new ArrayList<ARXNode>();
    for (Iterator<Long> iter1=solutions.getSuccessors(id); iter1.hasNext(); ) {
      ARXNode node=map.get(iter1.next());
      if (node != null) {
        successors.add(node);
      }
    }
    for (Iterator<Long> iter2=solutions.getPredecessors(id); iter2.hasNext(); ) {
      ARXNode node=map.get(iter2.next());
      if (node != null) {
        predecessors.add(node);
      }
    }
    fnode.successors=successors.toArray(new ARXNode[successors.size()]);
    fnode.predecessors=predecessors.toArray(new ARXNode[predecessors.size()]);
  }
  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();
}