Program: 108437
Project: 108437
Buggy source:
/** 
 * Initializes the data structures for displaying a new lattice
 * @param lattice
 */
private void initialize(final ARXResult r,final ModelNodeFilter filter){
  if ((r == null) || (r.getLattice() == null) || (filter == null)) {
    reset();
    return;
  }
  final ARXLattice l=r.getLattice();
  latticeWidth=0;
  numNodes=0;
  optimum=r.getGlobalOptimum();
  final List<List<ARXNode>> lattice=new ArrayList<List<ARXNode>>();
  for (  final ARXNode[] level : l.getLevels()) {
    final List<ARXNode> lvl=new ArrayList<ARXNode>();
    for (    final ARXNode node : level) {
      if (filter.isAllowed(r.getLattice(),node)) {
        lvl.add(node);
        numNodes++;
        node.getAttributes().put(ATTRIBUTE_VISIBLE,true);
      }
 else {
        node.getAttributes().put(ATTRIBUTE_VISIBLE,false);
      }
    }
    if (!lvl.isEmpty()) {
      lattice.add(lvl);
    }
    latticeWidth=Math.max(latticeWidth,lvl.size());
  }
  latticeHeight=lattice.size();
  if (numNodes > model.getMaxNodesInViewer()) {
    return;
  }
  for (  ARXNode node : this.lattice) {
    Path path=(Path)node.getAttributes().get(ATTRIBUTE_PATH);
    if (path != null)     path.dispose();
  }
  this.lattice.clear();
  int y=latticeHeight - 1;
  for (  final List<ARXNode> level : lattice) {
    for (int i=0; i < level.size(); i++) {
      final ARXNode node=level.get(i);
      this.lattice.add(node);
      node.getAttributes().put(ATTRIBUTE_POSITION,i);
      node.getAttributes().put(ATTRIBUTE_LEVEL,y);
      node.getAttributes().put(ATTRIBUTE_LEVELSIZE,level.size());
      String text=Arrays.toString(node.getTransformation());
      text=text.substring(1,text.length() - 1);
      node.getAttributes().put(ATTRIBUTE_LABEL,text);
    }
    y--;
  }
  initializeCanvas();
}

Fixed version (ground truth):
/** 
 * Initializes the data structures for displaying a new lattice
 * @param lattice
 */
private void initialize(final ARXResult r,final ModelNodeFilter filter){
  if ((r == null) || (r.getLattice() == null) || (filter == null)) {
    reset();
    return;
  }
  final ARXLattice l=r.getLattice();
  latticeWidth=0;
  numNodes=0;
  optimum=r.getGlobalOptimum();
  final List<List<ARXNode>> lattice=new ArrayList<List<ARXNode>>();
  for (  final ARXNode[] level : l.getLevels()) {
    final List<ARXNode> lvl=new ArrayList<ARXNode>();
    for (    final ARXNode node : level) {
      if (filter.isAllowed(r.getLattice(),node)) {
        lvl.add(node);
        numNodes++;
        node.getAttributes().put(ATTRIBUTE_VISIBLE,true);
      }
 else {
        node.getAttributes().put(ATTRIBUTE_VISIBLE,false);
      }
    }
    if (!lvl.isEmpty()) {
      lattice.add(lvl);
    }
    latticeWidth=Math.max(latticeWidth,lvl.size());
  }
  latticeHeight=lattice.size();
  if (numNodes > model.getMaxNodesInViewer()) {
    return;
  }
  for (  ARXNode node : this.lattice) {
    Path path=(Path)node.getAttributes().get(ATTRIBUTE_PATH);
    if (path != null) {
      path.dispose();
      node.getAttributes().put(ATTRIBUTE_PATH,null);
    }
  }
  this.lattice.clear();
  int y=latticeHeight - 1;
  for (  final List<ARXNode> level : lattice) {
    for (int i=0; i < level.size(); i++) {
      final ARXNode node=level.get(i);
      this.lattice.add(node);
      node.getAttributes().put(ATTRIBUTE_POSITION,i);
      node.getAttributes().put(ATTRIBUTE_LEVEL,y);
      node.getAttributes().put(ATTRIBUTE_LEVELSIZE,level.size());
      String text=Arrays.toString(node.getTransformation());
      text=text.substring(1,text.length() - 1);
      node.getAttributes().put(ATTRIBUTE_LABEL,text);
    }
    y--;
  }
  initializeCanvas();
}