nus-yam/ex-repair huggingface dataset:
Program: 39849
Project: 39849
Buggy source:
/** 
 * @param hotspotPlacer
 * @param nodePlacer
 * @param partitioner2
 * @param nodeConnector
 * @return
 */
private static String[] getConfigValues(PlacementModel hotspotPlacer,PlacementModel nodePlacer,NodeConnector connector,Partitioner partitioner){
  return Util.mergeArrays(new String[]{"String_Node_Str"},Util.mergeArrays(partitioner.getConfigValues(),Util.mergeArrays(connector.getConfigValues(),Util.mergeArrays(hotspotPlacer.getConfigValues(),nodePlacer.getConfigValues()))));
}

Fixed version (ground truth):
/** 
 * Constructs an array containing all the configuration values used for the particular <code>PlacementModelContainer</code>. Basically combines all the configuration values of both <code>PlacementModels</code>, the <code>Partitioner</code> and the <code>NodeConnector</code> into one big string array and adds the key of the <code>PlacementModelContainer</code> to this array.
 * @param hotspotPlacer The <code>PlacementModel</code> used to place the hotspots.
 * @param nodePlacer The <code>PlacementModel</code> used to place the nodes within the hotspots.
 * @param partitioner The <code>Partitioner</code> used to determine the number of nodes in each hotspot.
 * @param nodeConnector The <code>NodeConnector</code> used to connect the nodes after placing them.
 * @return A string array containg all the configuration values.
 */
private static String[] getConfigValues(PlacementModel hotspotPlacer,PlacementModel nodePlacer,NodeConnector connector,Partitioner partitioner){
  return Util.mergeArrays(new String[]{getKey(hotspotPlacer,nodePlacer)},Util.mergeArrays(partitioner.getConfigValues(),Util.mergeArrays(connector.getConfigValues(),Util.mergeArrays(hotspotPlacer.getConfigValues(),nodePlacer.getConfigValues()))));
}
Program: 39850
Project: 39850
Buggy source:
@Override public Graph generate(){
  Point[] hotspotCoords=hotspotPlacer.place(hotspots);
  PlanePartitionSimple[] coords=new PlanePartitionSimple[nodes];
  int[] nodesPerSpot=partitioner.partition(nodes,hotspots);
  int temp=0;
  int curNodes;
  for (int i=0; i < hotspots; i++) {
    curNodes=nodesPerSpot[i];
    addNodeCoords(coords,nodePlacer.place(curNodes),hotspotCoords[i],temp);
    temp+=curNodes;
  }
  Graph g=new Graph(description());
  idSpace.setPartitions(coords);
  g.addProperty("String_Node_Str",idSpace);
  Node[] nodes=Node.init(this.nodes(),g);
  connector.connect(nodes,idSpace);
  g.setNodes(nodes);
  return g;
}

Fixed version (ground truth):
/** 
 * Creates the graph for this network by first placing the hotspots, then placing the nodes within those hotspots. The coordinates of the nodes are stored in an <code>IdentifierSpace</code>, which is added as "id_space_0" to the attributes of the graph. In the end, the nodes are connected based on that id-space.
 */
@Override public Graph generate(){
  Point[] hotspotCoords=hotspotPlacer.place(hotspots);
  PlanePartitionSimple[] coords=new PlanePartitionSimple[nodes];
  int[] nodesPerSpot=partitioner.partition(nodes,hotspots);
  int temp=0;
  int curNodes;
  for (int i=0; i < hotspots; i++) {
    curNodes=nodesPerSpot[i];
    addNodeCoords(coords,nodePlacer.place(curNodes),hotspotCoords[i],temp);
    temp+=curNodes;
  }
  Graph g=new Graph(description());
  idSpace.setPartitions(coords);
  g.addProperty("String_Node_Str",idSpace);
  Node[] nodes=Node.init(this.nodes(),g);
  connector.connect(nodes,idSpace);
  g.setNodes(nodes);
  return g;
}
Program: 39851
Project: 39851
Buggy source:
/** 
 * @param pps
 * @param nodeCoords
 * @param ds
 */
private void addNodeCoords(PlanePartitionSimple[] pps,Point[] nodeCoords,Point coordOffset,int arrayOffset){
  for (int i=0; i < nodeCoords.length; i++) {
    pps[i + arrayOffset]=new PlanePartitionSimple(new PlaneIdentifier(nodeCoords[i].getX() + coordOffset.getX(),nodeCoords[i].getY() + coordOffset.getY(),idSpace));
  }
}

Fixed version (ground truth):
/** 
 * Convenience method to convert all the node coordinates from <code>Point</code> objects to <code>PlanePartitionSimple</code> objects. In the process, the supplied offset is added to all those coordinates. Instead of returning a newly created array, the <code>PlanePartitionSimple</code>s are stored in the supplied array, starting from the supplied offset. If the array is shorter than required, an Exception will be thrown.
 * @param pps The array to which the resulting <code>PlanePartitionSimple</code>s are to be written, starting at <code>arrayOffset</code>.
 * @param nodeCoords The coordinates at which nodes are to be placed.
 * @param coordOffset The offset for the coordinates.
 * @param arrayOffset The offset for the array, pointing to the first EMPTY element.
 */
