Program: 86585
Project: 86585
Buggy source:
/** 
 * Add a point inside a triangle The point is supposed to be in the points list
 * @param aTriangle
 * @param aPoint
 * @throws DelaunayError
 */
private void addPointInsideTriangle(MyTriangle aTriangle,MyPoint aPoint){
  MyEdge oldEdge[]=new MyEdge[3];
  for (int i=0; i < 3; i++) {
    oldEdge[i]=aTriangle.edges[i];
  }
  MyPoint firstPoint=aTriangle.edges[0].getStartPoint();
  MyPoint secondPoint=aTriangle.edges[0].getEndPoint();
  MyPoint alterPoint=aTriangle.getAlterPoint(firstPoint,secondPoint);
  MyTriangle aTriangle1=new MyTriangle();
  MyTriangle aTriangle2=new MyTriangle();
  MyTriangle aTriangle3=aTriangle;
  triangles.add(aTriangle1);
  triangles.add(aTriangle2);
  MyEdge anEdge[]=new MyEdge[3];
  anEdge[0]=new MyEdge(secondPoint,aPoint);
  anEdge[1]=new MyEdge(aPoint,firstPoint);
  anEdge[2]=new MyEdge(aPoint,alterPoint);
  for (int i=0; i < 3; i++) {
    edges.add(anEdge[i]);
  }
  aTriangle1.edges[0]=oldEdge[0];
  aTriangle1.edges[1]=anEdge[0];
  aTriangle1.edges[2]=anEdge[1];
  if ((secondPoint == oldEdge[1].getStartPoint()) || (secondPoint == oldEdge[1].getEndPoint()))   aTriangle2.edges[0]=oldEdge[1];
 else   aTriangle2.edges[0]=oldEdge[2];
  aTriangle2.edges[1]=anEdge[2];
  aTriangle2.edges[2]=anEdge[0];
  if ((firstPoint == oldEdge[2].getStartPoint()) || (firstPoint == oldEdge[2].getEndPoint()))   aTriangle3.edges[0]=oldEdge[2];
 else   aTriangle3.edges[0]=oldEdge[1];
  aTriangle3.edges[1]=anEdge[1];
  aTriangle3.edges[2]=anEdge[2];
  if (aTriangle1.edges[0].getLeft() == aTriangle)   aTriangle1.edges[0].setLeft(aTriangle1);
 else   aTriangle1.edges[0].setRight(aTriangle1);
  if (aTriangle2.edges[0].getLeft() == aTriangle)   aTriangle2.edges[0].setLeft(aTriangle2);
 else   aTriangle2.edges[0].setRight(aTriangle2);
  if (aTriangle3.edges[0].getLeft() == aTriangle)   aTriangle3.edges[0].setLeft(aTriangle3);
 else   aTriangle3.edges[0].setRight(aTriangle3);
  if (anEdge[0].isLeft(firstPoint)) {
    anEdge[0].setLeft(aTriangle1);
    anEdge[0].setRight(aTriangle2);
  }
 else {
    anEdge[0].setRight(aTriangle1);
    anEdge[0].setLeft(aTriangle2);
  }
  if (anEdge[1].isLeft(alterPoint)) {
    anEdge[1].setLeft(aTriangle3);
    anEdge[1].setRight(aTriangle1);
  }
 else {
    anEdge[1].setRight(aTriangle3);
    anEdge[1].setLeft(aTriangle1);
  }
  if (anEdge[2].isLeft(firstPoint)) {
    anEdge[2].setLeft(aTriangle3);
    anEdge[2].setRight(aTriangle2);
  }
 else {
    anEdge[2].setRight(aTriangle3);
    anEdge[2].setLeft(aTriangle2);
  }
  aTriangle1.recomputeCenter();
  aTriangle2.recomputeCenter();
  aTriangle3.recomputeCenter();
  if (!isMeshComputed())   for (int i=0; i < 3; i++) {
    if (!badEdgesQueueList.contains(aTriangle1.edges[i]))     badEdgesQueueList.add(aTriangle1.edges[i]);
    if (!badEdgesQueueList.contains(aTriangle2.edges[i]))     badEdgesQueueList.add(aTriangle2.edges[i]);
    if (!badEdgesQueueList.contains(aTriangle3.edges[i]))     badEdgesQueueList.add(aTriangle3.edges[i]);
  }
}

