nus-yam/ex-repair huggingface dataset:
Program: 38526
Project: 38526
Buggy source:
/** 
 * @return
 */
public String[] getConfigKeys(){
  return Util.mergeArrays(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},additionalConfigKeys);
}

Fixed version (ground truth):
/** 
 * Getter for the configuration keys. Returns "KEY", "WIDTH", "HEIGHT" as well as any additional configuration keys set by <code>setAdditionalConfigKeys()</code>.
 * @return A string array containing all the configuration keys.
 */
public String[] getConfigKeys(){
  return Util.mergeArrays(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},additionalConfigKeys);
}
Program: 38527
Project: 38527
Buggy source:
/** 
 * @return
 */
public String getKey(){
  return key;
}

Fixed version (ground truth):
/** 
 * Getter for the key of the particular <code>PlacementModel</code>.
 * @return The key of the <code>PlacementModel</code>.
 */
public String getKey(){
  return key;
}
Program: 38528
Project: 38528
Buggy source:
public void setAdditionalConfigKeys(String[] arr){
  additionalConfigKeys=arr;
}

Fixed version (ground truth):
/** 
 * Setter for the additional configuration keys. Those will be returned in addition to "KEY", "WIDTH", "HEIGHT" by <code>getConfigKeys()</code>.
 * @param arr The new additional configuration keys.
 */
public void setAdditionalConfigKeys(String[] arr){
  additionalConfigKeys=arr;
}
Program: 38529
Project: 38529
Buggy source:
/** 
 * @return
 */
public double getHeight(){
  return height;
}

Fixed version (ground truth):
/** 
 * Getter for the height of the field.
 * @return The height of field.
 */
public double getHeight(){
  return height;
}
Program: 38530
Project: 38530
Buggy source:
/** 
 * @return
 */
public String[] getConfigValues(){
  return Util.mergeArrays(new String[]{getKey(),Double.toString(getWidth()),Double.toString(getHeight())},additionalConfigValues);
}

Fixed version (ground truth):
/** 
 * Getter for the configuration values. Returns key, width and height as well as any additional configuration keys set by <code>setAdditionalConfigValues()</code>.
 * @return A string array containing all the configuration values.
 */
public String[] getConfigValues(){
  return Util.mergeArrays(new String[]{getKey(),Double.toString(getWidth()),Double.toString(getHeight())},additionalConfigValues);
}
Program: 38531
Project: 38531
Buggy source:
public void setAdditionalConfigValues(String[] arr){
  additionalConfigValues=arr;
}

Fixed version (ground truth):
/** 
 * Setter for the additional configuration values. Those will be returned in addition to the key, the width and the height by <code>getConfigValues()</code>.
 * @param arr The new additional configuration values.
 */
public void setAdditionalConfigValues(String[] arr){
  additionalConfigValues=arr;
}
Program: 38532
Project: 38532
Buggy source:
/** 
 * @return
 */
public double getWidth(){
  return width;
}

Fixed version (ground truth):
/** 
 * Getter for the width of the field.
 * @return The width of the field.
 */
public double getWidth(){
  return width;
}
Program: 38533
Project: 38533
Buggy source:
public void setHeight(double height){
  this.height=height;
}

Fixed version (ground truth):
/** 
 * Setter for the height of the field.
 * @param height The new height of the field.
 */
public void setHeight(double height){
  this.height=height;
}
Program: 38534
Project: 38534
Buggy source:
public void setWidth(double width){
  this.width=width;
}

Fixed version (ground truth):
/** 
 * Setter for the width of the field.
 * @param width The new width of the field.
 */
public void setWidth(double width){
  this.width=width;
}
Program: 38535
Project: 38535
Buggy source:
public void setKey(String key){
  this.key=key;
}

Fixed version (ground truth):
/** 
 * Setter for the key of the particular <code>PlacementModel</code>.
 * @param key The new key of the <code>PlacementModel</code>.
 */
public void setKey(String key){
  this.key=key;
}
Program: 38536
Project: 38536
Buggy source:
private void firstWalk(int node){
  np[node]=new NodeParameter();
  np[node].d=0;
  double s=0;
  int[] sons=tree.getChildren(node);
  for (  int k : sons) {
    firstWalk(k);
    np[node].d=Math.max(np[node].d,np[k].r);
    np[k].alpha=Math.atan(np[k].r / (np[node].d + np[k].r));
    s+=np[k].alpha;
  }
  adjustChildren(node,s);
  setRadius(node);
}

Fixed version (ground truth):
private void firstWalk(int node){
  np[node]=new NodeParameter();
  np[node].d=0;
  double s=0;
  int[] sons=tree.getChildren(node);
  for (  int k : sons) {
    firstWalk(k);
    np[node].d=Math.max(np[node].d,np[k].r);
  }
  for (  int k : sons) {
    np[k].alpha=Math.atan(np[k].r / (np[node].d + np[k].r));
    s+=np[k].alpha;
  }
  adjustChildren(node,s);
  setRadius(node);
}
Program: 38537
Project: 38537
Buggy source:
private void secondWalk(int node,double x,double y,double lambda,double theta){
  nodePositionsX[node]=x;
  nodePositionsY[node]=y;
  double dd=lambda * np[node].d;
  double gamma=theta + Math.PI;
  double freeSpace=np[node].f / (tree.getChildren(node).length + 1);
  double previous=0;
  double currAlpha, currRadius;
  for (  int singleSon : tree.getChildren(node)) {
    currAlpha=np[node].c * np[singleSon].alpha;
    currRadius=np[node].d * (Math.tan(currAlpha) / (1 - Math.tan(currAlpha)));
    gamma=(gamma + previous + np[singleSon].alpha+ freeSpace);
    double kX=(lambda * currRadius + dd) * Math.cos(gamma);
    double kY=(lambda * currRadius + dd) * Math.sin(gamma);
    previous=np[singleSon].alpha;
    secondWalk(singleSon,kX + x,kY + y,lambda * (currRadius / np[singleSon].r),gamma);
  }
}

