Program: 58353
Project: 58353
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,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();
  }
}

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,boolean selectGroups){
  ContentGroupList groupList=contentVA.getGroupList();
  groupList.updateGroupInfo();
  HashMap<Group,Boolean> tempGroups=new HashMap<Group,Boolean>();
  tempGroups.clear();
  for (  ContentVirtualArray foreignVa : foreignContentVAs) {
    for (    Integer contentID : foreignVa) {
      int vaIndex=contentVA.indexOf(contentID);
      Group selectedGroup=groupList.getGroupOfVAIndex(vaIndex);
      if (!tempGroups.containsKey(selectedGroup)) {
        tempGroups.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();
    }
  }
  if (selectGroups) {
    selectedGroups.clear();
    selectedGroups.putAll(tempGroups);
  }
  sort(foreignContentVAs,considerSelectedGroups,hideVisible);
  for (  Group group : selectedGroups.keySet()) {
    GLHeatMap heatMap=hashHeatMaps.get(group.getGroupIndex());
    heatMap.recalculateLayout();
  }
}