Program: 86567
Project: 86567
Buggy source:
/** 
 * Build the boundary needed to begin the building of the mesh.
 * @param p1
 * @param e1
 * @param constraintsP1
 * @return
 */
final Boundary buildStartBoundary(Point p1,Edge e1,List<Edge> constraintsP1,List<Edge> constraintsP2){
  BoundaryPart bp;
  Boundary bound=new Boundary();
  List<Edge> boundEdges=new LinkedList<Edge>();
  boundEdges.add(e1);
  List<Edge> boundEdgesBis=new LinkedList<Edge>();
  boundEdgesBis.add(e1);
  if (constraintsP2.isEmpty()) {
    e1.setDegenerated(true);
  }
 else {
    e1.setShared(true);
  }
  List<BoundaryPart> bps=new ArrayList<BoundaryPart>();
  if (constraintsP1 == null || constraintsP1.isEmpty()) {
    bp=new BoundaryPart(boundEdges);
    bps.add(bp);
    boundEdges=new LinkedList<Edge>();
    boundEdges.add(e1);
    fillWithP2Constraints(boundEdgesBis,constraintsP2,bps,e1);
    if (!bps.isEmpty()) {
      boundEdges=new LinkedList<Edge>();
      boundEdges.add(e1);
      bps.get(bps.size() - 1).setBoundaryEdges(boundEdges);
    }
    bound.setBoundary(bps);
  }
 else {
    Edge current=constraintsP1.get(0);
    ListIterator<Edge> iter=constraintsP1.listIterator();
    boolean direct=current.getEndPoint().equals(current.getPointRight());
    if ((direct && current.isRight(e1.getPointRight())) || (!direct && current.isLeft(e1.getPointRight()))) {
      bp=new BoundaryPart(boundEdges);
      bps.add(bp);
      fillWithP2Constraints(boundEdgesBis,constraintsP2,bps,e1);
      while (iter.hasNext()) {
        current=iter.next();
        bps.add(new BoundaryPart(current));
      }
    }
 else {
      boolean set=false;
      Edge mem=iter.next();
      current=null;
      while (iter.hasNext()) {
        current=iter.next();
        if (!set && (current.isRight(e1.getPointRight()) || current.getPointRight().equals(e1.getEndPoint()))) {
          bps.add(new BoundaryPart(boundEdges,mem));
          fillWithP2Constraints(boundEdgesBis,constraintsP2,bps,e1);
          mem=current;
          set=true;
        }
 else {
          if (!set && e1.equals(current)) {
            bps.add(new BoundaryPart(boundEdges,mem));
          }
 else {
            bps.add(new BoundaryPart(mem));
          }
          mem=current;
        }
      }
      if (current != null) {
        if (current.isRight(e1.getPointRight())) {
          bps.add(new BoundaryPart(current));
        }
 else         if (!current.equals(e1)) {
          bps.add(new BoundaryPart(boundEdges,current));
        }
      }
      if (!set) {
        mem=mem.equals(e1) ? null : mem;
        bps.add(new BoundaryPart(boundEdges,mem));
        fillWithP2Constraints(boundEdgesBis,constraintsP2,bps,e1);
      }
    }
  }
  edges.add(e1);
  bound.setBoundary(bps);
  return bound;
}

Fixed version (ground truth):
/** 
 * Build the boundary needed to begin the building of the mesh.
 * @param p1
 * @param e1
 * @param constraintsP1
 * @return
 */
final Boundary buildStartBoundary(Point p1,Edge e1,List<Edge> constraintsP1,List<Edge> constraintsP2){
  BoundaryPart bp;
  Boundary bound=new Boundary();
  List<Edge> boundEdges=new LinkedList<Edge>();
  boundEdges.add(e1);
  List<Edge> boundEdgesBis=new LinkedList<Edge>();
  boundEdgesBis.add(e1);
  if (constraintsP2.isEmpty()) {
    e1.setDegenerated(true);
  }
 else {
    e1.setShared(true);
  }
  List<BoundaryPart> bps=new ArrayList<BoundaryPart>();
  if (constraintsP1 == null || constraintsP1.isEmpty()) {
    bp=new BoundaryPart(boundEdges);
    bps.add(bp);
    boundEdges=new LinkedList<Edge>();
    boundEdges.add(e1);
    fillWithP2Constraints(boundEdgesBis,constraintsP2,bps,e1);
    if (!bps.isEmpty()) {
      boundEdges=new LinkedList<Edge>();
      boundEdges.add(e1);
      bps.get(bps.size() - 1).setBoundaryEdges(boundEdges);
    }
    bound.setBoundary(bps);
  }
 else {
    Edge current=constraintsP1.get(0);
    ListIterator<Edge> iter=constraintsP1.listIterator();
    boolean direct=current.getEndPoint().equals(current.getPointRight());
    if ((direct && current.isRight(e1.getPointRight())) || (!direct && current.isLeft(e1.getPointRight()))) {
      bp=new BoundaryPart(boundEdges);
      bps.add(bp);
      fillWithP2Constraints(boundEdgesBis,constraintsP2,bps,e1);
      while (iter.hasNext()) {
        current=iter.next();
        bps.add(new BoundaryPart(current));
      }
    }
 else {
      boolean set=false;
      Edge mem=iter.next();
      current=null;
      while (iter.hasNext()) {
        current=iter.next();
        if (!set && (current.isRight(e1.getPointRight()) || current.getPointRight().equals(e1.getEndPoint()))) {
          if (mem.equals(e1)) {
            bps.add(new BoundaryPart(boundEdges));
          }
 else {
            bps.add(new BoundaryPart(boundEdges,mem));
          }
          fillWithP2Constraints(boundEdgesBis,constraintsP2,bps,e1);
          mem=current;
          set=true;
        }
 else {
          if (!set && e1.equals(current)) {
            bps.add(new BoundaryPart(boundEdges,mem));
          }
 else {
            bps.add(new BoundaryPart(mem));
          }
          mem=current;
        }
      }
      if (current != null) {
        if (current.isRight(e1.getPointRight())) {
          bps.add(new BoundaryPart(current));
        }
 else         if (!current.equals(e1)) {
          bps.add(new BoundaryPart(boundEdges,current));
        }
      }
      if (!set) {
        mem=mem.equals(e1) ? null : mem;
        bps.add(new BoundaryPart(boundEdges,mem));
        fillWithP2Constraints(boundEdgesBis,constraintsP2,bps,e1);
      }
    }
  }
  edges.add(e1);
  bound.setBoundary(bps);
  return bound;
}