Program: 58396
Project: 58396
Buggy source:
protected void calculateDetailBands(HeatMapWrapper leftHeatMapWrapper,HeatMapWrapper rightHeatMapWrapper){
  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();
      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(leftHeatMapWrapper.getHeatMapByContentID(contentID));
      detailBand.setRightHeatMap(rightHeatMapWrapper.getHeatMapByContentID(contentID));
      newBands.add(detailBand);
    }
    detailBands.addAll(newBands);
  }
}

Fixed version (ground truth):
protected void calculateDetailBands(HeatMapWrapper leftHeatMapWrapper,HeatMapWrapper rightHeatMapWrapper,boolean considerSelections){
  ArrayList<Integer> bandContentIDs=null;
  DetailBand detailBand=null;
  for (  GLHeatMap leftHeatMap : leftHeatMapWrapper.getHeatMaps(considerSelections)) {
    ContentVirtualArray leftContentVA=leftHeatMap.getContentVA();
    for (    GLHeatMap rightHeatMap : rightHeatMapWrapper.getHeatMaps(considerSelections)) {
      ContentVirtualArray rightContentVA=rightHeatMap.getContentVA();
      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(leftHeatMapWrapper.getHeatMapByContentID(contentID));
      detailBand.setRightHeatMap(rightHeatMapWrapper.getHeatMapByContentID(contentID));
      newBands.add(detailBand);
    }
    detailBands.addAll(newBands);
  }
}