Program: 58412
Project: 58412
Buggy source:
private void calculateDetailBands(){
  HeatMapWrapper leftHeatMapWrapper=heatMapWrappers.get(0);
  HeatMapWrapper rightHeatMapWrapper=heatMapWrappers.get(1);
  ArrayList<Integer> bandContentIDs=null;
  DetailBand detailBand=null;
  for (  GLHeatMap leftHeatMap : leftHeatMapWrapper.getHeatMaps()) {
    ContentVirtualArray leftContentVA=leftHeatMap.getContentVA();
    for (    GLHeatMap rightHeatMap : rightHeatMapWrapper.getHeatMaps()) {
      ContentVirtualArray rightContentVA=rightHeatMap.getContentVA();
      if (bandContentIDs == null || bandContentIDs.size() > 0) {
        bandContentIDs=new ArrayList<Integer>();
        detailBand=new DetailBand();
        detailBand.setContentIDs(bandContentIDs);
        detailBand.setLeftHeatMap(leftHeatMap);
        detailBand.setRightHeatMap(rightHeatMap);
        detailBands.add(detailBand);
      }
      for (int leftContentIndex=0; leftContentIndex < leftContentVA.size() - 1; leftContentIndex++) {
        int contentID=leftContentVA.get(leftContentIndex);
        int nextContentID=leftContentVA.get(leftContentIndex + 1);
        if (rightContentVA.containsElement(contentID) == 0)         continue;
        if ((rightContentVA.indexOf(contentID)) == (rightContentVA.indexOf(nextContentID) - 1)) {
          bandContentIDs.add(contentID);
          bandContentIDs.add(nextContentID);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void calculateDetailBands(){
  HeatMapWrapper leftHeatMapWrapper=heatMapWrappers.get(0);
  HeatMapWrapper rightHeatMapWrapper=heatMapWrappers.get(1);
  ArrayList<Integer> bandContentIDs=null;
  DetailBand detailBand=null;
  for (  GLHeatMap leftHeatMap : leftHeatMapWrapper.getHeatMaps()) {
    ContentVirtualArray leftContentVA=leftHeatMap.getContentVA();
    for (    GLHeatMap rightHeatMap : rightHeatMapWrapper.getHeatMaps()) {
      ContentVirtualArray rightContentVA=rightHeatMap.getContentVA();
      if (bandContentIDs == null || bandContentIDs.size() > 0) {
        bandContentIDs=new ArrayList<Integer>();
        detailBand=new DetailBand();
        detailBand.setContentIDs(bandContentIDs);
        detailBand.setLeftHeatMap(leftHeatMap);
        detailBand.setRightHeatMap(rightHeatMap);
        detailBands.add(detailBand);
      }
      for (int leftContentIndex=0; leftContentIndex < leftContentVA.size() - 1; leftContentIndex++) {
        int contentID=leftContentVA.get(leftContentIndex);
        int nextContentID=leftContentVA.get(leftContentIndex + 1);
        if (rightContentVA.containsElement(contentID) == 0)         continue;
        if ((rightContentVA.indexOf(contentID)) == (rightContentVA.indexOf(nextContentID) - 1)) {
          bandContentIDs.add(contentID);
          bandContentIDs.add(nextContentID);
        }
 else         bandContentIDs.add(contentID);
      }
    }
  }
  for (  Integer contentID : leftHeatMapWrapper.getContentVA()) {
    boolean isInBand=false;
    ArrayList<DetailBand> newBands=new ArrayList<DetailBand>();
    for (    DetailBand band : detailBands) {
      if (band.getContentIDs().contains(contentID)) {
        isInBand=true;
        continue;
      }
    }
    if (!isInBand) {
      bandContentIDs=new ArrayList<Integer>();
      bandContentIDs.add(contentID);
      detailBand=new DetailBand();
      detailBand.setContentIDs(bandContentIDs);
      detailBand.setLeftHeatMap(null);
      detailBand.setRightHeatMap(null);
      newBands.add(detailBand);
    }
    detailBands.addAll(newBands);
  }
}