Program: 189783
Project: 189783
Buggy source:
private void zoomOut(){
  int M=communities.size();
  LinkedList<ModEdge>[] newTopology=new LinkedList[M];
  int index=0;
  nodeCommunities=new Community[M];
  nodeConnections=new HashMap[M];
  HashMap<Integer,Community> newInvMap=new HashMap<Integer,Community>();
  for (int i=0; i < communities.size(); i++) {
    Community com=communities.get(i);
    nodeConnections[index]=new HashMap<Community,Float>();
    newTopology[index]=new LinkedList<ModEdge>();
    nodeCommunities[index]=new Community(com);
    Set<Community> iter=com.connections.keySet();
    double weightSum=0;
    Community hidden=new Community(structure);
    for (    Integer nodeInt : com.nodes) {
      Community oldHidden=invMap.get(nodeInt);
      hidden.nodes.addAll(oldHidden.nodes);
    }
    newInvMap.put(index,hidden);
    for (    Modularity.Community adjCom : iter) {
      int target=communities.indexOf(adjCom);
      float weight=com.connections.get(adjCom);
      if (target == index)       weightSum+=2. * weight;
 else       weightSum+=weight;
      Modularity.ModEdge e=new Modularity.ModEdge(index,target,weight);
      System.out.println(e.source + "String_Node_Str" + e.target+ "String_Node_Str"+ e.weight);
      newTopology[index].add(e);
    }
    weights[index]=weightSum;
    nodeCommunities[index].seed(index);
    index++;
  }
  communities.clear();
  for (int i=0; i < M; i++) {
    Community com=nodeCommunities[i];
    communities.add(com);
    for (    ModEdge e : newTopology[i]) {
      nodeConnections[i].put(nodeCommunities[e.target],e.weight);
      com.connections.put(nodeCommunities[e.target],e.weight);
    }
  }
  N=M;
  topology=newTopology;
  invMap=newInvMap;
}

Fixed version (ground truth):
private void zoomOut(){
  int M=communities.size();
  LinkedList<ModEdge>[] newTopology=new LinkedList[M];
  int index=0;
  nodeCommunities=new Community[M];
  nodeConnectionsWeight=new HashMap[M];
  nodeConnectionsCount=new HashMap[M];
  HashMap<Integer,Community> newInvMap=new HashMap<Integer,Community>();
  for (int i=0; i < communities.size(); i++) {
    Community com=communities.get(i);
    nodeConnectionsWeight[index]=new HashMap<Community,Float>();
    nodeConnectionsCount[index]=new HashMap<Community,Integer>();
    newTopology[index]=new LinkedList<ModEdge>();
    nodeCommunities[index]=new Community(com);
    Set<Community> iter=com.connectionsWeight.keySet();
    double weightSum=0;
    Community hidden=new Community(structure);
    for (    Integer nodeInt : com.nodes) {
      Community oldHidden=invMap.get(nodeInt);
      hidden.nodes.addAll(oldHidden.nodes);
    }
    newInvMap.put(index,hidden);
    for (    Modularity.Community adjCom : iter) {
      int target=communities.indexOf(adjCom);
      float weight=com.connectionsWeight.get(adjCom);
      if (target == index)       weightSum+=2. * weight;
 else       weightSum+=weight;
      Modularity.ModEdge e=new Modularity.ModEdge(index,target,weight);
      System.out.println(e.source + "String_Node_Str" + e.target+ "String_Node_Str"+ e.weight);
      newTopology[index].add(e);
    }
    weights[index]=weightSum;
    nodeCommunities[index].seed(index);
    index++;
  }
  communities.clear();
  for (int i=0; i < M; i++) {
    Community com=nodeCommunities[i];
    communities.add(com);
    for (    ModEdge e : newTopology[i]) {
      nodeConnectionsWeight[i].put(nodeCommunities[e.target],e.weight);
      nodeConnectionsCount[i].put(nodeCommunities[e.target],1);
      com.connectionsWeight.put(nodeCommunities[e.target],e.weight);
      com.connectionsCount.put(nodeCommunities[e.target],1);
    }
  }
  N=M;
  topology=newTopology;
  invMap=newInvMap;
}