Program: 58404
Project: 58404
Buggy source:
private void renderDetailBand(GL gl,DetailBand detailBand,boolean highlight){
  ArrayList<Integer> contentIDs=detailBand.getContentIDs();
  int startContentID=contentIDs.get(0);
  int endContentID=contentIDs.get(contentIDs.size() - 1);
  HeatMapWrapper leftHeatMapWrapper=heatMapWrappers.get(0);
  HeatMapWrapper rightHeatMapWrapper=heatMapWrappers.get(1);
  float leftTopHeatMapElementOffset=detailBand.getLeftHeatMap().getFieldHeight(startContentID) / 2f - 0.01f;
  float leftBottomHeatMapElementOffset=detailBand.getLeftHeatMap().getFieldHeight(endContentID) / 2f - 0.01f;
  float rightTopHeatMapElementOffset=detailBand.getRightHeatMap().getFieldHeight(startContentID) / 2f - 0.01f;
  float rightBottomHeatMapElementOffset=detailBand.getRightHeatMap().getFieldHeight(endContentID) / 2f - 0.01f;
  Vec2f leftPos=leftHeatMapWrapper.getRightDetailLinkPositionFromContentID(startContentID);
  if (leftPos == null)   return;
  Vec2f rightPos=rightHeatMapWrapper.getLeftDetailLinkPositionFromContentID(startContentID);
  if (rightPos == null)   return;
  xOffset=-(rightPos.x() - leftPos.x()) / 1.5f;
  ArrayList<Vec3f> inputPoints=new ArrayList<Vec3f>();
  inputPoints.add(new Vec3f(leftPos.x(),leftPos.y() + leftTopHeatMapElementOffset,0));
  inputPoints.add(new Vec3f(rightPos.x() + xOffset,leftPos.y() + leftTopHeatMapElementOffset,0));
  inputPoints.add(new Vec3f(rightPos.x() + xOffset / 3f,rightPos.y() + rightTopHeatMapElementOffset,0));
  inputPoints.add(new Vec3f(rightPos.x(),rightPos.y() + rightTopHeatMapElementOffset,0));
  NURBSCurve curve=new NURBSCurve(inputPoints,NUMBER_OF_SPLINE_POINTS);
  ArrayList<Vec3f> outputPoints=curve.getCurvePoints();
  gl.glLineWidth(2);
  gl.glColor4f(0,0,0,0.6f);
  gl.glBegin(GL.GL_LINE_STRIP);
  for (int i=0; i < outputPoints.size(); i++)   gl.glVertex3f(outputPoints.get(i).x(),outputPoints.get(i).y(),0f);
  gl.glEnd();
  leftPos=leftHeatMapWrapper.getRightDetailLinkPositionFromContentID(endContentID);
  if (leftPos == null)   return;
  rightPos=rightHeatMapWrapper.getLeftDetailLinkPositionFromContentID(endContentID);
  if (rightPos == null)   return;
  inputPoints=new ArrayList<Vec3f>();
  inputPoints.add(new Vec3f(leftPos.x(),leftPos.y() - leftBottomHeatMapElementOffset,0));
  inputPoints.add(new Vec3f(rightPos.x() + xOffset,leftPos.y() - leftBottomHeatMapElementOffset,0));
  inputPoints.add(new Vec3f(rightPos.x() + xOffset / 3f,rightPos.y() - rightBottomHeatMapElementOffset,0));
  inputPoints.add(new Vec3f(rightPos.x(),rightPos.y() - rightBottomHeatMapElementOffset,0));
  curve=new NURBSCurve(inputPoints,NUMBER_OF_SPLINE_POINTS);
  ArrayList<Vec3f> points=curve.getCurvePoints();
  for (int i=points.size() - 1; i >= 0; i--) {
    outputPoints.add(points.get(i));
  }
  gl.glLineWidth(2);
  gl.glColor4f(0,0,0,0.6f);
  gl.glBegin(GL.GL_LINE_STRIP);
  for (int i=0; i < points.size(); i++)   gl.glVertex3f(points.get(i).x(),points.get(i).y(),0f);
  gl.glEnd();
  if (highlight) {
    gl.glColor4f(0.3f,0.3f,0.3f,0.95f);
    for (    Vec3f point : outputPoints) {
      point.setZ(0.3f);
    }
  }
 else   gl.glColor4f(0f,0f,0f,0.4f);
  compareConnectionRenderer.render(gl,outputPoints);
}

