Program: 58388
Project: 58388
Buggy source:
/** 
 * <p> This method chooses which groups (and therefore heat maps) are to be rendered at the passive side. It does so based on a virtualArray containing all elements to be rendered. </p> <p> This is called in the passive heat map. </p> <p> It also re-sorts the passive group's virtual arrays to minimize crossings and sets elements that are in a passive group but not in the supplied virtual array to   {@link GLHeatMap#SELECTION_HIDDEN} so that they can behidden on demand.
 */
public void choosePassiveHeatMaps(ArrayList<ContentVirtualArray> foreignContentVAs){
  ContentGroupList groupList=contentVA.getGroupList();
  groupList.updateGroupInfo();
  selectedGroups.clear();
  for (  ContentVirtualArray foreignVa : foreignContentVAs) {
    for (    Integer contentID : foreignVa) {
      int vaIndex=contentVA.indexOf(contentID);
      Group selectedGroup=groupList.getGroupOfVAIndex(vaIndex);
      if (!selectedGroups.containsKey(selectedGroup)) {
        selectedGroups.put(selectedGroup,null);
        selectedGroup.resetVisualGenesCounter();
      }
      GLHeatMap heatMap=hashHeatMaps.get(selectedGroup.getGroupIndex());
      ContentVirtualArray heatMapVA=heatMap.getContentVA();
      int index=heatMapVA.indexOf(contentID);
      if (useSorting && index >= 0)       heatMapVA.move(index,selectedGroup.getContainedNrGenes());
 else       System.out.println("String_Node_Str");
      selectedGroup.increaseContainedNumberOfGenesByOne();
    }
  }
  sort(foreignContentVAs,true,true);
  for (  Group group : selectedGroups.keySet()) {
    GLHeatMap heatMap=hashHeatMaps.get(group.getGroupIndex());
    heatMap.recalculateLayout();
  }
}

Fixed version (ground truth):
/** 
 * <p> This method chooses which groups (and therefore heat maps) are to be rendered at the passive side. It does so based on a virtualArray containing all elements to be rendered. </p> <p> This is called in the passive heat map. </p> <p> It also re-sorts the passive group's virtual arrays to minimize crossings and sets elements that are in a passive group but not in the supplied virtual array to   {@link GLHeatMap#SELECTION_HIDDEN} so that they can behidden on demand.
 */
public void choosePassiveHeatMaps(ArrayList<ContentVirtualArray> foreignContentVAs,boolean hideVisible,boolean considerSelectedGroups){
  ContentGroupList groupList=contentVA.getGroupList();
  groupList.updateGroupInfo();
  selectedGroups.clear();
  for (  ContentVirtualArray foreignVa : foreignContentVAs) {
    for (    Integer contentID : foreignVa) {
      int vaIndex=contentVA.indexOf(contentID);
      Group selectedGroup=groupList.getGroupOfVAIndex(vaIndex);
      if (!selectedGroups.containsKey(selectedGroup)) {
        selectedGroups.put(selectedGroup,null);
        selectedGroup.resetVisualGenesCounter();
      }
      GLHeatMap heatMap=hashHeatMaps.get(selectedGroup.getGroupIndex());
      ContentVirtualArray heatMapVA=heatMap.getContentVA();
      int index=heatMapVA.indexOf(contentID);
      if (useSorting && index >= 0)       heatMapVA.move(index,selectedGroup.getContainedNrGenes());
 else       System.out.println("String_Node_Str");
      selectedGroup.increaseContainedNumberOfGenesByOne();
    }
  }
  sort(foreignContentVAs,considerSelectedGroups,hideVisible);
  for (  Group group : selectedGroups.keySet()) {
    GLHeatMap heatMap=hashHeatMaps.get(group.getGroupIndex());
    heatMap.recalculateLayout();
  }
}