Fixed version (ground truth):
/** 
 * Add a point inside a triangle The point is supposed to be in the points list
 * @param aTriangle
 * @param aPoint
 * @throws DelaunayError
 */
private void addPointInsideTriangle(MyTriangle aTriangle,MyPoint aPoint){
  MyEdge oldEdge[]=new MyEdge[3];
  for (int i=0; i < 3; i++) {
    oldEdge[i]=aTriangle.edges[i];
  }
  MyPoint firstPoint=aTriangle.edges[0].getStartPoint();
  MyPoint secondPoint=aTriangle.edges[0].getEndPoint();
  MyPoint alterPoint=aTriangle.getAlterPoint(firstPoint,secondPoint);
  MyTriangle aTriangle1=new MyTriangle();
  MyTriangle aTriangle2=new MyTriangle();
  MyTriangle aTriangle3=aTriangle;
  triangles.add(aTriangle1);
  triangles.add(aTriangle2);
  MyEdge anEdge[]=new MyEdge[3];
  anEdge[0]=new MyEdge(secondPoint,aPoint);
  anEdge[1]=new MyEdge(aPoint,firstPoint);
  anEdge[2]=new MyEdge(aPoint,alterPoint);
  for (int i=0; i < 3; i++) {
    edges.add(anEdge[i]);
  }
  aTriangle1.edges[0]=oldEdge[0];
  aTriangle1.edges[1]=anEdge[0];
  aTriangle1.edges[2]=anEdge[1];
  if ((secondPoint == oldEdge[1].getStartPoint()) || (secondPoint == oldEdge[1].getEndPoint()))   aTriangle2.edges[0]=oldEdge[1];
 else   aTriangle2.edges[0]=oldEdge[2];
  aTriangle2.edges[1]=anEdge[2];
  aTriangle2.edges[2]=anEdge[0];
  if ((firstPoint == oldEdge[2].getStartPoint()) || (firstPoint == oldEdge[2].getEndPoint()))   aTriangle3.edges[0]=oldEdge[2];
 else   aTriangle3.edges[0]=oldEdge[1];
  aTriangle3.edges[1]=anEdge[1];
  aTriangle3.edges[2]=anEdge[2];
  if (aTriangle1.edges[0].getLeft() == aTriangle)   aTriangle1.edges[0].setLeft(aTriangle1);
 else   aTriangle1.edges[0].setRight(aTriangle1);
  if (aTriangle2.edges[0].getLeft() == aTriangle)   aTriangle2.edges[0].setLeft(aTriangle2);
 else   aTriangle2.edges[0].setRight(aTriangle2);
  if (aTriangle3.edges[0].getLeft() == aTriangle)   aTriangle3.edges[0].setLeft(aTriangle3);
 else   aTriangle3.edges[0].setRight(aTriangle3);
  if (anEdge[0].isLeft(firstPoint)) {
    anEdge[0].setLeft(aTriangle1);
    anEdge[0].setRight(aTriangle2);
  }
 else {
    anEdge[0].setRight(aTriangle1);
    anEdge[0].setLeft(aTriangle2);
  }
  if (anEdge[1].isLeft(alterPoint)) {
    anEdge[1].setLeft(aTriangle3);
    anEdge[1].setRight(aTriangle1);
  }
 else {
    anEdge[1].setRight(aTriangle3);
    anEdge[1].setLeft(aTriangle1);
  }
  if (anEdge[2].isLeft(firstPoint)) {
    anEdge[2].setLeft(aTriangle3);
    anEdge[2].setRight(aTriangle2);
  }
 else {
    anEdge[2].setRight(aTriangle3);
    anEdge[2].setLeft(aTriangle2);
  }
  aTriangle1.recomputeCenter();
  aTriangle2.recomputeCenter();
  aTriangle3.recomputeCenter();
  if (!isMeshComputed())   for (int i=0; i < 3; i++) {
    if (!badEdgesQueueList.contains(aTriangle1.edges[i]))     badEdgesQueueList.add(aTriangle1.edges[i]);
    if (!badEdgesQueueList.contains(aTriangle2.edges[i]))     badEdgesQueueList.add(aTriangle2.edges[i]);
    if (!badEdgesQueueList.contains(aTriangle3.edges[i]))     badEdgesQueueList.add(aTriangle3.edges[i]);
  }
  this.trianglesQuadTrees.cancelUsability();
}