Fixed version (ground truth):
private void renderDetailBand(GL gl,DetailBand detailBand,boolean highlight){
  ArrayList<Integer> contentIDs=detailBand.getContentIDs();
  int startContentID=contentIDs.get(0);
  int endContentID=contentIDs.get(contentIDs.size() - 1);
  HeatMapWrapper leftHeatMapWrapper=heatMapWrappers.get(0);
  HeatMapWrapper rightHeatMapWrapper=heatMapWrappers.get(1);
  float leftTopHeatMapElementOffset=detailBand.getLeftHeatMap().getFieldHeight(startContentID) / 2f - 0.01f;
  float leftBottomHeatMapElementOffset=detailBand.getLeftHeatMap().getFieldHeight(endContentID) / 2f - 0.01f;
  float rightTopHeatMapElementOffset=detailBand.getRightHeatMap().getFieldHeight(startContentID) / 2f - 0.01f;
  float rightBottomHeatMapElementOffset=detailBand.getRightHeatMap().getFieldHeight(endContentID) / 2f - 0.01f;
  Vec2f leftPos=leftHeatMapWrapper.getRightDetailLinkPositionFromContentID(startContentID);
  if (leftPos == null)   return;
  Vec2f rightPos=rightHeatMapWrapper.getLeftDetailLinkPositionFromContentID(startContentID);
  if (rightPos == null)   return;
  xOffset=-(rightPos.x() - leftPos.x()) / 1.5f;
  ArrayList<Vec3f> inputPoints=new ArrayList<Vec3f>();
  inputPoints.add(new Vec3f(leftPos.x(),leftPos.y() + leftTopHeatMapElementOffset,0));
  inputPoints.add(new Vec3f(rightPos.x() + xOffset,leftPos.y() + leftTopHeatMapElementOffset,0));
  inputPoints.add(new Vec3f(rightPos.x() + xOffset / 3f,rightPos.y() + rightTopHeatMapElementOffset,0));
  inputPoints.add(new Vec3f(rightPos.x(),rightPos.y() + rightTopHeatMapElementOffset,0));
  NURBSCurve curve=new NURBSCurve(inputPoints,NUMBER_OF_SPLINE_POINTS);
  ArrayList<Vec3f> outputPoints=curve.getCurvePoints();
  gl.glLineWidth(2);
  gl.glColor4f(0,0,0,0.6f);
  gl.glBegin(GL.GL_LINE_STRIP);
  for (int i=0; i < outputPoints.size(); i++)   gl.glVertex3f(outputPoints.get(i).x(),outputPoints.get(i).y(),0f);
  gl.glEnd();
  leftPos=leftHeatMapWrapper.getRightDetailLinkPositionFromContentID(endContentID);
  if (leftPos == null)   return;
  rightPos=rightHeatMapWrapper.getLeftDetailLinkPositionFromContentID(endContentID);
  if (rightPos == null)   return;
  inputPoints=new ArrayList<Vec3f>();
  inputPoints.add(new Vec3f(leftPos.x(),leftPos.y() - leftBottomHeatMapElementOffset,0));
  inputPoints.add(new Vec3f(rightPos.x() + xOffset,leftPos.y() - leftBottomHeatMapElementOffset,0));
  inputPoints.add(new Vec3f(rightPos.x() + xOffset / 3f,rightPos.y() - rightBottomHeatMapElementOffset,0));
  inputPoints.add(new Vec3f(rightPos.x(),rightPos.y() - rightBottomHeatMapElementOffset,0));
  curve=new NURBSCurve(inputPoints,NUMBER_OF_SPLINE_POINTS);
  ArrayList<Vec3f> points=curve.getCurvePoints();
  for (int i=points.size() - 1; i >= 0; i--) {
    outputPoints.add(points.get(i));
  }
  gl.glLineWidth(2);
  gl.glColor4f(0,0,0,0.6f);
  gl.glBegin(GL.GL_LINE_STRIP);
  for (int i=0; i < points.size(); i++)   gl.glVertex3f(points.get(i).x(),points.get(i).y(),0f);
  gl.glEnd();
  if (highlight) {
    gl.glColor4f(0.3f,0.3f,0.3f,0.95f);
    for (    Vec3f point : outputPoints) {
      point.setZ(0.2f);
    }
  }
 else   gl.glColor4f(0f,0f,0f,0.4f);
  compareConnectionRenderer.render(gl,outputPoints);
}