Program: 58411
Project: 58411
Buggy source:
private void renderDetailBand(GL gl,DetailBand detailBand){
  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 leftHeatMapElementOffset=detailBand.getLeftHeatMap().getFieldHeight(startContentID) / 2f - 0.01f;
  float rightHeatMapElementOffset=detailBand.getRightHeatMap().getFieldHeight(startContentID) / 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() + leftHeatMapElementOffset,0));
  inputPoints.add(new Vec3f(rightPos.x() + xOffset,leftPos.y() + leftHeatMapElementOffset,0));
  inputPoints.add(new Vec3f(rightPos.x() + xOffset / 3f,rightPos.y() + rightHeatMapElementOffset,0));
  inputPoints.add(new Vec3f(rightPos.x(),rightPos.y() + rightHeatMapElementOffset,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() - leftHeatMapElementOffset,0));
  inputPoints.add(new Vec3f(rightPos.x() + xOffset,leftPos.y() - leftHeatMapElementOffset,0));
  inputPoints.add(new Vec3f(rightPos.x() + xOffset / 3f,rightPos.y() - rightHeatMapElementOffset,0));
  inputPoints.add(new Vec3f(rightPos.x(),rightPos.y() - rightHeatMapElementOffset,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();
  ContentSelectionManager contentSelectionManager=leftHeatMapWrapper.getContentSelectionManager();
  boolean activeBand=false;
  boolean activeGroup=false;
  for (  Integer contentID : detailBand.getContentIDs()) {
    SelectionType type=contentSelectionManager.getSelectionTypes(contentID).get(0);
    if (type == SelectionType.MOUSE_OVER) {
      activeBand=true;
      this.activeBand=detailBand;
      break;
    }
    if (rightHeatMapWrapper.getHeatMapByContentID(contentID).getContentVA().containsElement(contentID) > 0) {
      activeGroup=true;
    }
  }
  if (activeBand) {
    gl.glColor4f(0.3f,0.3f,0.3f,1f);
    for (    Vec3f point : outputPoints) {
      point.setZ(0.3f);
    }
  }
 else   if (activeGroup)   gl.glColor4f(0f,0f,0f,0.4f);
 else   gl.glColor4f(0f,0f,0f,0.2f);
  compareConnectionRenderer.render(gl,outputPoints);
}

Fixed version (ground truth):
private void renderDetailBand(GL gl,DetailBand detailBand){
  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();
  ContentSelectionManager contentSelectionManager=leftHeatMapWrapper.getContentSelectionManager();
  boolean activeBand=false;
  boolean activeGroup=false;
  for (  Integer contentID : detailBand.getContentIDs()) {
    SelectionType type=contentSelectionManager.getSelectionTypes(contentID).get(0);
    if (type == SelectionType.MOUSE_OVER) {
      activeBand=true;
      this.activeBand=detailBand;
      break;
    }
    if (rightHeatMapWrapper.getHeatMapByContentID(contentID).getContentVA().containsElement(contentID) > 0) {
      activeGroup=true;
    }
  }
  if (activeBand) {
    gl.glColor4f(0.3f,0.3f,0.3f,1f);
    for (    Vec3f point : outputPoints) {
      point.setZ(0.3f);
    }
  }
 else   if (activeGroup)   gl.glColor4f(0f,0f,0f,0.4f);
 else   gl.glColor4f(0f,0f,0f,0.2f);
  compareConnectionRenderer.render(gl,outputPoints);
}