Program: 57212
Project: 57212
Buggy source:
/** 
 * Recursively build a tree by inserting cut sub-hyperplanes.
 * @param hyperplaneThickness tolerance below which points are consider tobelong to the hyperplane (which is therefore more a slab)
 * @param node current tree node (it is a leaf node at the beginningof the call)
 * @param edges list of edges to insert in the cell defined by this node(excluding edges not belonging to the cell defined by this node)
 */
private static void insertEdges(final double hyperplaneThickness,final BSPTree<Sphere2D> node,final List<Edge> edges){
  int index=0;
  Edge inserted=null;
  while (inserted == null && index < edges.size()) {
    inserted=edges.get(index++);
    if (inserted.getNode() == null) {
      if (node.insertCut(inserted.getCircle())) {
        inserted.setNode(node);
      }
 else {
        inserted=null;
      }
    }
 else {
      inserted=null;
    }
  }
  if (inserted == null) {
    final BSPTree<Sphere2D> parent=node.getParent();
    if (parent == null || node == parent.getMinus()) {
      node.setAttribute(Boolean.TRUE);
    }
 else {
      node.setAttribute(Boolean.FALSE);
    }
    return;
  }
  final List<Edge> outsideList=new ArrayList<Edge>();
  final List<Edge> insideList=new ArrayList<Edge>();
  for (  final Edge edge : edges) {
    if (edge != inserted) {
      edge.split(inserted.getCircle(),outsideList,insideList);
    }
  }
  if (!outsideList.isEmpty()) {
    insertEdges(hyperplaneThickness,node.getPlus(),outsideList);
  }
 else {
    node.getMinus().setAttribute(Boolean.FALSE);
  }
  if (!insideList.isEmpty()) {
    insertEdges(hyperplaneThickness,node.getMinus(),insideList);
  }
 else {
    node.getPlus().setAttribute(Boolean.TRUE);
  }
}

Fixed version (ground truth):
/** 
 * Recursively build a tree by inserting cut sub-hyperplanes.
 * @param hyperplaneThickness tolerance below which points are considered tobelong to the hyperplane (which is therefore more a slab)
 * @param node current tree node (it is a leaf node at the beginningof the call)
 * @param edges list of edges to insert in the cell defined by this node(excluding edges not belonging to the cell defined by this node)
 */
private static void insertEdges(final double hyperplaneThickness,final BSPTree<Sphere2D> node,final List<Edge> edges){
  int index=0;
  Edge inserted=null;
  while (inserted == null && index < edges.size()) {
    inserted=edges.get(index++);
    if (inserted.getNode() == null) {
      if (node.insertCut(inserted.getCircle())) {
        inserted.setNode(node);
      }
 else {
        inserted=null;
      }
    }
 else {
      inserted=null;
    }
  }
  if (inserted == null) {
    final BSPTree<Sphere2D> parent=node.getParent();
    if (parent == null || node == parent.getMinus()) {
      node.setAttribute(Boolean.TRUE);
    }
 else {
      node.setAttribute(Boolean.FALSE);
    }
    return;
  }
  final List<Edge> outsideList=new ArrayList<Edge>();
  final List<Edge> insideList=new ArrayList<Edge>();
  for (  final Edge edge : edges) {
    if (edge != inserted) {
      edge.split(inserted.getCircle(),outsideList,insideList);
    }
  }
  if (!outsideList.isEmpty()) {
    insertEdges(hyperplaneThickness,node.getPlus(),outsideList);
  }
 else {
    node.getPlus().setAttribute(Boolean.FALSE);
  }
  if (!insideList.isEmpty()) {
    insertEdges(hyperplaneThickness,node.getMinus(),insideList);
  }
 else {
    node.getMinus().setAttribute(Boolean.TRUE);
  }
}