Program: 58357
Project: 58357
Buggy source:
public void renderIndiviudalLineRelations(GL gl,HeatMapWrapper leftHeatMapWrapper,HeatMapWrapper rightHeatMapWrapper){
  contentIDToLeftDetailPoints.clear();
  contentIDToRightDetailPoints.clear();
  ArrayList<Vec3f> points=new ArrayList<Vec3f>();
  ContentVirtualArray overview=leftHeatMapWrapper.getContentVA().clone();
  ContentVirtualArray overviewRight=rightHeatMapWrapper.getContentVA().clone();
  float overviewDistance=rightHeatMapWrapper.getLeftOverviewLinkPositionFromContentIndex(0)[0] - leftHeatMapWrapper.getLeftOverviewLinkPositionFromContentIndex(0)[0];
  firstLevelOffset=overviewDistance / 7;
  float leftElementHeight=leftHeatMapWrapper.getLayout().getOverviewHeatMapSampleHeight();
  float rightElementHeight=leftHeatMapWrapper.getLayout().getOverviewHeatMapSampleHeight();
  float leftElementHeightIncludingSpacing=leftElementHeight * 0.8f;
  float rightElementHeightIncludingSpacing=rightElementHeight * 0.8f;
  float groupPadding=0;
  float bundlingCorrectionOffsetX=overviewDistance / 18f;
  float top=leftHeatMapWrapper.getLayout().getOverviewHeatMapPosition().y() + leftHeatMapWrapper.getLayout().getOverviewHeight();
  rightHeatMapWrapper.choosePassiveHeatMaps(leftHeatMapWrapper.getContentVAsOfHeatMaps(false),false,false);
  leftHeatMapWrapper.choosePassiveHeatMaps(rightHeatMapWrapper.getContentVAsOfHeatMaps(false),false,false);
  for (  ContentVirtualArray groupVA : leftHeatMapWrapper.getContentVAsOfHeatMaps(false)) {
    float groupTopY=0;
    for (    Integer overviewContentID : overview) {
      if (groupVA.containsElement(overviewContentID) == 0)       continue;
      groupPadding=groupVA.size() * leftElementHeight * 0.1f;
      groupTopY=overview.indexOf(overviewContentID) * leftElementHeight + groupPadding;
      break;
    }
    float overviewX=leftHeatMapWrapper.getRightOverviewLinkPositionFromContentID(groupVA.get(0))[0];
    for (    Integer contentID : groupVA) {
      points.clear();
      float overviewY=leftHeatMapWrapper.getRightOverviewLinkPositionFromContentID(contentID)[1];
      float sortedY=top - groupTopY - groupVA.indexOf(contentID) * leftElementHeightIncludingSpacing;
      setRelationColor(gl,leftHeatMapWrapper,contentID);
      float[] leftOverviewPos=new float[]{overviewX,overviewY,0};
      float[] leftDetailPos=new float[]{overviewX + firstLevelOffset,sortedY,0};
      contentIDToLeftDetailPoints.put(contentID,leftDetailPos);
      points.add(new Vec3f(leftOverviewPos[0],leftOverviewPos[1],leftOverviewPos[2]));
      points.add(new Vec3f(overviewX + bundlingCorrectionOffsetX,overviewY,0));
      points.add(new Vec3f(leftDetailPos[0] - bundlingCorrectionOffsetX,sortedY,0));
      points.add(new Vec3f(leftDetailPos[0],leftDetailPos[1],leftDetailPos[2]));
      ArrayList<ContentVirtualArray> rightContentVAs=rightHeatMapWrapper.getContentVAsOfHeatMaps(false);
      float overviewRightX=rightHeatMapWrapper.getLeftOverviewLinkPositionFromContentID(contentID)[0];
      for (      ContentVirtualArray rightGroupVA : rightContentVAs) {
        if (rightGroupVA.containsElement(contentID) == 0)         continue;
        float rightGroupTopY=0;
        for (        Integer overviewRightContentID : overviewRight) {
          if (rightGroupVA.containsElement(overviewRightContentID) == 0)           continue;
          groupPadding=rightGroupVA.size() * rightElementHeight * 0.1f;
          rightGroupTopY=overviewRight.indexOf(overviewRightContentID) * rightElementHeight + groupPadding;
          break;
        }
        float overviewRightY=rightHeatMapWrapper.getLeftOverviewLinkPositionFromContentID(contentID)[1];
        float sortedRightY=top - rightGroupTopY - rightGroupVA.indexOf(contentID) * rightElementHeightIncludingSpacing;
        float[] rightDetailPos=new float[]{overviewRightX - firstLevelOffset,sortedRightY,0};
        float[] rightOverviewPos=new float[]{overviewRightX,overviewRightY,0};
        contentIDToRightDetailPoints.put(contentID,rightDetailPos);
        float xOffset=-(rightDetailPos[0] - leftDetailPos[0]) / 1.5f;
        points.add(new Vec3f(rightDetailPos[0] + xOffset,leftDetailPos[1],0));
        points.add(new Vec3f(rightDetailPos[0] + xOffset / 3,rightDetailPos[1],0));
        points.add(new Vec3f(rightDetailPos[0],rightDetailPos[1],rightDetailPos[2]));
        points.add(new Vec3f(rightDetailPos[0] + bundlingCorrectionOffsetX,sortedRightY,0));
        points.add(new Vec3f(overviewRightX - bundlingCorrectionOffsetX,overviewRightY,0));
        points.add(new Vec3f(rightOverviewPos[0],rightOverviewPos[1],rightOverviewPos[2]));
      }
      if (!bandBundlingActive)       renderSingleCurve(gl,points,contentID);
    }
  }
}