private void addNodeCoords(PlanePartitionSimple[] pps,Point[] nodeCoords,Point coordOffset,int arrayOffset){
  for (int i=0; i < nodeCoords.length; i++) {
    pps[i + arrayOffset]=new PlanePartitionSimple(new PlaneIdentifier(nodeCoords[i].getX() + coordOffset.getX(),nodeCoords[i].getY() + coordOffset.getY(),idSpace));
  }
}
Program: 39852
Project: 39852
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: 39853
Project: 39853
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: 39854
Project: 39854
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: 39855
Project: 39855
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: 39856
Project: 39856
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: 39857
Project: 39857
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: 39858
Project: 39858
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: 39859
Project: 39859
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: 39860
Project: 39860
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: 39861
Project: 39861
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: 39862
Project: 39862
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: 39863
Project: 39863
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: 39864
Project: 39864
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: 39868
Project: 39868
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: 39869
Project: 39869
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: 39870
Project: 39870
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: 39872
Project: 39872
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: 39873
Project: 39873
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: 39874
Project: 39874
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: 39876
Project: 39876
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: 39878
Project: 39878
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: 39879
Project: 39879
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: 39881
Project: 39881
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: 39882
Project: 39882
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: 39883
Project: 39883
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: 39884
Project: 39884
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: 39885
Project: 39885
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: 39886
Project: 39886
Buggy source:
@Override public Partition<Double>[] getPartitions(){
  return this.partitions;
}

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

Fixed version (ground truth):
@Override public DPartition[] getPartitions(){
  return this.partitions;
}
Program: 39888
Project: 39888
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: 39889
Project: 39889
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: 39890
Project: 39890
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: 39891
Project: 39891
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: 39892
Project: 39892
Buggy source:
@Override public int compareTo(PlaneIdentifier o){
  return 0;
}

Fixed version (ground truth):
@Override public int compareTo(MDIdentifier o){
  return 0;
}
Program: 39893
Project: 39893
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: 39894
Project: 39894
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: 39895
Project: 39895
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: 39896
Project: 39896
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: 39897
Project: 39897
Buggy source:
@Override public int compareTo(PlaneIdentifier o){
  return 0;
}

Fixed version (ground truth):
@Override public int compareTo(MDIdentifier o){
  return 0;
}
Program: 39898
Project: 39898
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;
}
Program: 39899
Project: 39899
Buggy source:
public Edge[] generateEdgesBidirectional(){
  int index=0;
  Edge[] edges=new Edge[this.parent.length * 2 - 2];
  for (int i=0; i < this.parent.length; i++) {
    if (i != -1) {
      edges[index++]=new Edge(this.parent[i],i);
      edges[index++]=new Edge(i,this.parent[i]);
    }
  }
  return edges;
}

Fixed version (ground truth):
public Edge[] generateEdgesBidirectional(){
  int index=0;
  Edge[] edges=new Edge[this.parent.length * 2 - 2];
  for (int i=0; i < this.parent.length; i++) {
    if (this.parent[i] != -1) {
      edges[index++]=new Edge(this.parent[i],i);
      edges[index++]=new Edge(i,this.parent[i]);
    }
  }
  return edges;
}
Program: 39900
Project: 39900
Buggy source:
/** 
 * @param args
 */
public static void main(String[] args) throws Exception {
  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" + false);
  Network nw1=new ReadableFile("String_Node_Str","String_Node_Str","String_Node_Str",null,null);
  Network nw2=new ReadableFolder("String_Node_Str","String_Node_Str","String_Node_Str",null,null);
  Network nw3=new ReadableList("String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},null,null);
  Series s1=Series.generate(nw1,1);
  Series s2=Series.generate(nw2,10);
  Series s3=Series.generate(nw3,17);
  Plot.multiAvg(s1,"String_Node_Str");
  Network er=new ErdosRenyi(100,10,false,null,null);
  GraphWriter.write(er.generate(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param args
 */
public static void main(String[] args) throws Exception {
  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" + false);
  Network nw1=new ReadableFile("String_Node_Str","String_Node_Str","String_Node_Str",null,null);
  Network nw2=new ReadableFolder("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",null,null);
  Network nw3=new ReadableList("String_Node_Str","String_Node_Str",new String[]{"String_Node_Str","String_Node_Str"},null,null);
  Series s1=Series.generate(nw1,1);
  Series s2=Series.generate(nw2,10);
  Series s3=Series.generate(nw3,17);
  Plot.multiAvg(s1,"String_Node_Str");
  Network er=new ErdosRenyi(100,10,false,null,null);
  GraphWriter.write(er.generate(),"String_Node_Str");
}