Fixed version (ground truth):
private void secondWalk(int node,double x,double y,double lambda,double theta){
  nodePositionsX[node]=x;
  nodePositionsY[node]=y;
  int[] children=tree.getChildren(node);
  double dd=lambda * np[node].d;
  double gamma=theta + Math.PI;
  double freeSpace=np[node].f / children.length;
  double previous=0;
  double currAlpha, currRadius;
  for (  int singleSon : children) {
    currAlpha=np[node].c * np[singleSon].alpha;
    currRadius=np[node].d * (Math.tan(currAlpha) / (1 - Math.tan(currAlpha)));
    gamma=gamma + previous + np[singleSon].alpha+ freeSpace;
    double kX=(lambda * currRadius + dd) * Math.cos(gamma);
    double kY=(lambda * currRadius + dd) * Math.sin(gamma);
    previous=np[singleSon].alpha;
    secondWalk(singleSon,kX + x,kY + y,lambda * (currRadius / np[singleSon].r),gamma);
  }
}
Program: 38538
Project: 38538
Buggy source:
@Override public Graph transform(Graph graph){
  Random rand=new Random();
  ChordIdentifierSpace idSpace=new ChordIdentifierSpace(this.bits);
  for (int r=0; r < this.realities; r++) {
    ChordIdentifier[] ids=new ChordIdentifier[graph.getNodes().length];
    if (this.uniform) {
      BigInteger stepSize=idSpace.getModulus().divide(new BigInteger("String_Node_Str" + graph.getNodes().length));
      for (int i=0; i < ids.length; i++) {
        ids[i]=new ChordIdentifier(idSpace,stepSize.multiply(new BigInteger("String_Node_Str" + i)));
      }
    }
 else {
      HashSet<String> idSet=new HashSet<String>();
      for (int i=0; i < ids.length; i++) {
        ChordIdentifier id=(ChordIdentifier)idSpace.randomID(rand);
        while (idSet.contains(id.toString())) {
          id=(ChordIdentifier)idSpace.randomID(rand);
        }
        ids[i]=id;
        idSet.add(id.toString());
      }
    }
    Arrays.sort(ids);
    ChordPartition[] partitions=new ChordPartition[ids.length];
    partitions[0]=new ChordPartition(ids[ids.length - 1],ids[0]);
    for (int i=1; i < partitions.length; i++) {
      partitions[i]=new ChordPartition(ids[i - 1],ids[i]);
    }
    idSpace.setPartitions(partitions);
    graph.addProperty(graph.getNextKey("String_Node_Str"),idSpace);
  }
  return graph;
}

Fixed version (ground truth):
@Override public Graph transform(Graph graph){
  Random rand=new Random();
  for (int r=0; r < this.realities; r++) {
    ChordIdentifierSpace idSpace=new ChordIdentifierSpace(this.bits);
    ChordIdentifier[] ids=new ChordIdentifier[graph.getNodes().length];
    if (this.uniform) {
      BigInteger stepSize=idSpace.getModulus().divide(new BigInteger("String_Node_Str" + graph.getNodes().length));
      for (int i=0; i < ids.length; i++) {
        ids[i]=new ChordIdentifier(idSpace,stepSize.multiply(new BigInteger("String_Node_Str" + i)));
      }
    }
 else {
      HashSet<String> idSet=new HashSet<String>();
      for (int i=0; i < ids.length; i++) {
        ChordIdentifier id=(ChordIdentifier)idSpace.randomID(rand);
        while (idSet.contains(id.toString())) {
          id=(ChordIdentifier)idSpace.randomID(rand);
        }
        ids[i]=id;
        idSet.add(id.toString());
      }
    }
    Arrays.sort(ids);
    ChordPartition[] partitions=new ChordPartition[ids.length];
    partitions[0]=new ChordPartition(ids[ids.length - 1],ids[0]);
    for (int i=1; i < partitions.length; i++) {
      partitions[i]=new ChordPartition(ids[i - 1],ids[i]);
    }
    idSpace.setPartitions(partitions);
    graph.addProperty(graph.getNextKey("String_Node_Str"),idSpace);
  }
  return graph;
}
Program: 38539
Project: 38539
Buggy source:
public static void main(String[] args){
  Stats stats=new Stats();
  Config.overwrite("String_Node_Str","String_Node_Str");
  Config.overwrite("String_Node_Str","String_Node_Str");
  Config.overwrite("String_Node_Str","String_Node_Str");
  Config.overwrite("String_Node_Str","String_Node_Str");
  Config.overwrite("String_Node_Str","String_Node_Str" + true);
  Transformation[] sTArray;
  BFS bfs=new BFS("String_Node_Str");
  RoutingAlgorithm rA=new GreedyBacktracking(25);
  Transformation[] t=new Transformation[]{new CanonicalCircularCrossing(1,100,true,null),new SixTollis(1,100,true,null),new WetherellShannon(100,100,null),new Knuth(100,100,null),new MelanconHerman(100,100,null),new BubbleTree(100,100,null),new FruchtermanReingold(1,new double[]{100,100},false,100,null)};
  for (  Transformation sT : t) {
    if (sT instanceof HierarchicalAbstract) {
      sTArray=new Transformation[]{bfs,sT};
    }
 else {
      sTArray=new Transformation[]{sT};
    }
    Network[] nw=new Network[]{new ErdosRenyi(500,10,true,rA,sTArray),new BarabasiAlbert(500,10,rA,sTArray),new ReadableFile("String_Node_Str","String_Node_Str","String_Node_Str",rA,sTArray)};
    for (    Network sN : nw) {
      Series[] s=Series.generate(nw,50);
    }
  }
  stats.end();
}

Fixed version (ground truth):
public static void main(String[] args){
  Stats stats=new Stats();
  Config.overwrite("String_Node_Str","String_Node_Str");
  Config.overwrite("String_Node_Str","String_Node_Str");
  Config.overwrite("String_Node_Str","String_Node_Str");
  Config.overwrite("String_Node_Str","String_Node_Str");
  Config.overwrite("String_Node_Str","String_Node_Str" + true);
  Transformation[] sTArray;
  BFS bfs=new BFS("String_Node_Str");
  RoutingAlgorithm rA=new GreedyBacktracking(25);
  Transformation[] t=new Transformation[]{new CanonicalCircularCrossing(1,100,true,null),new SixTollis(1,100,true,null),new WetherellShannon(100,100,null),new Knuth(100,100,null),new MelanconHerman(100,100,null),new BubbleTree(100,100,null),new FruchtermanReingold(1,new double[]{100,100},false,100,null)};
  for (  Transformation sT : t) {
    if (sT instanceof HierarchicalAbstract) {
      sTArray=new Transformation[]{bfs,sT};
    }
 else {
      sTArray=new Transformation[]{sT};
    }
    Network[] nw=new Network[]{new ErdosRenyi(500,10,true,rA,sTArray),new BarabasiAlbert(500,10,rA,sTArray),new ReadableFile("String_Node_Str","String_Node_Str","String_Node_Str",rA,sTArray)};
    Series[] s=Series.generate(nw,50);
  }
  stats.end();
}
Program: 38540
Project: 38540
Buggy source:
public Graph generate(){
  Graph graph=new Graph(this.description());
  Random rand=new Random(System.currentTimeMillis());
  Node[] nodes=Node.init(this.nodes(),graph);
  int[] in=new int[nodes.length];
  int[] out=new int[nodes.length];
  int initNodes=Math.max(this.INIT_NETWORK_SIZE,this.EDGES_PER_NODE + 5);
  int initEdges=initNodes * this.EDGES_PER_NODE;
  Graph temp=new ErdosRenyi(initNodes,initEdges,true,this.routingAlgorithm(),this.transformations()).generate();
  Edges edges=new Edges(nodes,initEdges + (nodes.length - initNodes) * this.EDGES_PER_NODE);
  for (int i=0; i < temp.getNodes().length; i++) {
    in[i]=temp.getNodes()[i].getInDegree();
    out[i]=temp.getNodes()[i].getOutDegree();
    int[] Out=temp.getNodes()[i].getOutgoingEdges();
    for (int j=0; j < Out.length; j++) {
      edges.add(i,Out[j]);
    }
  }
  int edgeCounter=initEdges;
  for (int i=initNodes; i < nodes.length; i++) {
    int added=0;
    while (added < this.EDGES_PER_NODE) {
      int dest=rand.nextInt(i);
      if (edges.contains(i,dest)) {
        continue;
      }
      double pi=(double)(in[i] + out[i]) / (double)(2 * edgeCounter);
      if (rand.nextDouble() <= pi) {
        in[i]++;
        out[i]++;
        in[dest]++;
        out[dest]++;
        edgeCounter++;
        added++;
      }
    }
  }
  edges.fill();
  graph.setNodes(nodes);
  return graph;
}

