Program: 82605
Project: 82605
Buggy source:
/** 
 * Set _clippedVertices to contain the two ends of the portion of the Voronoi edge that is visible within the bounds. If no part of the Edge falls within the bounds, leave _clippedVertices null.
 * @param bounds
 */
public void clipVertices(Rect2f bounds){
  float xmin=bounds.minX();
  float ymin=bounds.minY();
  float xmax=bounds.maxX();
  float ymax=bounds.maxY();
  Vertex vertex0;
  Vertex vertex1;
  float x0;
  float x1;
  float y0;
  float y1;
  if (getA() == 1.0 && getB() >= 0.0) {
    vertex0=rightVertex;
    vertex1=leftVertex;
  }
 else {
    vertex0=leftVertex;
    vertex1=rightVertex;
  }
  if (getA() == 1.0) {
    y0=ymin;
    if (vertex0 != null && vertex0.getY() > ymin) {
      y0=vertex0.getY();
    }
    if (y0 > ymax) {
      return;
    }
    x0=getC() - getB() * y0;
    y1=ymax;
    if (vertex1 != null && vertex1.getY() < ymax) {
      y1=vertex1.getY();
    }
    if (y1 < ymin) {
      return;
    }
    x1=getC() - getB() * y1;
    if ((x0 > xmax && x1 > xmax) || (x0 < xmin && x1 < xmin)) {
      return;
    }
    if (x0 > xmax) {
      x0=xmax;
      y0=(getC() - x0) / getB();
    }
 else     if (x0 < xmin) {
      x0=xmin;
      y0=(getC() - x0) / getB();
    }
    if (x1 > xmax) {
      x1=xmax;
      y1=(getC() - x1) / getB();
    }
 else     if (x1 < xmin) {
      x1=xmin;
      y1=(getC() - x1) / getB();
    }
  }
 else {
    x0=xmin;
    if (vertex0 != null && vertex0.getX() > xmin) {
      x0=vertex0.getX();
    }
    if (x0 > xmax) {
      return;
    }
    y0=getC() - getA() * x0;
    x1=xmax;
    if (vertex1 != null && vertex1.getX() < xmax) {
      x1=vertex1.getX();
    }
    if (x1 < xmin) {
      return;
    }
    y1=getC() - getA() * x1;
    if ((y0 > ymax && y1 > ymax) || (y0 < ymin && y1 < ymin)) {
      return;
    }
    if (y0 > ymax) {
      y0=ymax;
      x0=(getC() - y0) / getA();
    }
 else     if (y0 < ymin) {
      y0=ymin;
      x0=(getC() - y0) / getA();
    }
    if (y1 > ymax) {
      y1=ymax;
      x1=(getC() - y1) / getA();
    }
 else     if (y1 < ymin) {
      y1=ymin;
      x1=(getC() - y1) / getA();
    }
  }
  clippedVertices.clear();
  if (vertex0 == leftVertex) {
    clippedVertices.put(LR.LEFT,new Vector2f(x0,y0));
    clippedVertices.put(LR.RIGHT,new Vector2f(x1,y1));
  }
 else {
    clippedVertices.put(LR.RIGHT,new Vector2f(x0,y0));
    clippedVertices.put(LR.LEFT,new Vector2f(x1,y1));
  }
}

Fixed version (ground truth):
/** 
 * Set _clippedVertices to contain the two ends of the portion of the Voronoi edge that is visible within the bounds. If no part of the Edge falls within the bounds, leave _clippedVertices null.
 * @param bounds
 */
public void clipVertices(Rect2f bounds){
  float xmin=bounds.minX();
  float ymin=bounds.minY();
  float xmax=bounds.maxX();
  float ymax=bounds.maxY();
  Vertex vertex0;
  Vertex vertex1;
  float x0;
  float x1;
  float y0;
  float y1;
  if (getA() == 1.0 && getB() >= 0.0) {
    vertex0=rightVertex;
    vertex1=leftVertex;
  }
 else {
    vertex0=leftVertex;
    vertex1=rightVertex;
  }
  if (getA() == 1.0) {
    y0=ymin;
    if (vertex0 != null && vertex0.getY() > ymin) {
      y0=vertex0.getY();
    }
    if (y0 > ymax) {
      return;
    }
    x0=getC() - getB() * y0;
    y1=ymax;
    if (vertex1 != null && vertex1.getY() < ymax) {
      y1=vertex1.getY();
    }
    if (y1 < ymin) {
      return;
    }
    x1=getC() - getB() * y1;
    if ((x0 > xmax && x1 > xmax) || (x0 < xmin && x1 < xmin)) {
      return;
    }
    if (x0 > xmax) {
      x0=xmax;
      y0=(getC() - x0) / getB();
    }
 else     if (x0 < xmin) {
      x0=xmin;
      y0=(getC() - x0) / getB();
    }
    if (x1 > xmax) {
      x1=xmax;
      y1=(getC() - x1) / getB();
    }
 else     if (x1 < xmin) {
      x1=xmin;
      y1=(getC() - x1) / getB();
    }
  }
 else {
    x0=xmin;
    if (vertex0 != null && vertex0.getX() > xmin) {
      x0=vertex0.getX();
    }
    if (x0 > xmax) {
      return;
    }
    y0=getC() - getA() * x0;
    x1=xmax;
    if (vertex1 != null && vertex1.getX() < xmax) {
      x1=vertex1.getX();
    }
    if (x1 < xmin) {
      return;
    }
    y1=getC() - getA() * x1;
    if ((y0 > ymax && y1 > ymax) || (y0 < ymin && y1 < ymin)) {
      return;
    }
    if (y0 > ymax) {
      y0=ymax;
      x0=(getC() - y0) / getA();
    }
 else     if (y0 < ymin) {
      y0=ymin;
      x0=(getC() - y0) / getA();
    }
    if (y1 > ymax) {
      y1=ymax;
      x1=(getC() - y1) / getA();
    }
 else     if (y1 < ymin) {
      y1=ymin;
      x1=(getC() - y1) / getA();
    }
  }
  clippedVertices.clear();
  if (vertex0 == leftVertex) {
    clippedVertices.put(LR.LEFT,new Vector2f(x0,y0));
    clippedVertices.put(LR.RIGHT,new Vector2f(x1,y1));
  }
 else {
    clippedVertices.put(LR.RIGHT,new Vector2f(x0,y0));
    clippedVertices.put(LR.LEFT,new Vector2f(x1,y1));
  }
  if (leftVertex != null && bounds.contains(leftVertex.getX(),leftVertex.getY())) {
    clippedVertices.put(LR.LEFT,leftVertex.getCoord());
  }
  if (rightVertex != null && bounds.contains(rightVertex.getX(),rightVertex.getY())) {
    clippedVertices.put(LR.RIGHT,rightVertex.getCoord());
  }
}