Program: 58391
Project: 58391
Buggy source:
public void renderOverviewBundling(GL gl,HeatMapWrapper leftHeatMapWrapper,HeatMapWrapper rightHeatMapWrapper){
  ArrayList<Vec3f> points=new ArrayList<Vec3f>();
  ContentVirtualArray overview=leftHeatMapWrapper.getContentVA().clone();
  ContentVirtualArray overviewRight=rightHeatMapWrapper.getContentVA().clone();
  float overviewDistance=rightHeatMapWrapper.getLeftOverviewLinkPositionFromIndex(0).x() - leftHeatMapWrapper.getLeftOverviewLinkPositionFromIndex(0).x();
  float firstLevelOffset=overviewDistance / 5;
  float sampleHeight=leftHeatMapWrapper.getLayout().getOverviewHeatMapSampleHeight();
  float sampleHeightIncludingSpacing=sampleHeight * 0.8f;
  float groupPadding=0;
  float bundlingCorrectionOffsetX=overviewDistance / 18f;
  float top=leftHeatMapWrapper.getLayout().getOverviewHeatMapPosition().y() + leftHeatMapWrapper.getLayout().getOverviewHeight();
  rightHeatMapWrapper.sort(leftHeatMapWrapper.getContentVAsOfHeatMaps(false),false,false);
  leftHeatMapWrapper.sort(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() * sampleHeight * 0.1f;
      groupTopY=overview.indexOf(overviewContentID) * sampleHeight + groupPadding;
      break;
    }
    float overviewX=leftHeatMapWrapper.getRightOverviewLinkPositionFromContentID(groupVA.get(0)).x();
    for (    Integer contentID : groupVA) {
      points.clear();
      float overviewY=leftHeatMapWrapper.getRightOverviewLinkPositionFromContentID(contentID).y();
      float sortedY=top - groupTopY - groupVA.indexOf(contentID) * sampleHeightIncludingSpacing;
      setRelationColor(gl,leftHeatMapWrapper,contentID);
      points.add(new Vec3f(overviewX,overviewY,0));
      points.add(new Vec3f(overviewX + bundlingCorrectionOffsetX,overviewY,0));
      points.add(new Vec3f(overviewX + firstLevelOffset - bundlingCorrectionOffsetX,sortedY,0));
      points.add(new Vec3f(overviewX + firstLevelOffset,sortedY,0));
      ArrayList<ContentVirtualArray> rightContentVAs=rightHeatMapWrapper.getContentVAsOfHeatMaps(false);
      float overviewRightX=rightHeatMapWrapper.getLeftOverviewLinkPositionFromContentID(contentID).x();
      for (int rightClusterIndex=0; rightClusterIndex < rightContentVAs.size(); rightClusterIndex++) {
        ContentVirtualArray rightGroupVA=rightContentVAs.get(rightClusterIndex);
        if (rightGroupVA.containsElement(contentID) == 0)         continue;
        float rightGroupTopY=0;
        for (        Integer overviewRightContentID : overviewRight) {
          if (rightGroupVA.containsElement(overviewRightContentID) == 0)           continue;
          groupPadding=rightGroupVA.size() * sampleHeight * 0.1f;
          rightGroupTopY=overviewRight.indexOf(overviewRightContentID) * sampleHeight + groupPadding;
          break;
        }
        float overviewRightY=rightHeatMapWrapper.getLeftOverviewLinkPositionFromContentID(contentID).y();
        float sortedRightY=top - rightGroupTopY - rightGroupVA.indexOf(contentID) * sampleHeightIncludingSpacing;
        points.add(new Vec3f(overviewRightX - firstLevelOffset,sortedRightY,0));
        points.add(new Vec3f(overviewRightX - firstLevelOffset + bundlingCorrectionOffsetX,sortedRightY,0));
        points.add(new Vec3f(overviewRightX - bundlingCorrectionOffsetX,overviewRightY,0));
        points.add(new Vec3f(overviewRightX,overviewRightY,0));
      }
      renderSingleCurve(gl,points,contentID);
    }
  }
}

Fixed version (ground truth):
public void renderOverviewBundling(GL gl,HeatMapWrapper leftHeatMapWrapper,HeatMapWrapper rightHeatMapWrapper){
  ArrayList<Vec3f> points=new ArrayList<Vec3f>();
  ContentVirtualArray overview=leftHeatMapWrapper.getContentVA().clone();
  ContentVirtualArray overviewRight=rightHeatMapWrapper.getContentVA().clone();
  float overviewDistance=rightHeatMapWrapper.getLeftOverviewLinkPositionFromIndex(0).x() - leftHeatMapWrapper.getLeftOverviewLinkPositionFromIndex(0).x();
  float firstLevelOffset=overviewDistance / 5;
  float sampleHeight=leftHeatMapWrapper.getLayout().getOverviewHeatMapSampleHeight();
  float sampleHeightIncludingSpacing=sampleHeight * 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() * sampleHeight * 0.1f;
      groupTopY=overview.indexOf(overviewContentID) * sampleHeight + groupPadding;
      break;
    }
    float overviewX=leftHeatMapWrapper.getRightOverviewLinkPositionFromContentID(groupVA.get(0)).x();
    for (    Integer contentID : groupVA) {
      points.clear();
      float overviewY=leftHeatMapWrapper.getRightOverviewLinkPositionFromContentID(contentID).y();
      float sortedY=top - groupTopY - groupVA.indexOf(contentID) * sampleHeightIncludingSpacing;
      setRelationColor(gl,leftHeatMapWrapper,contentID);
      points.add(new Vec3f(overviewX,overviewY,0));
      points.add(new Vec3f(overviewX + bundlingCorrectionOffsetX,overviewY,0));
      points.add(new Vec3f(overviewX + firstLevelOffset - bundlingCorrectionOffsetX,sortedY,0));
      points.add(new Vec3f(overviewX + firstLevelOffset,sortedY,0));
      ArrayList<ContentVirtualArray> rightContentVAs=rightHeatMapWrapper.getContentVAsOfHeatMaps(false);
      float overviewRightX=rightHeatMapWrapper.getLeftOverviewLinkPositionFromContentID(contentID).x();
      for (int rightClusterIndex=0; rightClusterIndex < rightContentVAs.size(); rightClusterIndex++) {
        ContentVirtualArray rightGroupVA=rightContentVAs.get(rightClusterIndex);
        if (rightGroupVA.containsElement(contentID) == 0)         continue;
        float rightGroupTopY=0;
        for (        Integer overviewRightContentID : overviewRight) {
          if (rightGroupVA.containsElement(overviewRightContentID) == 0)           continue;
          groupPadding=rightGroupVA.size() * sampleHeight * 0.1f;
          rightGroupTopY=overviewRight.indexOf(overviewRightContentID) * sampleHeight + groupPadding;
          break;
        }
        float overviewRightY=rightHeatMapWrapper.getLeftOverviewLinkPositionFromContentID(contentID).y();
        float sortedRightY=top - rightGroupTopY - rightGroupVA.indexOf(contentID) * sampleHeightIncludingSpacing;
        points.add(new Vec3f(overviewRightX - firstLevelOffset,sortedRightY,0));
        points.add(new Vec3f(overviewRightX - firstLevelOffset + bundlingCorrectionOffsetX,sortedRightY,0));
        points.add(new Vec3f(overviewRightX - bundlingCorrectionOffsetX,overviewRightY,0));
        points.add(new Vec3f(overviewRightX,overviewRightY,0));
      }
      renderSingleCurve(gl,points,contentID);
    }
  }
}