Fixed version (ground truth):
public Graph generate(){
  System.out.println("String_Node_Str");
  Graph graph=new Graph(this.description());
  Random rand=new Random(System.currentTimeMillis());
  Node[] nodes=Node.init(this.nodes(),graph);
  int[] in=new int[nodes.length];
  int[] out=new int[nodes.length];
  int initNodes=Math.max(this.INIT_NETWORK_SIZE,this.EDGES_PER_NODE + 5);
  int initEdges=initNodes * this.EDGES_PER_NODE;
  Graph temp=new ErdosRenyi(initNodes,this.EDGES_PER_NODE,true,this.routingAlgorithm(),this.transformations()).generate();
  Edges edges=new Edges(nodes,initEdges + (nodes.length - initNodes) * this.EDGES_PER_NODE);
  for (int i=0; i < temp.getNodes().length; i++) {
    in[i]=temp.getNodes()[i].getInDegree();
    out[i]=temp.getNodes()[i].getOutDegree();
    int[] Out=temp.getNodes()[i].getOutgoingEdges();
    for (int j=0; j < Out.length; j++) {
      edges.add(i,Out[j]);
    }
  }
  int edgeCounter=initEdges;
  for (int i=initNodes; i < nodes.length; i++) {
    int added=0;
    double[] rands=new double[this.EDGES_PER_NODE];
    for (int j=0; j < rands.length; j++) {
      rands[j]=rand.nextDouble() * 2 * edgeCounter;
    }
    Arrays.sort(rands);
    double sum2=0;
    int current=0;
    while (added < rands.length && current < i) {
      sum2=sum2 + (double)(in[current] + out[current]);
      if (sum2 >= rands[added]) {
        edges.add(i,current);
        edges.add(current,i);
        added++;
        in[i]++;
        out[i]++;
        in[current]++;
        out[current]++;
        edgeCounter++;
      }
      current++;
    }
  }
  edges.fill();
  graph.setNodes(nodes);
  return graph;
}
Program: 38541
Project: 38541
Buggy source:
public int calculateCrossings(Node n,Node m,IdentifierSpace idSpace){
  int numCross=0;
  Edge[] nEdges=n.generateAllEdges();
  Edge[] mEdges=m.generateAllEdges();
  handledEdges=new HashSet<String>();
  for (  Edge nEdge : nEdges) {
    for (    Edge mEdge : mEdges) {
      if (hasCrossing(nEdge,mEdge,idSpace,true))       numCross++;
    }
  }
  return numCross;
}

Fixed version (ground truth):
public int calculateCrossings(Node n,Node m,IdentifierSpace idSpace){
  int numCross=0;
  Edge[] nEdges=n.generateAllEdges();
  Edge[] mEdges=m.generateAllEdges();
  handledEdges=new HashSet<String>();
  partitions=idSpace.getPartitions();
  for (  Edge nEdge : nEdges) {
    for (    Edge mEdge : mEdges) {
      if (hasCrossing(nEdge,mEdge,idSpace,true))       numCross++;
    }
  }
  return numCross;
}
Program: 38544
Project: 38544
Buggy source:
private void fill(int nodes,ArrayList<ParentChild> pcs){
  this.parent=Util.initIntArray(nodes,-1);
  this.children=new int[nodes][];
  this.depth=Util.initIntArray(nodes,-1);
  this.src=-1;
  int[] counter=new int[nodes];
  for (  ParentChild pc : pcs) {
    this.parent[pc.getChild()]=pc.getParent();
    this.depth[pc.getChild()]=pc.getDepth();
    counter[pc.getParent()]++;
  }
  for (int i=0; i < this.children.length; i++) {
    this.children[i]=new int[counter[i]];
  }
  for (  ParentChild pc : pcs) {
    this.children[pc.getParent()][this.children[pc.getParent()].length - counter[pc.getParent()]]=pc.getChild();
    counter[pc.getParent()]--;
  }
  for (int i=0; i < this.parent.length; i++) {
    if (this.parent[i] == -1) {
      this.src=i;
      this.depth[i]=0;
      break;
    }
  }
}

Fixed version (ground truth):
private void fill(int nodes,ArrayList<ParentChild> pcs){
  this.parent=Util.initIntArray(nodes,-1);
  this.children=new int[nodes][];
  this.depth=Util.initIntArray(nodes,-1);
  this.src=-1;
  int[] counter=new int[nodes];
  for (  ParentChild pc : pcs) {
    if (pc.getParent() == -1)     continue;
    this.parent[pc.getChild()]=pc.getParent();
    this.depth[pc.getChild()]=pc.getDepth();
    counter[pc.getParent()]++;
  }
  for (int i=0; i < this.children.length; i++) {
    this.children[i]=new int[counter[i]];
  }
  for (  ParentChild pc : pcs) {
    if (pc.getParent() == -1)     continue;
    this.children[pc.getParent()][this.children[pc.getParent()].length - counter[pc.getParent()]]=pc.getChild();
    counter[pc.getParent()]--;
  }
  for (int i=0; i < this.parent.length; i++) {
    if (this.parent[i] == -1) {
      this.src=i;
      this.depth[i]=0;
      break;
    }
  }
}
Program: 38545
Project: 38545
Buggy source:
@Override public Graph transform(Graph graph){
  Node root=selectRoot(graph,rootSelector);
  Node tempNodeFromList;
  Integer[] edges;
  Node[] nodes=graph.getNodes();
  int depth;
  LinkedList<Node> todoList=new LinkedList<Node>();
  LinkedList<Integer> linkedNodes=new LinkedList<Integer>();
  HashMap<Integer,ParentChild> parentChildMap=new HashMap<Integer,ParentChild>();
  todoList.add(root);
  while (!todoList.isEmpty()) {
    tempNodeFromList=todoList.pop();
    if (linkedNodes.contains(tempNodeFromList.getIndex())) {
      continue;
    }
    ParentChild parent=parentChildMap.get(tempNodeFromList.getIndex());
    if (parent == null) {
      depth=1;
    }
 else {
      depth=parent.getDepth() + 1;
    }
    edges=tempNodeFromList.generateOutgoingEdgesByDegree();
    for (    int e : edges) {
      if (!linkedNodes.contains(e)) {
        todoList.add(nodes[e]);
        parentChildMap.put(e,new ParentChild(tempNodeFromList.getIndex(),e,depth));
      }
    }
    linkedNodes.add(tempNodeFromList.getIndex());
  }
  int graphNodeSize=graph.getNodes().length;
  int spanningTreeSize=parentChildMap.size();
  if ((spanningTreeSize + 1) < graphNodeSize) {
    throw new RuntimeException("String_Node_Str" + graphNodeSize + "String_Node_Str"+ spanningTreeSize+ "String_Node_Str");
  }
  ArrayList<ParentChild> parentChildList=new ArrayList<ParentChild>();
  parentChildList.addAll(parentChildMap.values());
  SpanningTree result=new SpanningTree(graph,parentChildList);
  graph.addProperty("String_Node_Str",result);
  return graph;
}