Fixed version (ground truth):
public void renderIndiviudalLineRelations(GL gl,HeatMapWrapper leftHeatMapWrapper,HeatMapWrapper rightHeatMapWrapper){
  contentIDToLeftDetailPoints.clear();
  contentIDToRightDetailPoints.clear();
  ArrayList<Vec3f> points=new ArrayList<Vec3f>();
  ContentVirtualArray overview=leftHeatMapWrapper.getContentVA().clone();
  ContentVirtualArray overviewRight=rightHeatMapWrapper.getContentVA().clone();
  float overviewDistance=rightHeatMapWrapper.getLeftOverviewLinkPositionFromContentIndex(0)[0] - leftHeatMapWrapper.getLeftOverviewLinkPositionFromContentIndex(0)[0];
  firstLevelOffset=overviewDistance / 7;
  float leftElementHeight=leftHeatMapWrapper.getLayout().getOverviewHeatMapSampleHeight();
  float rightElementHeight=leftHeatMapWrapper.getLayout().getOverviewHeatMapSampleHeight();
  float leftElementHeightIncludingSpacing=leftElementHeight * 0.8f;
  float rightElementHeightIncludingSpacing=rightElementHeight * 0.8f;
  float groupPadding=0;
  float bundlingCorrectionOffsetX=overviewDistance / 18f;
  float top=leftHeatMapWrapper.getLayout().getOverviewHeatMapPosition().y() + leftHeatMapWrapper.getLayout().getOverviewHeight();
  rightHeatMapWrapper.choosePassiveHeatMaps(leftHeatMapWrapper.getContentVAsOfHeatMaps(false),false,false,false);
  leftHeatMapWrapper.choosePassiveHeatMaps(rightHeatMapWrapper.getContentVAsOfHeatMaps(false),false,false,false);
  for (  ContentVirtualArray groupVA : leftHeatMapWrapper.getContentVAsOfHeatMaps(false)) {
    float groupTopY=0;
    for (    Integer overviewContentID : overview) {
      if (groupVA.containsElement(overviewContentID) == 0)       continue;
      groupPadding=groupVA.size() * leftElementHeight * 0.1f;
      groupTopY=overview.indexOf(overviewContentID) * leftElementHeight + groupPadding;
      break;
    }
    float overviewX=leftHeatMapWrapper.getRightOverviewLinkPositionFromContentID(groupVA.get(0))[0];
    for (    Integer contentID : groupVA) {
      points.clear();
      float overviewY=leftHeatMapWrapper.getRightOverviewLinkPositionFromContentID(contentID)[1];
      float sortedY=top - groupTopY - groupVA.indexOf(contentID) * leftElementHeightIncludingSpacing;
      setRelationColor(gl,leftHeatMapWrapper,contentID);
      float[] leftOverviewPos=new float[]{overviewX,overviewY,0};
      float[] leftDetailPos=new float[]{overviewX + firstLevelOffset,sortedY,0};
      contentIDToLeftDetailPoints.put(contentID,leftDetailPos);
      points.add(new Vec3f(leftOverviewPos[0],leftOverviewPos[1],leftOverviewPos[2]));
      points.add(new Vec3f(overviewX + bundlingCorrectionOffsetX,overviewY,0));
      points.add(new Vec3f(leftDetailPos[0] - bundlingCorrectionOffsetX,sortedY,0));
      points.add(new Vec3f(leftDetailPos[0],leftDetailPos[1],leftDetailPos[2]));
      ArrayList<ContentVirtualArray> rightContentVAs=rightHeatMapWrapper.getContentVAsOfHeatMaps(false);
      float overviewRightX=rightHeatMapWrapper.getLeftOverviewLinkPositionFromContentID(contentID)[0];
      for (      ContentVirtualArray rightGroupVA : rightContentVAs) {
        if (rightGroupVA.containsElement(contentID) == 0)         continue;
        float rightGroupTopY=0;
        for (        Integer overviewRightContentID : overviewRight) {
          if (rightGroupVA.containsElement(overviewRightContentID) == 0)           continue;
          groupPadding=rightGroupVA.size() * rightElementHeight * 0.1f;
          rightGroupTopY=overviewRight.indexOf(overviewRightContentID) * rightElementHeight + groupPadding;
          break;
        }
        float overviewRightY=rightHeatMapWrapper.getLeftOverviewLinkPositionFromContentID(contentID)[1];
        float sortedRightY=top - rightGroupTopY - rightGroupVA.indexOf(contentID) * rightElementHeightIncludingSpacing;
        float[] rightDetailPos=new float[]{overviewRightX - firstLevelOffset,sortedRightY,0};
        float[] rightOverviewPos=new float[]{overviewRightX,overviewRightY,0};
        contentIDToRightDetailPoints.put(contentID,rightDetailPos);
        float xOffset=-(rightDetailPos[0] - leftDetailPos[0]) / 1.5f;
        points.add(new Vec3f(rightDetailPos[0] + xOffset,leftDetailPos[1],0));
        points.add(new Vec3f(rightDetailPos[0] + xOffset / 3,rightDetailPos[1],0));
        points.add(new Vec3f(rightDetailPos[0],rightDetailPos[1],rightDetailPos[2]));
        points.add(new Vec3f(rightDetailPos[0] + bundlingCorrectionOffsetX,sortedRightY,0));
        points.add(new Vec3f(overviewRightX - bundlingCorrectionOffsetX,overviewRightY,0));
        points.add(new Vec3f(rightOverviewPos[0],rightOverviewPos[1],rightOverviewPos[2]));
      }
      if (!bandBundlingActive)       renderSingleCurve(gl,points,contentID);
    }
  }
}