Program: 75629
Project: 75629
Buggy source:
public Object createDataFlow(DirectedGraph graph,Object value){
  Collection c=_graph.nodes(value);
  Collection pred=_labels.keySet();
  GraphNode predecessor;
  if (pred.size() == 0) {
    predecessor=null;
  }
 else {
    predecessor=(GraphNode)pred.toArray()[0];
  }
  if (c.size() == 0) {
    if (predecessor == null)     return null;
    return predecessor.createDataFlow(graph,value);
  }
  Node nodes[]=new Node[c.size()];
  System.arraycopy(c.toArray(),0,nodes,0,c.size());
  Node lastDefinition=nodes[0];
  for (int i=1; i < nodes.length; i++) {
    if (graph.reachableNodes(lastDefinition).contains(nodes[i])) {
      lastDefinition=nodes[i];
    }
 else     if (!graph.reachableNodes(nodes[i]).contains(lastDefinition)) {
      throw new RuntimeException("String_Node_Str");
    }
  }
  if (graph.sourceNodes().contains(lastDefinition)) {
    if (predecessor == null) {
      graph.addNode(lastDefinition);
      return lastDefinition;
    }
    Object gn=predecessor.createDataFlow(graph,value);
    if (gn == null) {
      graph.addNode(lastDefinition);
      return lastDefinition;
    }
 else {
      return gn;
    }
  }
  Collection sources=graph.sourceNodes();
  Vector currentBlockDefs=new Vector();
  Vector predecessorDefs=new Vector();
  currentBlockDefs.add(lastDefinition);
  for (int i=0; i < currentBlockDefs.size(); i++) {
    Node currNode=(Node)currentBlockDefs.elementAt(i);
    if (!graph.containsNode(currNode))     graph.addNode(currNode);
    for (Iterator j=graph.predecessors(currNode).iterator(); j.hasNext(); ) {
      Node predNode=(Node)j.next();
      if (sources.contains(predNode)) {
        predecessorDefs.add(predNode);
      }
 else {
        currentBlockDefs.add(predNode);
      }
      if (!graph.containsNode(predNode))       graph.addNode(predNode);
      graph.addEdge(predNode,currNode);
    }
  }
  for (Iterator i=predecessorDefs.iterator(); i.hasNext(); ) {
    Node n=(Node)i.next();
    Object result=predecessor.createDataFlow(graph,n.weight());
    if (result != null)     graph.addEdge(result,n);
  }
  return lastDefinition;
}

Fixed version (ground truth):
public Node createDataFlow(DirectedGraph graph,Object value){
  System.out.println("String_Node_Str" + this + "String_Node_Str"+ value);
  System.out.println("String_Node_Str" + value.getClass());
  Collection pred=_labels.keySet();
  GraphNode predecessor;
  Node returnNode;
  if (pred.size() == 0) {
    predecessor=null;
  }
 else {
    predecessor=(GraphNode)pred.toArray()[0];
  }
  if (predecessor == this)   predecessor=null;
  if (!_graph.containsNodeWeight(value)) {
    if (predecessor == null)     return null;
    return predecessor.createDataFlow(graph,value);
  }
  Collection c=_graph.nodes(value);
  Set equalSet=new HashSet();
  for (Iterator i=c.iterator(); i.hasNext(); ) {
    Object o=i.next();
    equalSet.add(o);
  }
  if (equalSet.size() == 0) {
    if (predecessor == null)     return null;
    return predecessor.createDataFlow(graph,value);
  }
  Node nodes[]=new Node[equalSet.size()];
  System.arraycopy(equalSet.toArray(),0,nodes,0,equalSet.size());
  Node lastDefinition=nodes[0];
  for (int i=1; i < nodes.length; i++) {
    if (_graph.reachableNodes(lastDefinition).contains(nodes[i])) {
      lastDefinition=nodes[i];
    }
 else     if (!_graph.reachableNodes(nodes[i]).contains(lastDefinition)) {
      throw new RuntimeException("String_Node_Str");
    }
  }
  if (_graph.sourceNodes().contains(lastDefinition)) {
    if (predecessor == null) {
      if (!graph.containsNode(lastDefinition)) {
        graph.addNode(lastDefinition);
      }
      return lastDefinition;
    }
    Node gn=predecessor.createDataFlow(graph,value);
    if (gn == null) {
      if (!graph.containsNode(lastDefinition)) {
        graph.addNode(lastDefinition);
      }
      return lastDefinition;
    }
 else {
      return gn;
    }
  }
  Collection sources=_graph.sourceNodes();
  Vector currentBlockDefs=new Vector();
  Vector predecessorDefs=new Vector();
  currentBlockDefs.add(lastDefinition);
  for (int i=0; i < currentBlockDefs.size(); i++) {
    Node currNode=(Node)currentBlockDefs.elementAt(i);
    System.out.println("String_Node_Str" + currNode);
    if (!graph.containsNode(currNode))     graph.addNode(currNode);
    for (Iterator j=_graph.predecessors(currNode).iterator(); j.hasNext(); ) {
      Node predNode=(Node)j.next();
      System.out.println("String_Node_Str" + predNode);
      if (sources.contains(predNode)) {
        predecessorDefs.add(predNode);
      }
 else {
        currentBlockDefs.add(predNode);
      }
      if (!graph.containsNode(predNode))       graph.addNode(predNode);
      graph.addEdge(predNode,currNode);
    }
  }
  if (predecessor != null) {
    for (Iterator i=predecessorDefs.iterator(); i.hasNext(); ) {
      Node n=(Node)i.next();
      System.out.println("String_Node_Str" + predecessor + "String_Node_Str"+ n);
      Node result=predecessor.createDataFlow(graph,n.weight());
      if (result != null)       graph.addEdge(result,n);
    }
  }
  return lastDefinition;
}