Fixed version (ground truth):
@Override public Graph transform(Graph graph){
  Node root=selectRoot(graph,rootSelector);
  Node tempNodeFromList;
  Integer[] edges;
  Node[] nodes=graph.getNodes();
  int depth;
  LinkedList<Node> todoList=new LinkedList<Node>();
  HashMap<Integer,ParentChild> parentChildMap=new HashMap<Integer,ParentChild>();
  todoList.add(root);
  parentChildMap.put(root.getIndex(),new ParentChild(-1,root.getIndex(),0));
  while (!todoList.isEmpty()) {
    tempNodeFromList=todoList.pop();
    ParentChild parent=parentChildMap.get(tempNodeFromList.getIndex());
    if (parent == null) {
      depth=1;
    }
 else {
      depth=parent.getDepth() + 1;
    }
    edges=tempNodeFromList.generateOutgoingEdgesByDegree();
    for (    int e : edges) {
      if (!parentChildMap.containsKey(e)) {
        todoList.add(nodes[e]);
        parentChildMap.put(e,new ParentChild(tempNodeFromList.getIndex(),e,depth));
      }
    }
  }
  int graphNodeSize=graph.getNodes().length;
  int spanningTreeSize=parentChildMap.size();
  if ((spanningTreeSize + 1) < graphNodeSize) {
    throw new RuntimeException("String_Node_Str" + graphNodeSize + "String_Node_Str"+ spanningTreeSize+ "String_Node_Str");
  }
  ArrayList<ParentChild> parentChildList=new ArrayList<ParentChild>();
  parentChildList.addAll(parentChildMap.values());
  SpanningTree result=new SpanningTree(graph,parentChildList);
  graph.addProperty("String_Node_Str",result);
  return graph;
}
Program: 38546
Project: 38546
Buggy source:
private void fill(int nodes,ArrayList<ParentChild> pcs){
  this.parent=Util.initIntArray(nodes,-1);
  this.children=new int[nodes][];
  this.depth=Util.initIntArray(nodes,0);
  this.src=-1;
  int[] counter=new int[nodes];
  for (  ParentChild pc : pcs) {
    this.parent[pc.getChild()]=pc.getParent();
    this.depth[pc.getChild()]=pc.getDepth();
    counter[pc.getParent()]++;
  }
  for (int i=0; i < this.children.length; i++) {
    this.children[i]=new int[counter[i]];
  }
  for (  ParentChild pc : pcs) {
    this.children[pc.getParent()][this.children[pc.getParent()].length - counter[pc.getParent()]]=pc.getChild();
    counter[pc.getParent()]--;
  }
  for (int i=0; i < this.parent.length; i++) {
    if (this.parent[i] == -1) {
      this.src=i;
      break;
    }
  }
}

Fixed version (ground truth):
private void fill(int nodes,ArrayList<ParentChild> pcs){
  this.parent=Util.initIntArray(nodes,-1);
  this.children=new int[nodes][];
  this.depth=Util.initIntArray(nodes,-1);
  this.src=-1;
  int[] counter=new int[nodes];
  for (  ParentChild pc : pcs) {
    this.parent[pc.getChild()]=pc.getParent();
    this.depth[pc.getChild()]=pc.getDepth();
    counter[pc.getParent()]++;
  }
  for (int i=0; i < this.children.length; i++) {
    this.children[i]=new int[counter[i]];
  }
  for (  ParentChild pc : pcs) {
    this.children[pc.getParent()][this.children[pc.getParent()].length - counter[pc.getParent()]]=pc.getChild();
    counter[pc.getParent()]--;
  }
  for (int i=0; i < this.parent.length; i++) {
    if (this.parent[i] == -1) {
      this.src=i;
      this.depth[i]=0;
      break;
    }
  }
}
Program: 38549
Project: 38549
Buggy source:
/** 
 * @return
 */
