Program: 86559
Project: 86559
Buggy source:
/** 
 * Generate the Delaunay's triangularization with a flip-flap algorithm. Mesh must have been set. Triangulation can only be done once. Otherwise call reprocessDelaunay
 * @throws DelaunayError
 */
public final void processDelaunay() throws DelaunayError {
  if (isMeshComputed()) {
    throw new DelaunayError(DelaunayError.DELAUNAY_ERROR_GENERATED);
  }
 else   if (points.size() < MIN_POINTS_NUMBER) {
    throw new DelaunayError(DelaunayError.DELAUNAY_ERROR_NOT_ENOUGH_POINTS_FOUND);
  }
 else {
    badEdgesQueueList=new LinkedList<DEdge>();
    edges=new ArrayList<DEdge>();
    triangleList=new ArrayList<DTriangle>();
    if (verbose) {
      log.trace("String_Node_Str");
    }
    ListIterator<DPoint> iterPoint=points.listIterator();
    DPoint p1=iterPoint.next();
    DPoint p2=iterPoint.next();
    DEdge e1=new DEdge(p1,p2);
    e1=replaceByConstraint(e1);
    List<DEdge> fromLeft=getConstraintFromLPVertical(p1);
    Boundary bound=buildStartBoundary(p1,e1,fromLeft,getConstraintFromLPVertical(p2));
    List<DEdge> added;
    List<DTriangle> tri;
    while (iterPoint.hasNext()) {
      p2=iterPoint.next();
      fromLeft=getConstraintFromLPVertical(p2);
      tri=bound.insertPoint(p2,fromLeft);
      for (      DTriangle t : tri) {
        triangleGID++;
        t.setGID(triangleGID);
      }
      triangleList.addAll(tri);
      added=bound.getAddedEdges();
      for (      DEdge e : added) {
        edgeGID++;
        e.setGID(edgeGID);
      }
      edges.addAll(added);
      badEdgesQueueList=bound.getBadEdges();
      processBadEdges();
    }
    meshComputed=true;
    if (verbose) {
      log.trace("String_Node_Str");
      log.trace("String_Node_Str");
      log.trace("String_Node_Str" + points.size());
      log.trace("String_Node_Str" + edges.size());
      log.trace("String_Node_Str" + triangleList.size());
    }
  }
}

Fixed version (ground truth):
/** 
 * Generate the Delaunay's triangularization with a flip-flap algorithm. Mesh must have been set. Triangulation can only be done once. Otherwise call reprocessDelaunay
 * @throws DelaunayError
 */
public final void processDelaunay() throws DelaunayError {
  if (isMeshComputed()) {
    throw new DelaunayError(DelaunayError.DELAUNAY_ERROR_GENERATED);
  }
 else   if (points.size() < MIN_POINTS_NUMBER) {
    throw new DelaunayError(DelaunayError.DELAUNAY_ERROR_NOT_ENOUGH_POINTS_FOUND);
  }
 else {
    triangleGID=0;
    badEdgesQueueList=new LinkedList<DEdge>();
    edges=new ArrayList<DEdge>();
    triangleList=new ArrayList<DTriangle>();
    if (verbose) {
      log.trace("String_Node_Str");
    }
    ListIterator<DPoint> iterPoint=points.listIterator();
    DPoint p1=iterPoint.next();
    DPoint p2=iterPoint.next();
    DEdge e1=new DEdge(p1,p2);
    e1=replaceByConstraint(e1);
    List<DEdge> fromLeft=getConstraintFromLPVertical(p1);
    Boundary bound=buildStartBoundary(p1,e1,fromLeft,getConstraintFromLPVertical(p2));
    List<DEdge> added;
    List<DTriangle> tri;
    while (iterPoint.hasNext()) {
      p2=iterPoint.next();
      fromLeft=getConstraintFromLPVertical(p2);
      tri=bound.insertPoint(p2,fromLeft);
      for (      DTriangle t : tri) {
        triangleGID++;
        t.setGID(triangleGID);
      }
      triangleList.addAll(tri);
      added=bound.getAddedEdges();
      for (      DEdge e : added) {
        edgeGID++;
        e.setGID(edgeGID);
      }
      edges.addAll(added);
      badEdgesQueueList=bound.getBadEdges();
      processBadEdges();
    }
    meshComputed=true;
    if (verbose) {
      log.trace("String_Node_Str");
      log.trace("String_Node_Str");
      log.trace("String_Node_Str" + points.size());
      log.trace("String_Node_Str" + edges.size());
      log.trace("String_Node_Str" + triangleList.size());
    }
  }
}