Program: 86578
Project: 86578
Buggy source:
/** 
 * Sort two edges (this and edge, indeed), and sort them according to their intersection point with the line l of equation x=abs. if p1 (p2) is the intersection between l and the line defined by this (edge), this method returns : * -1 if p1 < p2 or ( p1 == p2 and this is "under" edge) * 0 if p1 == p2 and (this and edge are colinear) * 1 if p1 > p2 or (p1 == p2 and edge is under this)
 * @param edge
 * @return
 */
public int verticalSort(MyEdge edge,double abs) throws DelaunayError {
  MyPoint pThis=this.getPointFromItsX(abs);
  MyPoint pEdge=edge.getPointFromItsX(abs);
  if (pThis == null || pEdge == null) {
    throw new DelaunayError("String_Node_Str");
  }
  int c=pThis.compareTo2D(pEdge);
  if (c == 0) {
    if (this.isVertical()) {
      c=(this.getPointRight().compareTo2D(edge.getPointRight()));
    }
 else     if (edge.isVertical()) {
      c=edge.getPointRight().compareTo2D(this.getPointRight());
    }
 else {
      double deltaXT=getPointRight().getX() - getPointLeft().getX();
      double deltaYT=getPointRight().getY() - getPointLeft().getY();
      double deltaXO=edge.getPointRight().getX() - edge.getPointLeft().getX();
      double deltaYO=edge.getPointRight().getY() - edge.getPointLeft().getY();
      double cT=deltaYT / deltaXT;
      double cO=deltaYO / deltaXO;
      if (-MyTools.EPSILON < cT - cO && cT - cO < MyTools.EPSILON) {
        c=0;
      }
 else       if (cT < cO) {
        c=-1;
      }
 else {
        c=1;
      }
    }
  }
  return c;
}

Fixed version (ground truth):
/** 
 * Sort two edges (this and edge, indeed), and sort them according to their intersection point with the line l of equation x=abs. if p1 (p2) is the intersection between l and the line defined by this (edge), this method returns : * -1 if p1 < p2 or ( p1 == p2 and this is "under" edge) * 0 if p1 == p2 and (this and edge are colinear) * 1 if p1 > p2 or (p1 == p2 and edge is under this)
 * @param edge
 * @return
 */
public int verticalSort(MyEdge edge,double abs) throws DelaunayError {
  MyPoint pThis=this.getPointFromItsX(abs);
  MyPoint pEdge=edge.getPointFromItsX(abs);
  if (pThis == null || pEdge == null) {
    throw new DelaunayError("String_Node_Str");
  }
  int c=pThis.compareTo2D(pEdge);
  if (c == 0) {
    if (this.isVertical()) {
      c=this.getPointRight().compareTo2D(edge.getPointRight());
    }
 else     if (edge.isVertical()) {
      c=edge.getPointRight().compareTo2D(this.getPointRight());
    }
 else {
      double deltaXT=getPointRight().getX() - getPointLeft().getX();
      double deltaYT=getPointRight().getY() - getPointLeft().getY();
      double deltaXO=edge.getPointRight().getX() - edge.getPointLeft().getX();
      double deltaYO=edge.getPointRight().getY() - edge.getPointLeft().getY();
      double cT=deltaYT / deltaXT;
      double cO=deltaYO / deltaXO;
      if (-MyTools.EPSILON < cT - cO && cT - cO < MyTools.EPSILON) {
        c=getPointRight().compareTo2D(edge.getPointRight());
        if (c == 0) {
          c=getPointLeft().compareTo2D(edge.getPointLeft());
        }
      }
 else       if (cT < cO) {
        c=-1;
      }
 else {
        c=1;
      }
    }
  }
  return c;
}