Program: 108101
Project: 108101
Buggy source:
/** 
 * Materializes any non-materialized predecessors and successors
 */
public void expand(ARXNode node){
  if (this.isComplete()) {
    return;
  }
  int[] indices=node.getTransformation();
  Transformation transformation=solutionSpace.getTransformation(indices);
  List<Long> neighbors=new ArrayList<Long>();
  for (Iterator<Long> iter=solutionSpace.getPredecessors(transformation.getIdentifier()); iter.hasNext(); ) {
    neighbors.add(iter.next());
  }
  for (Iterator<Long> iter=solutionSpace.getSuccessors(transformation.getIdentifier()); iter.hasNext(); ) {
    neighbors.add(iter.next());
  }
  Map<String,Integer> headermap=null;
  LongObjectOpenHashMap<ARXNode> map=new LongObjectOpenHashMap<ARXNode>();
  Map<Long,ARXNode> existing=new HashMap<Long,ARXNode>();
  Set<Long> missing=new HashSet<Long>();
  missing.addAll(neighbors);
  for (  ARXNode[] level : this.levels) {
    for (    ARXNode candidate : level) {
      Long id=solutionSpace.getTransformation(candidate.getTransformation()).getIdentifier();
      map.put(id,candidate);
      if (headermap == null) {
        headermap=candidate.headermap;
      }
      if (missing.contains(id)) {
        existing.put(id,candidate);
      }
    }
  }
  missing.removeAll(existing.keySet());
  Set<Integer> levels=new HashSet<Integer>();
  for (  long id : missing) {
    transformation=solutionSpace.getTransformation(id);
    ARXNode arxnode=new ARXNode(this,solutionSpace,transformation,headermap);
    map.put(id,arxnode);
    levels.add(transformation.getLevel());
  }
  for (  int level : levels) {
    List<ARXNode> newLevel=new ArrayList<ARXNode>();
    newLevel.addAll(Arrays.asList(this.levels[level]));
    for (    long id : missing) {
      ARXNode arxnode=map.get(id);
      if (arxnode.getTotalGeneralizationLevel() == level) {
        int index=0;
        while (index < newLevel.size() && compareLexicographically(newLevel.get(index),arxnode) < 0) {
          index++;
        }
        index=index == 0 ? 0 : index - 1;
        newLevel.add(index,arxnode);
      }
    }
    this.levels[level]=newLevel.toArray(new ARXNode[newLevel.size()]);
  }
  for (  long id : missing) {
    this.createExpandedRelationships(solutionSpace,map,id);
  }
}

Fixed version (ground truth):
/** 
 * Materializes any non-materialized predecessors and successors
 */
public void expand(ARXNode center){
  if (this.isComplete()) {
    return;
  }
  int[] indices=center.getTransformation();
  Transformation transformation=solutions.getTransformation(indices);
  List<Long> neighbors=new ArrayList<Long>();
  for (Iterator<Long> iter=solutions.getPredecessors(transformation.getIdentifier()); iter.hasNext(); ) {
    neighbors.add(iter.next());
  }
  for (Iterator<Long> iter=solutions.getSuccessors(transformation.getIdentifier()); iter.hasNext(); ) {
    neighbors.add(iter.next());
  }
  Map<String,Integer> headermap=null;
  LongObjectOpenHashMap<ARXNode> map=new LongObjectOpenHashMap<ARXNode>();
  Set<Long> missing=new HashSet<Long>(neighbors);
  for (  ARXNode[] level : this.levels) {
    for (    ARXNode node : level) {
      headermap=headermap != null ? headermap : node.headermap;
      Long id=solutions.getTransformation(node.getTransformation()).getIdentifier();
      map.put(id,node);
      missing.remove(id);
    }
  }
  Map<Integer,List<ARXNode>> levels=new HashMap<Integer,List<ARXNode>>();
  for (  long id : missing) {
    transformation=solutions.getTransformation(id);
    ARXNode node=new ARXNode(this,solutions,transformation,headermap);
    map.put(id,node);
    if (!levels.containsKey(transformation.getLevel())) {
      levels.put(transformation.getLevel(),new ArrayList<ARXNode>());
    }
    levels.get(transformation.getLevel()).add(node);
  }
  for (  int level : levels.keySet()) {
    List<ARXNode> nodes=levels.get(level);
    Collections.sort(nodes,new Comparator<ARXNode>(){
      public int compare(      ARXNode o1,      ARXNode o2){
        return compareLexicographically(o1,o2);
      }
    }
);
    List<ARXNode> list=new ArrayList<ARXNode>();
    int index=0;
    for (    ARXNode node : this.levels[level]) {
      while (index < nodes.size() && compareLexicographically(nodes.get(index),node) < 0) {
        list.add(nodes.get(index++));
      }
      list.add(node);
    }
    this.levels[level]=list.toArray(new ARXNode[list.size()]);
  }
  for (  long id : missing) {
    this.createExpandedRelationships(solutions,map,id);
  }
  this.estimateInformationLoss();
}