private Node getNode(Node lastNode){
  if (waveFrontNodes != null) {
    for (    Node tempNode : waveFrontNodes) {
      if (!removedNodes.contains(tempNode)) {
        return tempNode;
      }
    }
  }
  if (waveCenterNodes != null) {
    for (    Node tempNode : waveCenterNodes) {
      if (!removedNodes.contains(tempNode)) {
        return tempNode;
      }
    }
  }
  for (  Node tempNode : nodeList) {
    if (!removedNodes.contains(tempNode)) {
      return tempNode;
    }
  }
  throw new RuntimeException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @return
 */
private Node getNode(Node lastNode){
  if (waveFrontNodes != null) {
    for (    Node tempNode : waveFrontNodes) {
      if (!removedNodes.contains(tempNode)) {
        waveFrontNodes.remove(tempNode);
        return tempNode;
      }
    }
  }
  if (waveCenterNodes != null) {
    for (    Node tempNode : waveCenterNodes) {
      if (!removedNodes.contains(tempNode)) {
        waveCenterNodes.remove(tempNode);
        return tempNode;
      }
    }
  }
  for (  Node tempNode : nodeList) {
    if (!removedNodes.contains(tempNode)) {
      return tempNode;
    }
  }
  throw new RuntimeException("String_Node_Str");
}
Program: 38550
Project: 38550
Buggy source:
private LinkedList<Node> longestPath(Graph g){
  TreeNode root=new TreeNode(null,0,0);
  deepestNode=root;
  dfs(g,g.getNode(0),root,new ArrayList<Integer>());
  return null;
}

Fixed version (ground truth):
private LinkedList<Node> longestPath(){
  filterRemovalList=true;
  TreeNode root=new TreeNode(null,0,0);
  deepestNode=root;
  dfs(g.getNode(0),root,new ArrayList<Integer>());
  return null;
}
Program: 38551
Project: 38551
Buggy source:
private void dfs(Graph g,Node n,TreeNode root,ArrayList<Integer> visited){
  int otherEnd;
  if (visited.contains(n.getIndex())) {
    return;
  }
  visited.add(n.getIndex());
  TreeNode current=new TreeNode(root,n.getIndex(),root.depth + 1);
  root.children.add(current);
  if (current.depth > deepestNode.depth) {
    deepestNode=current;
  }
  for (  Edge mEdge : getEdges(g,n).values()) {
    if (removalList.containsKey(mEdge.toString())) {
      continue;
    }
    if (mEdge.getDst() == n.getIndex()) {
      otherEnd=mEdge.getSrc();
    }
 else {
      otherEnd=mEdge.getDst();
    }
    Node mNode=g.getNode(otherEnd);
    dfs(g,mNode,current,visited);
  }
}

Fixed version (ground truth):
private void dfs(Node n,TreeNode root,ArrayList<Integer> visited){
  int otherEnd;
  if (visited.contains(n.getIndex())) {
    return;
  }
  visited.add(n.getIndex());
  TreeNode current=new TreeNode(root,n.getIndex(),root.depth + 1);
  root.children.add(current);
  if (current.depth > deepestNode.depth) {
    deepestNode=current;
  }
  for (  Edge mEdge : getEdges(n).values()) {
    if (filterRemovalList && removalList.containsKey(mEdge.toString())) {
      continue;
    }
    if (mEdge.getDst() == n.getIndex()) {
      otherEnd=mEdge.getSrc();
    }
 else {
      otherEnd=mEdge.getDst();
    }
    Node mNode=g.getNode(otherEnd);
    dfs(mNode,current,visited);
  }
}
Program: 38553
Project: 38553
Buggy source:
private HashMap<String,Edge> getPairEdges(Graph g,Node n){
  HashMap<String,Edge> result=new HashMap<String,Edge>();
  Node tempInnerNode;
  Edge tempEdge;
  int otherOuterEnd, otherInnerEnd;
  HashMap<String,Edge> allOuterEdges=getEdges(g,n);
  for (  Edge tempOuterEdge : allOuterEdges.values()) {
    if (tempOuterEdge.getDst() == n.getIndex()) {
      otherOuterEnd=tempOuterEdge.getSrc();
    }
 else {
      otherOuterEnd=tempOuterEdge.getDst();
    }
    HashMap<String,Edge> allInnerEdges=getEdges(g,g.getNode(otherOuterEnd));
    for (    Edge tempInnerEdge : allInnerEdges.values()) {
      if (tempInnerEdge.getDst() == otherOuterEnd) {
        otherInnerEnd=tempInnerEdge.getSrc();
      }
 else {
        otherInnerEnd=tempInnerEdge.getDst();
      }
      if (otherInnerEnd == n.getIndex()) {
        continue;
      }
      tempInnerNode=g.getNode(otherInnerEnd);
      if (tempInnerNode.isConnectedTo(n)) {
        tempEdge=new Edge(Math.min(otherInnerEnd,otherOuterEnd),Math.max(otherInnerEnd,otherOuterEnd));
        result.put(getEdgeString(tempEdge),tempEdge);
      }
 else {
      }
    }
  }
  return result;
}

Fixed version (ground truth):
private HashMap<String,Edge> getPairEdges(Node n){
  HashMap<String,Edge> result=new HashMap<String,Edge>();
  Node tempInnerNode;
  Edge tempEdge;
  int otherOuterEnd, otherInnerEnd;
  HashMap<String,Edge> allOuterEdges=getEdges(n);
  for (  Edge tempOuterEdge : allOuterEdges.values()) {
    if (tempOuterEdge.getDst() == n.getIndex()) {
      otherOuterEnd=tempOuterEdge.getSrc();
    }
 else {
      otherOuterEnd=tempOuterEdge.getDst();
    }
    HashMap<String,Edge> allInnerEdges=getEdges(g.getNode(otherOuterEnd));
    for (    Edge tempInnerEdge : allInnerEdges.values()) {
      if (tempInnerEdge.getDst() == otherOuterEnd) {
        otherInnerEnd=tempInnerEdge.getSrc();
      }
 else {
        otherInnerEnd=tempInnerEdge.getDst();
      }
      if (otherInnerEnd == n.getIndex()) {
        continue;
      }
      tempInnerNode=g.getNode(otherInnerEnd);
      if (connected(n,tempInnerNode)) {
        tempEdge=new Edge(Math.min(otherInnerEnd,otherOuterEnd),Math.max(otherInnerEnd,otherOuterEnd));
        result.put(getEdgeString(tempEdge),tempEdge);
      }
 else {
      }
    }
  }
  return result;
}
Program: 38554
Project: 38554
Buggy source:
private ArrayList<Edge> getAllEdges(Graph g,Node n){
  ArrayList<Edge> edges=new ArrayList<Edge>();
  for (  Edge e : n.generateAllEdges())   edges.add(e);
  edges.addAll(additionalEdges[n.getIndex()].values());
  return edges;
}

Fixed version (ground truth):
private ArrayList<Edge> getAllEdges(Node n){
  ArrayList<Edge> edges=new ArrayList<Edge>();
  for (  Edge e : n.generateAllEdges())   edges.add(e);
  edges.addAll(additionalEdges[n.getIndex()].values());
  return edges;
}
Program: 38555
Project: 38555
Buggy source:
private HashMap<String,Edge> getEdges(Graph g,Node n){
  Node tempNode=null;
  HashMap<String,Edge> edges=new HashMap<String,Edge>();
  for (  Edge i : getAllEdges(g,n)) {
    int otherEnd;
    if (i.getDst() == n.getIndex()) {
      otherEnd=i.getSrc();
    }
 else {
      otherEnd=i.getDst();
    }
    tempNode=g.getNode(otherEnd);
    if (removedNodes.contains(tempNode)) {
      continue;
    }
    edges.put(getEdgeString(i),i);
  }
  return edges;
}

Fixed version (ground truth):
private HashMap<String,Edge> getEdges(Node n){
  Node tempNode=null;
  HashMap<String,Edge> edges=new HashMap<String,Edge>();
  for (  Edge i : getAllEdges(n)) {
    int otherEnd;
    if (i.getDst() == n.getIndex()) {
      otherEnd=i.getSrc();
    }
 else {
      otherEnd=i.getDst();
    }
    tempNode=g.getNode(otherEnd);
    if (removedNodes.contains(tempNode)) {
      continue;
    }
    edges.put(getEdgeString(i),i);
  }
  return edges;
}
Program: 38558
Project: 38558
Buggy source:
@Override public Graph transform(Graph g){
  tree=(SpanningTree)g.getProperty("String_Node_Str");
  int source=tree.getSrc();
  radiuses=new double[g.getNodes().length];
  delta=new double[g.getNodes().length];
  angularSector=new double[g.getNodes().length];
  calculateRadius(tree,source);
  Point center=new Point(0,0);
  coordAssign(tree,source,center);
  return g;
}

Fixed version (ground truth):
@Override public Graph transform(Graph g){
  tree=(SpanningTree)g.getProperty("String_Node_Str");
  int source=tree.getSrc();
  int numNodes=g.getNodes().length;
  nodePositionsX=new double[numNodes];
  nodePositionsY=new double[numNodes];
  radiuses=new double[numNodes];
  delta=new double[numNodes];
  angularSector=new double[numNodes];
  calculateRadius(tree,source);
  Point center=new Point(0,0);
  coordAssign(tree,source,center);
  writeIDSpace(g);
  if (graphPlotter != null)   graphPlotter.plotFinalGraph(g,idSpace);
  if (graphPlotter != null)   graphPlotter.plotSpanningTree(g,idSpace);
  return g;
}
Program: 38559
Project: 38559
Buggy source:
@Override public Partition<Double>[] getPartitions(){
  return this.partitions;
}

Fixed version (ground truth):
@Override public DPartition[] getPartitions(){
  return this.partitions;
}
Program: 38560
Project: 38560
Buggy source:
@Override public Partition<Double>[] getPartitions(){
  return this.partitions;
}

Fixed version (ground truth):
@Override public DPartition[] getPartitions(){
  return this.partitions;
}
Program: 38561
Project: 38561
Buggy source:
public void computeData(Graph graph,Network nw,HashMap<String,Metric> m){
  this.runtime=new Timer();
  Edge[] edges=graph.generateEdges();
  DIdentifierSpace idSpace=(DIdentifierSpace)graph.getProperty("String_Node_Str");
  int result=calculateCrossings(edges,idSpace,false);
  double[] finalCD=new double[maxCrossingNumber];
  for (int i=0; i < maxCrossingNumber; i++) {
    finalCD[i]=cd[i] / result;
  }
  this.crossingDistribution=new Distribution(finalCD);
  this.runtime.end();
}

Fixed version (ground truth):
public void computeData(Graph graph,Network nw,HashMap<String,Metric> m){
  this.runtime=new Timer();
  Edge[] edges=graph.generateEdges();
  DIdentifierSpace idSpace=(DIdentifierSpace)graph.getProperty("String_Node_Str");
  int result=calculateCrossings(edges,idSpace,false);
  double[] finalCD=new double[maxCrossingNumber + 1];
  for (int i=0; i < maxCrossingNumber + 1; i++) {
    finalCD[i]=cd[i] / edges.length;
  }
  this.crossingDistribution=new Distribution(finalCD);
  this.runtime.end();
}
Program: 38562
Project: 38562
Buggy source:
private boolean hasCrossingMD(Edge x,Edge y){
  return hasCrossing(getPlaneEdgeFromMD(x),getPlaneEdgeFromMD(y));
}

Fixed version (ground truth):
private boolean hasCrossingMD(Edge x,Edge y,Boolean useShortcut){
  return hasCrossing(getPlaneEdgeFromMD(x),getPlaneEdgeFromMD(y),useShortcut);
}
Program: 38563
Project: 38563
Buggy source:
public int calculateCrossings(Node n,Node m,IdentifierSpace idSpace){
  int numCross=0;
  Edge[] nEdges=n.generateAllEdges();
  Edge[] mEdges=m.generateAllEdges();
  handledEdges=new HashSet<String>();
  for (  Edge nEdge : nEdges) {
    for (    Edge mEdge : mEdges) {
      if (hasCrossing(nEdge,mEdge,idSpace))       numCross++;
    }
  }
  return numCross;
}

Fixed version (ground truth):
public int calculateCrossings(Node n,Node m,IdentifierSpace idSpace){
  int numCross=0;
  Edge[] nEdges=n.generateAllEdges();
  Edge[] mEdges=m.generateAllEdges();
  handledEdges=new HashSet<String>();
  for (  Edge nEdge : nEdges) {
    for (    Edge mEdge : mEdges) {
      if (hasCrossing(nEdge,mEdge,idSpace,true))       numCross++;
    }
  }
  return numCross;
}
Program: 38564
Project: 38564
Buggy source:
private boolean hasCrossingPlane(Edge x,Edge y){
  return hasCrossing(getPlaneEdgeFromPI(x),getPlaneEdgeFromPI(y));
}

Fixed version (ground truth):
private boolean hasCrossingPlane(Edge x,Edge y,Boolean useShortcut){
  return hasCrossing(getPlaneEdgeFromPI(x),getPlaneEdgeFromPI(y),useShortcut);
}
Program: 38565
Project: 38565
Buggy source:
private boolean hasCrossing(PlaneEdge x,PlaneEdge y){
  String edgeString=x + "String_Node_Str" + y;
  if (y.startX < x.startX) {
    edgeString=y + "String_Node_Str" + x;
  }
  if (handledEdges.contains(edgeString)) {
    return false;
  }
  handledEdges.add(edgeString);
  double d=(x.startX - x.endX) * (y.startY - y.endY) - (x.startY - x.endY) * (y.startX - y.endX);
  if (d == 0) {
    return false;
  }
  double xi=((y.startX - y.endX) * (x.startX * x.endY - x.startY * x.endX) - (x.startX - x.endX) * (y.startX * y.endY - y.startY * y.endX)) / d;
  double yi=((y.startY - y.endY) * (x.startX * x.endY - x.startY * x.endX) - (x.startY - x.endY) * (y.startX * y.endY - y.startY * y.endX)) / d;
  if (isBetween(x.startX,x.endX,xi) && isBetween(x.startY,x.endY,yi) && isBetween(y.startX,y.endX,xi)&& isBetween(y.startY,y.endY,yi)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean hasCrossing(PlaneEdge x,PlaneEdge y,Boolean useShortcut){
  String edgeString=x + "String_Node_Str" + y;
  if (y.startX < x.startX) {
    edgeString=y + "String_Node_Str" + x;
  }
  if (useShortcut) {
    if (handledEdges.contains(edgeString)) {
      return false;
    }
    handledEdges.add(edgeString);
  }
  double d=(x.startX - x.endX) * (y.startY - y.endY) - (x.startY - x.endY) * (y.startX - y.endX);
  if (d == 0) {
    return false;
  }
  double xi=((y.startX - y.endX) * (x.startX * x.endY - x.startY * x.endX) - (x.startX - x.endX) * (y.startX * y.endY - y.startY * y.endX)) / d;
  double yi=((y.startY - y.endY) * (x.startX * x.endY - x.startY * x.endX) - (x.startY - x.endY) * (y.startX * y.endY - y.startY * y.endX)) / d;
  if (isBetween(x.startX,x.endX,xi) && isBetween(x.startY,x.endY,yi) && isBetween(y.startX,y.endX,xi)&& isBetween(y.startY,y.endY,yi)) {
    return true;
  }
  return false;
}
Program: 38566
Project: 38566
Buggy source:
public Edge[] getAllEdges(){
  ArrayList<Edge> edgeList=new ArrayList<Edge>();
  for (  int dst : getOutgoingEdges()) {
    edgeList.add(new Edge(this.index,dst));
  }
  for (  int src : getIncomingEdges()) {
    edgeList.add(new Edge(src,this.index));
  }
  return (Edge[])edgeList.toArray();
}

Fixed version (ground truth):
public Edge[] getAllEdges(){
  ArrayList<Edge> edgeList=new ArrayList<Edge>();
  for (  int dst : getOutgoingEdges()) {
    edgeList.add(new Edge(this.index,dst));
  }
  for (  int src : getIncomingEdges()) {
    edgeList.add(new Edge(src,this.index));
  }
  Edge[] arrayEdgeList=new Edge[edgeList.size()];
  for (int i=0; i < arrayEdgeList.length; i++) {
    arrayEdgeList[i]=edgeList.get(i);
  }
  return arrayEdgeList;
}
Program: 38567
Project: 38567
Buggy source:
protected int countAllCrossings(Graph g){
  int numCross=0;
  Edge[] edgeList=g.generateEdges();
  handledEdges=new ArrayList<String>();
  for (  Edge e : edgeList) {
    numCross+=countCrossings(e,edgeList);
  }
  System.out.println("String_Node_Str" + numCross + "String_Node_Str");
  return numCross;
}

Fixed version (ground truth):
protected int countAllCrossings(Graph g){
  int numCross=0;
  Edge[] edgeList=g.generateEdges();
  handledEdges=new ArrayList<String>();
  for (  Edge e : edgeList) {
    numCross+=countCrossings(e,edgeList);
  }
  return numCross;
}
Program: 38568
Project: 38568
Buggy source:
private Boolean hasCrossing(Edge x,Edge y){
  if (x.equals(y))   return false;
  double xStart=Math.min(getPosition(x.getSrc()),getPosition(x.getDst()));
  double xEnd=Math.max(getPosition(x.getSrc()),getPosition(x.getDst()));
  String xString=xStart + "String_Node_Str" + xEnd;
  double yStart=Math.min(getPosition(y.getSrc()),getPosition(y.getDst()));
  double yEnd=Math.max(getPosition(y.getSrc()),getPosition(y.getDst()));
  String yString=yStart + "String_Node_Str" + yEnd;
  String edgeString;
  if (xStart < yStart)   edgeString=xString + "String_Node_Str" + yString;
 else   edgeString=yString + "String_Node_Str" + xString;
  if (handledEdges.contains(edgeString)) {
    return false;
  }
  handledEdges.add(edgeString);
  if ((xStart < yStart && xEnd > yEnd) || (yStart < xStart && yEnd > xEnd) || (yStart > xEnd || xStart > yEnd)|| (yStart == xEnd || xStart == yEnd || xStart == yStart || xEnd == yEnd)) {
    System.out.println("String_Node_Str" + edgeString);
    return false;
  }
  if ((xStart < yStart && xEnd < yEnd) || (xStart > yStart && xEnd > yEnd)) {
    System.out.println("String_Node_Str" + edgeString);
    return true;
  }
  System.err.println("String_Node_Str" + edgeString);
  return false;
}

Fixed version (ground truth):
private Boolean hasCrossing(Edge x,Edge y){
  if (x.equals(y))   return false;
  double xStart=Math.min(getPosition(x.getSrc()),getPosition(x.getDst()));
  double xEnd=Math.max(getPosition(x.getSrc()),getPosition(x.getDst()));
  String xString=xStart + "String_Node_Str" + xEnd;
  double yStart=Math.min(getPosition(y.getSrc()),getPosition(y.getDst()));
  double yEnd=Math.max(getPosition(y.getSrc()),getPosition(y.getDst()));
  String yString=yStart + "String_Node_Str" + yEnd;
  String edgeString;
  if (xStart < yStart)   edgeString=xString + "String_Node_Str" + yString;
 else   edgeString=yString + "String_Node_Str" + xString;
  if (handledEdges.contains(edgeString)) {
    return false;
  }
  handledEdges.add(edgeString);
  if ((xStart < yStart && xEnd > yEnd) || (yStart < xStart && yEnd > xEnd) || (yStart > xEnd || xStart > yEnd)|| (yStart == xEnd || xStart == yEnd || xStart == yStart || xEnd == yEnd)) {
    return false;
  }
  if ((xStart < yStart && xEnd < yEnd) || (xStart > yStart && xEnd > yEnd)) {
    return true;
  }
  System.err.println("String_Node_Str" + edgeString);
  return false;
}
Program: 38569
Project: 38569
Buggy source:
@Override public int compareTo(PlaneIdentifier o){
  return 0;
}

Fixed version (ground truth):
@Override public int compareTo(MDIdentifier o){
  return 0;
}
Program: 38570
Project: 38570
Buggy source:
public void plot(Graph g,String filename){
  if (!disabled) {
    gephi.Plot(g,filename + "String_Node_Str" + extension);
  }
}

Fixed version (ground truth):
public void plot(Graph g,String filename){
  gephi.Plot(g,filename + "String_Node_Str" + extension);
}
Program: 38571
Project: 38571
Buggy source:
@Override public Double distance(Identifier<Double> id){
  MDIdentifier to=(MDIdentifier)id;
  if (this.idSpace.getDimensions() != to.getIdSpace().getDimensions()) {
    throw new RuntimeException("String_Node_Str");
  }
  double squarredResult=0;
  for (int i=0; i < this.idSpace.getDimensions(); i++) {
    if (this.idSpace.isWrapAround()) {
      squarredResult+=Math.abs(this.coordinates[i] - to.getCoordinate(i)) % (this.idSpace.getModulus(i) / 2.0);
    }
 else {
      squarredResult+=Math.abs(this.coordinates[i] - to.getCoordinate(i));
    }
  }
  return Math.sqrt(squarredResult);
}

Fixed version (ground truth):
@Override public Double distance(Identifier<Double> id){
  MDIdentifier to=(MDIdentifier)id;
  if (this.idSpace.getDimensions() != to.getIdSpace().getDimensions()) {
    throw new RuntimeException("String_Node_Str");
  }
  double squarredResult=0;
  double temp;
  for (int i=0; i < this.idSpace.getDimensions(); i++) {
    if (this.idSpace.isWrapAround()) {
      temp=Math.abs(this.coordinates[i] - to.getCoordinate(i)) % (this.idSpace.getModulus(i) / 2.0);
    }
 else {
      temp=Math.abs(this.coordinates[i] - to.getCoordinate(i));
    }
    squarredResult+=Math.pow(temp,2);
  }
  return Math.sqrt(squarredResult);
}
Program: 38572
Project: 38572
Buggy source:
public void Plot(Graph g,String fileName){
  gephiNodes=new org.gephi.graph.api.Node[g.getNodes().length];
  this.plotGraph(g);
  ExportController ec=Lookup.getDefault().lookup(ExportController.class);
  try {
    ec.exportFile(new File(Config.get("String_Node_Str") + fileName));
  }
 catch (  IOException ex) {
    ex.printStackTrace();
    return;
  }
}

Fixed version (ground truth):
public void Plot(Graph g,String fileName){
  ProjectController pc=Lookup.getDefault().lookup(ProjectController.class);
  pc.newProject();
  graphModel=Lookup.getDefault().lookup(GraphController.class).getModel();
  gephiGraph=graphModel.getGraph();
  PreviewModel model=Lookup.getDefault().lookup(PreviewController.class).getModel();
  model.getUndirectedEdgeSupervisor().setCurvedFlag(false);
  model.getBiEdgeSupervisor().setCurvedFlag(false);
  gephiNodes=new org.gephi.graph.api.Node[g.getNodes().length];
  this.plotGraph(g);
  ExportController ec=Lookup.getDefault().lookup(ExportController.class);
  try {
    ec.exportFile(new File(Config.get("String_Node_Str") + fileName));
  }
 catch (  IOException ex) {
    ex.printStackTrace();
    return;
  }
}
Program: 38573
Project: 38573
Buggy source:
public Graph getSpanningTree(Node root){
  Graph result=new Graph(this.name + "String_Node_Str");
  Node[] resultNodes=new Node[this.nodes.length];
  int[] edges;
  int nodeCounter=0;
  Node tempNodeFromList, tempNewNode;
  LinkedList<Node> todoList=new LinkedList<Node>();
  LinkedList<Integer> handledNodes=new LinkedList<Integer>();
  LinkedList<Integer> linkedNodes=new LinkedList<Integer>();
  LinkedList<Integer> newEdges;
  todoList.add(root);
  linkedNodes.add(root.getIndex());
  while (!todoList.isEmpty()) {
    tempNodeFromList=todoList.pop();
    if (handledNodes.contains(tempNodeFromList.getIndex())) {
      continue;
    }
    edges=tempNodeFromList.getOutgoingEdges();
    newEdges=new LinkedList<Integer>();
    for (    int e : edges) {
      if (!linkedNodes.contains(e)) {
        todoList.add(this.nodes[e]);
        newEdges.add(e);
        linkedNodes.add(e);
      }
    }
    tempNewNode=new Node(tempNodeFromList.getIndex(),result);
    edges=new int[newEdges.size()];
    for (int i=0; i < newEdges.size(); i++) {
      edges[i]=newEdges.get(i);
    }
    tempNewNode.setOutgoingEdges(edges);
    resultNodes[nodeCounter]=tempNewNode;
    handledNodes.add(tempNodeFromList.getIndex());
    nodeCounter++;
  }
  result.setNodes(resultNodes);
  return result;
}

Fixed version (ground truth):
public Graph getSpanningTree(Node root){
  Graph result=new Graph(this.name + "String_Node_Str");
  Node[] resultNodes=new Node[this.nodes.length];
  int[] edges;
  Node tempNodeFromList, tempNewNode;
  LinkedList<Node> todoList=new LinkedList<Node>();
  LinkedList<Integer> handledNodes=new LinkedList<Integer>();
  LinkedList<Integer> linkedNodes=new LinkedList<Integer>();
  LinkedList<Integer> newEdges;
  todoList.add(root);
  linkedNodes.add(root.getIndex());
  while (!todoList.isEmpty()) {
    tempNodeFromList=todoList.pop();
    if (handledNodes.contains(tempNodeFromList.getIndex())) {
      continue;
    }
    edges=tempNodeFromList.getOutgoingEdges();
    newEdges=new LinkedList<Integer>();
    for (    int e : edges) {
      if (!linkedNodes.contains(e)) {
        todoList.add(this.nodes[e]);
        newEdges.add(e);
        linkedNodes.add(e);
      }
    }
    tempNewNode=new Node(tempNodeFromList.getIndex(),result);
    edges=new int[newEdges.size()];
    for (int i=0; i < newEdges.size(); i++) {
      edges[i]=newEdges.get(i);
    }
    tempNewNode.setOutgoingEdges(edges);
    resultNodes[tempNodeFromList.getIndex()]=tempNewNode;
    handledNodes.add(tempNodeFromList.getIndex());
  }
  result.setNodes(resultNodes);
  return result;
}
Program: 38574
Project: 38574
Buggy source:
public Edge[] getAllEdges(){
  ArrayList<Edge> edgeList=new ArrayList<Edge>();
  for (  int dst : getOutgoingEdges()) {
    edgeList.add(new Edge(this.index,dst));
  }
  for (  int src : getIncomingEdges()) {
    edgeList.add(new Edge(src,this.index));
  }
  return (Edge[])edgeList.toArray();
}

Fixed version (ground truth):
public Edge[] getAllEdges(){
  ArrayList<Edge> edgeList=new ArrayList<Edge>();
  for (  int dst : getOutgoingEdges()) {
    edgeList.add(new Edge(this.index,dst));
  }
  for (  int src : getIncomingEdges()) {
    edgeList.add(new Edge(src,this.index));
  }
  Edge[] arrayEdgeList=new Edge[edgeList.size()];
  for (int i=0; i < arrayEdgeList.length; i++) {
    arrayEdgeList[i]=edgeList.get(i);
  }
  return arrayEdgeList;
}
Program: 38575
Project: 38575
Buggy source:
protected int countAllCrossings(Graph g){
  int numCross=0;
  Edge[] edgeList=g.generateEdges();
  handledEdges=new ArrayList<String>();
  for (  Edge e : edgeList) {
    numCross+=countCrossings(e,edgeList);
  }
  System.out.println("String_Node_Str" + numCross + "String_Node_Str");
  return numCross;
}

Fixed version (ground truth):
protected int countAllCrossings(Graph g){
  int numCross=0;
  Edge[] edgeList=g.generateEdges();
  handledEdges=new ArrayList<String>();
  for (  Edge e : edgeList) {
    numCross+=countCrossings(e,edgeList);
  }
  return numCross;
}
Program: 38576
Project: 38576
Buggy source:
private Boolean hasCrossing(Edge x,Edge y){
  if (x.equals(y))   return false;
  double xStart=Math.min(getPosition(x.getSrc()),getPosition(x.getDst()));
  double xEnd=Math.max(getPosition(x.getSrc()),getPosition(x.getDst()));
  String xString=xStart + "String_Node_Str" + xEnd;
  double yStart=Math.min(getPosition(y.getSrc()),getPosition(y.getDst()));
  double yEnd=Math.max(getPosition(y.getSrc()),getPosition(y.getDst()));
  String yString=yStart + "String_Node_Str" + yEnd;
  String edgeString;
  if (xStart < yStart)   edgeString=xString + "String_Node_Str" + yString;
 else   edgeString=yString + "String_Node_Str" + xString;
  if (handledEdges.contains(edgeString)) {
    return false;
  }
  handledEdges.add(edgeString);
  if ((xStart < yStart && xEnd > yEnd) || (yStart < xStart && yEnd > xEnd) || (yStart > xEnd || xStart > yEnd)|| (yStart == xEnd || xStart == yEnd || xStart == yStart || xEnd == yEnd)) {
    System.out.println("String_Node_Str" + edgeString);
    return false;
  }
  if ((xStart < yStart && xEnd < yEnd) || (xStart > yStart && xEnd > yEnd)) {
    System.out.println("String_Node_Str" + edgeString);
    return true;
  }
  System.err.println("String_Node_Str" + edgeString);
  return false;
}

Fixed version (ground truth):
private Boolean hasCrossing(Edge x,Edge y){
  if (x.equals(y))   return false;
  double xStart=Math.min(getPosition(x.getSrc()),getPosition(x.getDst()));
  double xEnd=Math.max(getPosition(x.getSrc()),getPosition(x.getDst()));
  String xString=xStart + "String_Node_Str" + xEnd;
  double yStart=Math.min(getPosition(y.getSrc()),getPosition(y.getDst()));
  double yEnd=Math.max(getPosition(y.getSrc()),getPosition(y.getDst()));
  String yString=yStart + "String_Node_Str" + yEnd;
  String edgeString;
  if (xStart < yStart)   edgeString=xString + "String_Node_Str" + yString;
 else   edgeString=yString + "String_Node_Str" + xString;
  if (handledEdges.contains(edgeString)) {
    return false;
  }
  handledEdges.add(edgeString);
  if ((xStart < yStart && xEnd > yEnd) || (yStart < xStart && yEnd > xEnd) || (yStart > xEnd || xStart > yEnd)|| (yStart == xEnd || xStart == yEnd || xStart == yStart || xEnd == yEnd)) {
    return false;
  }
  if ((xStart < yStart && xEnd < yEnd) || (xStart > yStart && xEnd > yEnd)) {
    return true;
  }
  System.err.println("String_Node_Str" + edgeString);
  return false;
}
Program: 38577
Project: 38577
Buggy source:
public Edge[] generateEdgesUnidirectional(){
  int index=0;
  Edge[] edges=new Edge[this.parent.length - 1];
  for (int i=0; i < this.parent.length; i++) {
    if (i != -1) {
      edges[index++]=new Edge(this.parent[i],i);
    }
  }
  return edges;
}

Fixed version (ground truth):
public Edge[] generateEdgesUnidirectional(){
  int index=0;
  Edge[] edges=new Edge[this.parent.length - 1];
  for (int i=0; i < this.parent.length; i++) {
    if (this.parent[i] != -1) {
      edges[index++]=new Edge(this.parent[i],i);
    }
  }
  return edges;
}