Program: 39778
Project: 39778
Buggy source:
/** 
 */
private void calculate(Graph g){
  Node[] nodes=g.getNodes();
  for (int i=0; i < nodes.length; i++) {
    map.put(nodes[i],0.0);
  }
  for (int i=0; i < nodes.length; i++) {
    Node s=nodes[i];
    Stack<Node> S=new Stack<Node>();
    HashMap<Node,ArrayList<Node>> P=new HashMap<Node,ArrayList<Node>>();
    for (    Node n : nodes) {
      P.put(n,new ArrayList<Node>());
    }
    HashMap<Node,Integer> sigma=new HashMap<Node,Integer>();
    for (    Node n : nodes) {
      sigma.put(n,0);
    }
    sigma.put(s,1);
    HashMap<Node,Integer> d=new HashMap<Node,Integer>();
    for (    Node n : nodes) {
      d.put(n,-1);
    }
    d.put(s,0);
    LinkedList<Node> Q=new LinkedList<Node>();
    Q.add(s);
    while (!Q.isEmpty()) {
      Node v=Q.remove();
      S.add(v);
      for (      int outIndex : v.getOutgoingEdges()) {
        Node w=nodes[outIndex];
        if (d.get(w) < 0) {
          Q.add(w);
          d.put(w,d.get(v) + 1);
        }
        if (d.get(w).intValue() == d.get(v).intValue() + 1) {
          sigma.put(w,sigma.get(w) + sigma.get(v));
          P.get(w).add(v);
        }
      }
    }
    HashMap<Node,Double> delta=new HashMap<Node,Double>();
    for (    Node n : nodes) {
      delta.put(n,0.0);
    }
    while (!S.isEmpty()) {
      Node w=S.pop();
      for (      Node v : P.get(w)) {
        delta.put(v,delta.get(v) + ((double)sigma.get(v)) / sigma.get(w) * (1 + sigma.get(w)));
      }
      if (w != s) {
        map.put(w,map.get(w) + delta.get(w));
      }
    }
  }
}

Fixed version (ground truth):
/** 
 */
private void calculate(Graph g){
  Node[] nodes=g.getNodes();
  for (  Node n : nodes) {
    this.map.put(n,0.0);
  }
  for (  Node s : nodes) {
    Stack<Node> S=new Stack<Node>();
    S.clear();
    HashMap<Node,ArrayList<Node>> P=new HashMap<Node,ArrayList<Node>>();
    for (    Node n : nodes) {
      P.put(n,new ArrayList<Node>());
    }
    HashMap<Node,Integer> sigma=new HashMap<Node,Integer>();
    for (    Node n : nodes) {
      sigma.put(n,0);
    }
    sigma.put(s,1);
    HashMap<Node,Integer> d=new HashMap<Node,Integer>();
    for (    Node n : nodes) {
      d.put(n,-1);
    }
    d.put(s,0);
    LinkedList<Node> Q=new LinkedList<Node>();
    Q.clear();
    Q.add(s);
    while (!Q.isEmpty()) {
      Node v=Q.remove();
      System.out.println("String_Node_Str" + v.getIndex());
      S.add(v);
      for (      int outIndex : v.getOutgoingEdges()) {
        Node w=nodes[outIndex];
        System.out.println("String_Node_Str" + w.getIndex());
        if (d.get(w).intValue() < 0) {
          Q.add(w);
          d.put(w,d.get(v).intValue() + 1);
          System.out.println("String_Node_Str");
        }
        if (d.get(w).intValue() == d.get(v).intValue() + 1) {
          sigma.put(w,sigma.get(w).intValue() + sigma.get(v).intValue());
          P.get(w).add(v);
          System.out.println("String_Node_Str" + w.getIndex() + "String_Node_Str"+ v.getIndex());
        }
      }
    }
    HashMap<Node,Double> delta=new HashMap<Node,Double>();
    for (    Node n : nodes) {
      delta.put(n,0.0);
    }
    while (!S.isEmpty()) {
      Node w=S.pop();
      for (      Node v : P.get(w)) {
        delta.put(v,delta.get(v).doubleValue() + sigma.get(v).doubleValue() / sigma.get(w).doubleValue() * (1 + delta.get(w).doubleValue()));
      }
      if (w.getIndex() != s.getIndex()) {
        map.put(w,map.get(w).doubleValue() + delta.get(w).doubleValue());
      }
    }
  }
}