nus-yam/ex-repair huggingface dataset:
Program: 39809
Project: 39809
Buggy source:
public ReadableFile(String name,String folder,String filename,Parameter[] parameters,Transformation[] t){
  super(ReadableFile.key(name,folder),GraphReader.nodes(filename),parameters,t);
  this.filename=filename;
}

Fixed version (ground truth):
public ReadableFile(String name,String folder,String filename,Parameter[] parameters,Transformation[] t){
  super(ReadableFile.key(name,folder),new GtnaGraphReader().nodes(filename),parameters,t);
  this.filename=filename;
}
Program: 39810
Project: 39810
Buggy source:
private static int getNodes(String srcFolder,String extension){
  File d=new File(srcFolder);
  if (!d.exists()) {
    return 0;
  }
  File[] f=d.listFiles();
  if (f.length == 0) {
    return 0;
  }
  int index=0;
  while (!f[index].getName().endsWith(extension)) {
    index++;
  }
  return GraphReader.nodes(f[index].getAbsolutePath());
}

Fixed version (ground truth):
private static int getNodes(String srcFolder,String extension){
  File d=new File(srcFolder);
  if (!d.exists()) {
    return 0;
  }
  File[] f=d.listFiles();
  if (f.length == 0) {
    return 0;
  }
  int index=0;
  while (!f[index].getName().endsWith(extension)) {
    index++;
  }
  return new GtnaGraphReader().nodes(f[index].getAbsolutePath());
}
Program: 39811
Project: 39811
Buggy source:
public Graph generate(){
  if (this.files.size() == 0) {
    return null;
  }
  this.index=(this.index + 1) % this.files.size();
  Graph graph=GraphReader.readWithProperties(this.files.get(this.index));
  graph.setName(this.getDescription());
  return graph;
}

Fixed version (ground truth):
public Graph generate(){
  if (this.files.size() == 0) {
    return null;
  }
  this.index=(this.index + 1) % this.files.size();
  Graph graph=new GtnaGraphReader().readWithProperties(this.files.get(this.index));
  graph.setName(this.getDescription());
  return graph;
}
Program: 39813
Project: 39813
Buggy source:
@Override public int toInt(){
switch (this.type) {
case COMMON:
    return 0;
case BRIDGE:
  return 1;
case STAR:
return 2;
case HUB_COMMON:
return 3;
case HUB_STAR:
return 4;
case HUB_BRIDGE:
return 5;
}
return -1;
}

Fixed version (ground truth):
@Override public int toInt(){
switch (this.type) {
case COMMON:
    return 0;
case BRIDGE:
  return 1;
case STAR:
return 2;
case HUB_COMMON:
return 3;
case HUB_BRIDGE:
return 4;
case HUB_STAR:
return 5;
}
return -1;
}
Program: 39814
Project: 39814
Buggy source:
@Override public void computeData(Graph g,Network n,HashMap<String,Metric> m){
  if (!applicable(g,n,m))   return;
  results=new int[n.getNodes()][Roles.Role.values().length];
  resultsR2=new int[n.getNodes()][Roles2.Role2.values().length];
  GraphProperty[] p=g.getProperties("String_Node_Str");
  countRoles=p.length;
  System.out.println("String_Node_Str" + p.length + "String_Node_Str");
  Roles r;
  for (  GraphProperty akt : p) {
    r=(Roles)akt;
    for (int i=0; i < n.getNodes(); i++) {
      results[i][r.getRoleOfNode(i).ordinal()]++;
    }
  }
  p=g.getProperties("String_Node_Str");
  countRoles2=p.length;
  Roles2 r2;
  for (  GraphProperty akt : p) {
    r2=(Roles2)akt;
    for (int i=0; i < n.getNodes(); i++) {
      resultsR2[i][r2.getRoleOfNode(i).ordinal()]++;
    }
  }
  erg=new TreeSet<MaxRolePercRole>();
  for (int i=0; i < results.length; i++) {
    erg.add(new MaxRolePercRole(results[i],countRoles,i));
  }
  erg2=new TreeSet<MaxRolePercRole2>();
  for (int i=0; i < results.length; i++) {
    erg2.add(new MaxRolePercRole2(resultsR2[i],countRoles2,i));
  }
}

Fixed version (ground truth):
@Override public void computeData(Graph g,Network n,HashMap<String,Metric> m){
  if (!applicable(g,n,m))   return;
  results=new int[n.getNodes()][Roles.Role.values().length];
  resultsR2=new int[n.getNodes()][Roles2.Role2.values().length];
  GraphProperty[] p=g.getProperties("String_Node_Str");
  countRoles=p.length;
  System.out.println("String_Node_Str" + p.length + "String_Node_Str");
  Roles r;
  for (  GraphProperty akt : p) {
    r=(Roles)akt;
    for (int i=0; i < g.getNodes().length; i++) {
      results[i][r.getRoleOfNode(i).ordinal()]++;
    }
  }
  p=g.getProperties("String_Node_Str");
  countRoles2=p.length;
  Roles2 r2;
  for (  GraphProperty akt : p) {
    r2=(Roles2)akt;
    for (int i=0; i < g.getNodes().length; i++) {
      resultsR2[i][r2.getRoleOfNode(i).ordinal()]++;
    }
  }
  erg=new TreeSet<MaxRolePercRole>();
  for (int i=0; i < results.length; i++) {
    erg.add(new MaxRolePercRole(results[i],countRoles,i));
  }
  erg2=new TreeSet<MaxRolePercRole2>();
  for (int i=0; i < results.length; i++) {
    erg2.add(new MaxRolePercRole2(resultsR2[i],countRoles2,i));
  }
}
Program: 39815
Project: 39815
Buggy source:
@Override public boolean writeData(String folder){
  System.out.println(folder);
  boolean ret=true;
  ret&=DataWriter.writeWithIndex(toValueArray(erg),getKey() + "String_Node_Str",folder);
  for (  Role akt : Roles.Role.values()) {
    System.out.println("String_Node_Str" + akt);
    System.out.println("String_Node_Str" + erg.size());
    System.out.println("String_Node_Str" + filter(erg,akt).size());
    System.out.println("String_Node_Str" + toValueArray(filter(erg,akt)).length);
    for (int i=0; i < toValueArray(filter(erg,akt)).length; i++)     System.out.println(i + "String_Node_Str" + toValueArray(filter(erg,akt))[i]);
    ret&=DataWriter.writeWithIndex(toValueArray(filter(erg,akt)),getKey() + "String_Node_Str" + akt.name(),folder);
  }
  ret&=DataWriter.writeWithIndex(calcAverages(erg),getKey() + "String_Node_Str",folder);
  ret&=DataWriter.writeWithIndex(toValueArray2(erg2),getKey() + "String_Node_Str",folder);
  for (  Role2 akt : Roles2.Role2.values())   ret&=DataWriter.writeWithIndex(toValueArray2(filter2(erg2,akt)),getKey() + "String_Node_Str" + akt.name(),folder);
  ret&=DataWriter.writeWithIndex(calcAverages2(erg2),getKey() + "String_Node_Str",folder);
  return ret;
}

Fixed version (ground truth):
@Override public boolean writeData(String folder){
  boolean ret=true;
  ret&=DataWriter.writeWithIndex(toValueArray(erg),getKey() + "String_Node_Str",folder);
  for (  Role akt : Roles.Role.values()) {
    System.out.println("String_Node_Str" + akt);
    System.out.println("String_Node_Str" + erg.size());
    System.out.println("String_Node_Str" + filter(erg,akt).size());
    System.out.println("String_Node_Str" + toValueArray(filter(erg,akt)).length);
    for (int i=0; i < toValueArray(filter(erg,akt)).length; i++)     System.out.println(i + "String_Node_Str" + toValueArray(filter(erg,akt))[i]);
    ret&=DataWriter.writeWithIndex(toValueArray(filter(erg,akt)),getKey() + "String_Node_Str" + akt.name(),folder);
  }
  ret&=DataWriter.writeWithIndex(calcAverages(erg),getKey() + "String_Node_Str",folder);
  ret&=DataWriter.writeWithIndex(toValueArray2(erg2),getKey() + "String_Node_Str",folder);
  for (  Role2 akt : Roles2.Role2.values())   ret&=DataWriter.writeWithIndex(toValueArray2(filter2(erg2,akt)),getKey() + "String_Node_Str" + akt.name(),folder);
  ret&=DataWriter.writeWithIndex(calcAverages2(erg2),getKey() + "String_Node_Str",folder);
  return ret;
}
Program: 39816
Project: 39816
Buggy source:
/** 
 * @param node
 * @param communities
 * @return participation coefficient z
 */
private double getParticipationCoefficient(Node node,Communities communities){
  HashMap<Community,Integer> counter=new HashMap<Community,Integer>();
  for (  int dst : node.getOutgoingEdges()) {
    Community community=communities.getCommunityOfNode(dst);
    int count=counter.containsKey(community) ? counter.get(community) + 1 : 1;
    counter.put(community,count);
  }
  double psum=0;
  for (  Community community : counter.keySet()) {
    psum+=Math.pow(counter.get(community) / node.getOutDegree(),2);
  }
  return 1.0 - psum;
}

Fixed version (ground truth):
/** 
 * @param node
 * @param communities
 * @return participation coefficient z
 */
private double getParticipationCoefficient(Node node,Communities communities){
  HashMap<Community,Integer> counter=new HashMap<Community,Integer>();
  for (  int dst : node.getOutgoingEdges()) {
    Community community=communities.getCommunityOfNode(dst);
    int count=counter.containsKey(community) ? counter.get(community) + 1 : 1;
    counter.put(community,count);
  }
  double psum=0;
  for (  Community community : counter.keySet()) {
    psum+=Math.pow((double)counter.get(community) / (double)node.getOutDegree(),2);
  }
  return 1.0 - psum;
}
Program: 39817
Project: 39817
Buggy source:
/** 
 * add a node to the subgraph and change inDegree accordingly
 * @param added
 * @param degree
 * @param n
 * @param inDegree
 * @param nodes
 * @return
 */
private Vector<Integer> addNode(boolean[] added,int[] degree,Node n,Vector<Vector<Integer>> inDegree,Node[] nodes){
  int[] out=n.getIncomingEdges();
  Vector<Integer> neighbors=new Vector<Integer>();
  added[n.getIndex()]=true;
  for (int i=0; i < out.length; i++) {
    if (added[out[i]] && degree[out[i]] < this.maxDegree && neighbors.size() < this.maxDegree) {
      neighbors.add(out[i]);
      degree[out[i]]++;
      if (degree[out[i]] == this.maxDegree) {
        int[] o=nodes[out[i]].getOutgoingEdges();
        for (int k=0; k < o.length; k++) {
          if (!added[o[k]] && degree[o[k]] > 0) {
            inDegree.get(degree[o[k]]).removeElement(o[k]);
            degree[o[k]]--;
            if (degree[o[k]] > 0)             inDegree.get(degree[o[k]]).add(o[k]);
          }
        }
      }
    }
    if (!added[out[i]] && degree[out[i]] < this.maxDegree && degree[out[i]] > 0) {
      inDegree.get(degree[out[i]]).removeElement(out[i]);
      degree[out[i]]++;
      inDegree.get(degree[out[i]]).add(out[i]);
    }
  }
  return neighbors;
}

Fixed version (ground truth):
/** 
 * add a node to the subgraph and change inDegree accordingly
 * @param added
 * @param degree
 * @param n
 * @param inDegree
 * @param nodes
 * @return
 */
private Vector<Integer> addNode(boolean[] added,int[] degree,Node n,Vector<Vector<Integer>> inDegree,Node[] nodes){
  int[] out=n.getIncomingEdges();
  Vector<Integer> neighbors=new Vector<Integer>();
  added[n.getIndex()]=true;
  for (int i=0; i < out.length; i++) {
    if (added[out[i]] && degree[out[i]] < this.maxDegree && neighbors.size() < this.maxDegree) {
      neighbors.add(out[i]);
      degree[out[i]]++;
      if (degree[out[i]] == this.maxDegree) {
        int[] o=nodes[out[i]].getOutgoingEdges();
        for (int k=0; k < o.length; k++) {
          if (!added[o[k]] && degree[o[k]] > 0) {
            inDegree.get(degree[o[k]]).removeElement(o[k]);
            degree[o[k]]--;
            if (degree[o[k]] > 0)             inDegree.get(degree[o[k]]).add(o[k]);
          }
        }
      }
    }
    if (!added[out[i]] && degree[out[i]] < this.maxDegree) {
      inDegree.get(degree[out[i]]).removeElement(out[i]);
      degree[out[i]]++;
      inDegree.get(degree[out[i]]).add(out[i]);
    }
  }
  return neighbors;
}
Program: 39819
Project: 39819
Buggy source:
/** 
 * @param include: nodes that are MAXIMALLY included in subgraph
 * @param minDegree: minimum number of links a node has to have to nodes that are already included in the subgraph to be added
 * @param maxDegree: maximum degree a node in the subgraph is allowed to have
 * @param startNodes: size of the initial clique
 * @param selection: selection of the initial clique:a) RANDOM: choose a clique randomly from all cliques in the graph b) OUTDEGREE: choose the clique for which the number of outgoing links is highest
 */
public BuildSubGraphMax(int include,int minDegree,int maxDegree,int startNodes,String selection){
  super("String_Node_Str",new Parameter[]{new IntParameter("String_Node_Str",include),new IntParameter("String_Node_Str",minDegree),new IntParameter("String_Node_Str",maxDegree),new IntParameter("String_Node_Str",startNodes),new StringParameter("String_Node_Str",selection)});
  this.selection=selection;
  this.minDegree=Math.max(minDegree,1);
  this.maxDegree=maxDegree;
  this.include=include;
  this.startNodes=startNodes;
}

Fixed version (ground truth):
/** 
 * @param include: nodes that are MAXIMALLY included in subgraph
 * @param minDegree: minimum number of links a node has to have to nodes that are already included in the subgraph to be added
 * @param maxDegree: maximum degree a node in the subgraph is allowed to have
 * @param startNodes: size of the initial clique
 * @param selection: selection of the initial clique:a) RANDOM: choose a clique randomly from all cliques in the graph b) OUTDEGREE: choose the clique for which the number of outgoing links is highest
 */
public BuildSubGraphMax(int include,int minDegree,int maxDegree,int startNodes,String selection){
  super("String_Node_Str",new Parameter[]{new IntParameter("String_Node_Str",include),new IntParameter("String_Node_Str",minDegree),new IntParameter("String_Node_Str",maxDegree),new IntParameter("String_Node_Str",startNodes),new StringParameter("String_Node_Str",selection)});
  this.selection=selection;
  this.minDegree=Math.max(minDegree,1);
  this.maxDegree=maxDegree;
  this.include=include;
  this.startNodes=startNodes;
  if (maxDegree < startNodes - 1 || minDegree > maxDegree) {
    throw new IllegalArgumentException("String_Node_Str" + maxDegree);
  }
}
Program: 39821
Project: 39821
Buggy source:
private Graph generateDirected(){
  int[] sequenceIn=new int[this.getNodes()];
  int[] sequenceOut=new int[this.getNodes()];
  Random rand=new Random(System.currentTimeMillis());
  int sumIn=0, sumOut=0;
  int k=0;
  for (int i=0; i < sequenceIn.length; i++) {
    double bound=rand.nextDouble();
    k=0;
    while (this.cdfIn[k] < bound) {
      k++;
    }
    sequenceIn[i]=k;
    sumIn=sumIn + k;
    bound=rand.nextDouble();
    k=0;
    while (this.cdfOut[k] < bound) {
      k++;
    }
    sequenceOut[i]=k;
    sumOut=sumOut + k;
  }
  while (sumOut > sumIn) {
    boolean out=rand.nextBoolean();
    if (out) {
      int c=rand.nextInt(sequenceIn.length);
      while (sequenceOut[c] < 2) {
        c=rand.nextInt(sequenceIn.length);
      }
      sequenceOut[c]--;
    }
 else {
      int c=rand.nextInt(sequenceIn.length);
      while (sequenceIn[c] >= cdfIn.length - 1) {
        c=rand.nextInt(sequenceIn.length);
      }
      sequenceIn[c]++;
    }
  }
  while (sumOut < sumIn) {
    boolean out=rand.nextBoolean();
    if (out) {
      int c=rand.nextInt(sequenceIn.length);
      while (sequenceOut[c] >= cdfOut.length) {
        c=rand.nextInt(sequenceIn.length);
      }
      sequenceOut[c]++;
    }
 else {
      int c=rand.nextInt(sequenceIn.length);
      while (sequenceIn[c] < 2) {
        c=rand.nextInt(sequenceIn.length);
      }
      sequenceIn[c]--;
    }
  }
  return (new ArbitraryDegreeSequence(this.getNodes(),this.getName(),sequenceIn,sequenceOut,null)).generate();
}

Fixed version (ground truth):
private Graph generateDirected(){
  int[] sequenceIn=new int[this.getNodes()];
  int[] sequenceOut=new int[this.getNodes()];
  Random rand=new Random(System.currentTimeMillis());
  int sumIn=0, sumOut=0;
  int k=0;
  for (int i=0; i < sequenceIn.length; i++) {
    double bound=rand.nextDouble();
    k=0;
    while (this.cdfIn[k] < bound) {
      k++;
    }
    sequenceIn[i]=k;
    sumIn=sumIn + k;
    bound=rand.nextDouble();
    k=0;
    while (this.cdfOut[k] < bound) {
      k++;
    }
    sequenceOut[i]=k;
    sumOut=sumOut + k;
  }
  while (sumOut > sumIn) {
    boolean out=rand.nextBoolean();
    if (out) {
      int c=rand.nextInt(sequenceIn.length);
      while (sequenceOut[c] < 2) {
        c=rand.nextInt(sequenceIn.length);
      }
      sequenceOut[c]--;
      sumOut--;
    }
 else {
      int c=rand.nextInt(sequenceIn.length);
      while (sequenceIn[c] >= cdfIn.length - 1) {
        c=rand.nextInt(sequenceIn.length);
      }
      sequenceIn[c]++;
      sumIn++;
    }
  }
  while (sumOut < sumIn) {
    boolean out=rand.nextBoolean();
    if (out) {
      int c=rand.nextInt(sequenceIn.length);
      while (sequenceOut[c] >= cdfOut.length) {
        c=rand.nextInt(sequenceIn.length);
      }
      sequenceOut[c]++;
      sumOut++;
    }
 else {
      int c=rand.nextInt(sequenceIn.length);
      while (sequenceIn[c] < 2) {
        c=rand.nextInt(sequenceIn.length);
      }
      sequenceIn[c]--;
      sumIn--;
    }
  }
  return (new ArbitraryDegreeSequence(this.getNodes(),this.getName(),sequenceIn,sequenceOut,null)).generate();
}
Program: 39822
Project: 39822
Buggy source:
private Graph generateDirected(){
  Graph graph=new Graph(this.getDescription());
  Random rand=new Random(System.currentTimeMillis());
  Node[] nodes=Node.init(this.getNodes(),graph);
  int sum=0;
  for (int j=0; j < this.sequenceIn.length; j++) {
    sum=sum + this.sequenceIn[j];
  }
  Edges edges=new Edges(nodes,sum);
  Vector<Integer> stubsOut=new Vector<Integer>(sum);
  Vector<Integer> stubsIn=new Vector<Integer>(sum);
  for (int i=0; i < this.sequenceOut.length; i++) {
    for (int j=0; j < this.sequenceOut[i]; j++) {
      stubsOut.add(i);
    }
    for (int j=0; j < this.sequenceIn[i]; j++) {
      stubsIn.add(i);
    }
  }
  if (stubsIn.size() != stubsOut.size()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int src, dst;
  while (stubsIn.size() > 0 && stubsOut.size() > 0) {
    src=stubsOut.remove(stubsOut.size() - 1);
    dst=stubsIn.remove(rand.nextInt(stubsIn.size()));
    edges.add(src,dst);
  }
  graph.setNodes(nodes);
  return graph;
}

Fixed version (ground truth):
private Graph generateDirected(){
  Graph graph=new Graph(this.getDescription());
  Random rand=new Random(System.currentTimeMillis());
  Node[] nodes=Node.init(this.getNodes(),graph);
  int sum=0;
  for (int j=0; j < this.sequenceIn.length; j++) {
    sum=sum + this.sequenceIn[j];
  }
  Edges edges=new Edges(nodes,sum);
  Vector<Integer> stubsOut=new Vector<Integer>(sum);
  Vector<Integer> stubsIn=new Vector<Integer>(sum);
  for (int i=0; i < this.sequenceOut.length; i++) {
    for (int j=0; j < this.sequenceOut[i]; j++) {
      stubsOut.add(i);
    }
    for (int j=0; j < this.sequenceIn[i]; j++) {
      stubsIn.add(i);
    }
  }
  if (stubsIn.size() != stubsOut.size()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  int src, dst;
  while (stubsIn.size() > 0 && stubsOut.size() > 0) {
    src=stubsOut.remove(stubsOut.size() - 1);
    dst=stubsIn.remove(rand.nextInt(stubsIn.size()));
    edges.add(src,dst);
  }
  edges.fill();
  graph.setNodes(nodes);
  return graph;
}
Program: 39823
Project: 39823
Buggy source:
public PowerLawRandomGraph(int nodes,double alphaOut,double alphaIn,int minDegreeOut,int minDegreeIn,int maxDegreeOut,int maxDegreeIn,Transformation[] t,boolean directed){
  super("String_Node_Str",nodes,new Parameter[]{new StringParameter("String_Node_Str","String_Node_Str" + alphaOut + "String_Node_Str"+ alphaIn+ "String_Node_Str"),new StringParameter("String_Node_Str","String_Node_Str" + minDegreeOut + "String_Node_Str"+ minDegreeIn+ "String_Node_Str"),new StringParameter("String_Node_Str","String_Node_Str" + maxDegreeOut + "String_Node_Str"+ maxDegreeIn+ "String_Node_Str"),new BooleanParameter("String_Node_Str",directed)},t);
  this.alpha=new double[]{alphaOut,alphaIn};
  this.max=new int[]{maxDegreeOut,maxDegreeOut};
  this.min=new int[]{minDegreeIn,minDegreeIn};
  this.directed=directed;
}

Fixed version (ground truth):
public PowerLawRandomGraph(int nodes,double alphaOut,double alphaIn,int minDegreeOut,int minDegreeIn,int maxDegreeOut,int maxDegreeIn,Transformation[] t){
  super("String_Node_Str",nodes,new Parameter[]{new StringParameter("String_Node_Str","String_Node_Str" + alphaOut + "String_Node_Str"+ alphaIn+ "String_Node_Str"),new StringParameter("String_Node_Str","String_Node_Str" + minDegreeOut + "String_Node_Str"+ minDegreeIn+ "String_Node_Str"),new StringParameter("String_Node_Str","String_Node_Str" + maxDegreeOut + "String_Node_Str"+ maxDegreeIn+ "String_Node_Str"),new BooleanParameter("String_Node_Str",true)},t);
  this.alpha=new double[]{alphaOut,alphaIn};
  this.max=new int[]{maxDegreeOut,maxDegreeOut};
  this.min=new int[]{minDegreeIn,minDegreeIn};
  this.directed=true;
}
Program: 39824
Project: 39824
Buggy source:
public static String key(String name,String folder){
  Config.overwrite("String_Node_Str" + folder + "String_Node_Str",name);
  Config.overwrite("String_Node_Str" + folder + "String_Node_Str",folder);
  return "String_Node_Str" + folder;
}

Fixed version (ground truth):
public static String key(String name,String folder){
  Config.overwrite("String_Node_Str" + folder + "String_Node_Str",name);
  Config.overwrite("String_Node_Str" + folder + "String_Node_Str",name);
  Config.overwrite("String_Node_Str" + folder + "String_Node_Str",name);
  Config.overwrite("String_Node_Str" + folder + "String_Node_Str",folder);
  return "String_Node_Str" + folder;
}
Program: 39825
Project: 39825
Buggy source:
public static String key(String name,String folder){
  Config.overwrite("String_Node_Str" + folder + "String_Node_Str",name);
  Config.overwrite("String_Node_Str" + folder + "String_Node_Str",folder);
  return "String_Node_Str" + folder;
}

Fixed version (ground truth):
public static String key(String name,String folder){
  Config.overwrite("String_Node_Str" + folder + "String_Node_Str",name);
  Config.overwrite("String_Node_Str" + folder + "String_Node_Str",name);
  Config.overwrite("String_Node_Str" + folder + "String_Node_Str",name);
  Config.overwrite("String_Node_Str" + folder + "String_Node_Str",folder);
  return "String_Node_Str" + folder;
}
Program: 39826
Project: 39826
Buggy source:
public static String key(String name,String folder){
  Config.overwrite("String_Node_Str" + folder + "String_Node_Str",name);
  Config.overwrite("String_Node_Str" + folder + "String_Node_Str",folder);
  return "String_Node_Str" + folder;
}

Fixed version (ground truth):
public static String key(String name,String folder){
  Config.overwrite("String_Node_Str" + folder + "String_Node_Str",name);
  Config.overwrite("String_Node_Str" + folder + "String_Node_Str",name);
  Config.overwrite("String_Node_Str" + folder + "String_Node_Str",name);
  Config.overwrite("String_Node_Str" + folder + "String_Node_Str",folder);
  return "String_Node_Str" + folder;
}
Program: 39827
Project: 39827
Buggy source:
public Network(String key,int nodes,Parameter[] parameters,Transformation[] transformations){
  super(key,Network.add(parameters,nodes));
  this.nodes=nodes;
  this.transformations=transformations;
}

Fixed version (ground truth):
public Network(String key,int nodes,Parameter[] parameters,Transformation[] transformations){
  super(key,Network.add(parameters,nodes));
  this.nodes=nodes;
  this.transformations=transformations;
  if (this.transformations == null) {
    this.transformations=new Transformation[0];
  }
}
Program: 39828
Project: 39828
Buggy source:
/** 
 * Places the nodes uniformly in the field.
 */
@Override public Point[] place(int count,Point center,double maxX,double maxY){
  Random rnd=new Random();
  double dx=0;
  double dy=0;
  int i=0;
  Point[] ret=new Point[count];
  if (getInCenter()) {
    ret[0]=new Point(center.getX(),center.getY());
    i++;
  }
  int tries;
  while (i < count) {
    tries=0;
    do {
      dx=center.getX() + width * (rnd.nextDouble());
      dy=center.getY() + height * (rnd.nextDouble());
      tries++;
    }
 while ((dx < 0 || dx > maxX || dy < 0 || dy > maxY) && tries <= maxTries);
    if ((dx < 0 || dx > maxX || dy < 0 || dy > maxY))     throw new PlacementNotPossibleException("String_Node_Str" + i + "String_Node_Str"+ width+ "String_Node_Str"+ height+ "String_Node_Str"+ count+ "String_Node_Str"+ getInCenter());
    ret[i]=new Point(dx,dy);
    i++;
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Places the nodes uniformly in the field.
 */
@Override public Point[] place(int count,Point center,double maxX,double maxY){
  Random rnd=new Random();
  double dx=0;
  double dy=0;
  int i=0;
  Point[] ret=new Point[count];
  if (getInCenter()) {
    ret[0]=new Point(center.getX(),center.getY());
    i++;
  }
  int tries;
  while (i < count) {
    tries=0;
    do {
      double x=(this.width / 2.0) * (rnd.nextBoolean() ? 1.0 : -1.0);
      double y=(this.width / 2.0) * (rnd.nextBoolean() ? 1.0 : -1.0);
      dx=center.getX() + x * (rnd.nextDouble());
      dy=center.getY() + y * (rnd.nextDouble());
      tries++;
    }
 while ((dx < 0 || dx > maxX || dy < 0 || dy > maxY) && tries <= maxTries);
    if ((dx < 0 || dx > maxX || dy < 0 || dy > maxY))     throw new PlacementNotPossibleException("String_Node_Str" + i + "String_Node_Str"+ width+ "String_Node_Str"+ height+ "String_Node_Str"+ count+ "String_Node_Str"+ getInCenter());
    ret[i]=new Point(dx,dy);
    i++;
  }
  return ret;
}
Program: 39829
Project: 39829
Buggy source:
private double calculateModularity(Graph g,gtna.communities.Communities communities){
  double E=0;
  for (  Community c : communities.getCommunities()) {
    for (    int aktNode : c.getNodes()) {
      E+=g.getNode(aktNode).getOutDegree();
    }
  }
  double Q=0;
  for (  Community c : communities.getCommunities()) {
    double IC=0;
    double OC=0;
    for (    int src : c.getNodes()) {
      for (      int dst : g.getNode(src).getOutgoingEdges()) {
        if (communities.getCommunityOfNode(dst) == c) {
          IC++;
        }
 else {
          OC++;
        }
      }
    }
    Q+=IC / E - Math.pow((2 * IC + OC) / (2 * E),2);
  }
  return Q;
}

Fixed version (ground truth):
private double calculateModularity(Graph g,gtna.communities.Communities communities){
  double E=g.getEdges().size();
  double Q=0;
  for (  Community c : communities.getCommunities()) {
    double IC=0;
    double OC=0;
    for (    int node : c.getNodes()) {
      for (      int out : g.getNode(node).getOutgoingEdges()) {
        if (communities.getCommunityOfNode(out).getIndex() == c.getIndex()) {
          IC++;
        }
 else {
          OC++;
        }
      }
      for (      int in : g.getNode(node).getIncomingEdges()) {
        if (communities.getCommunityOfNode(in).getIndex() != c.getIndex()) {
          OC++;
        }
      }
    }
    Q+=IC / E - Math.pow((IC + OC) / E,2);
  }
  return Q;
}
Program: 39831
Project: 39831
Buggy source:
/** 
 * Places the nodes uniformly in the field.
 */
@Override public Point[] place(int count,Point center,double maxX,double maxY){
  Random rnd=new Random();
  double dx=0;
  double dy=0;
  int i=0;
  Point[] ret=new Point[count];
  if (getInCenter()) {
    ret[0]=new Point(center.getX(),center.getY());
    i++;
  }
  int tries;
  while (i < count) {
    tries=0;
    do {
      double x=(this.width / 2.0) * (rnd.nextBoolean() ? 1.0 : -1.0);
      double y=(this.width / 2.0) * (rnd.nextBoolean() ? 1.0 : -1.0);
      dx=center.getX() + x * (rnd.nextDouble());
      dy=center.getY() + y * (rnd.nextDouble());
      tries++;
    }
 while ((dx < 0 || dx > maxX || dy < 0 || dy > maxY) && tries <= maxTries);
    if ((dx < 0 || dx > maxX || dy < 0 || dy > maxY))     throw new PlacementNotPossibleException("String_Node_Str" + i + "String_Node_Str"+ width+ "String_Node_Str"+ height+ "String_Node_Str"+ count+ "String_Node_Str"+ getInCenter());
    ret[i]=new Point(dx,dy);
    i++;
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Places the nodes uniformly in the field.
 */
@Override public Point[] place(int count,Point center,double maxX,double maxY){
  Random rnd=new Random();
  double dx=0;
  double dy=0;
  int i=0;
  Point[] ret=new Point[count];
  if (getInCenter()) {
    ret[0]=new Point(center.getX(),center.getY());
    i++;
  }
  int tries;
  while (i < count) {
    tries=0;
    do {
      double x=(this.width / 2.0) * (rnd.nextBoolean() ? 1.0 : -1.0);
      double y=(this.height / 2.0) * (rnd.nextBoolean() ? 1.0 : -1.0);
      dx=center.getX() + x * (rnd.nextDouble());
      dy=center.getY() + y * (rnd.nextDouble());
      tries++;
    }
 while ((dx < 0 || dx > maxX || dy < 0 || dy > maxY) && tries <= maxTries);
    if ((dx < 0 || dx > maxX || dy < 0 || dy > maxY))     throw new PlacementNotPossibleException("String_Node_Str" + i + "String_Node_Str"+ width+ "String_Node_Str"+ height+ "String_Node_Str"+ count+ "String_Node_Str"+ getInCenter());
    ret[i]=new Point(dx,dy);
    i++;
  }
  return ret;
}
Program: 39832
Project: 39832
Buggy source:
public static void main(String[] args){
  Stats stats=new Stats();
  boolean deltaQ=true;
  boolean lpa=true;
  boolean random=true;
  boolean community=true;
  int[] Nodes=new int[]{3000};
  int times=10;
  for (  int nodes : Nodes) {
    if (random) {
      Network nw=CommunityDetection.random(nodes);
      CommunityDetection.plot(nw,"String_Node_Str" + nodes,times,false,lpa);
      CommunityDetection.plot(nw,"String_Node_Str" + nodes,times,deltaQ,false);
    }
    if (community) {
      Network nw=CommunityDetection.community(nodes);
      CommunityDetection.plot(nw,"String_Node_Str" + nodes,times,false,lpa);
      CommunityDetection.plot(nw,"String_Node_Str" + nodes,times,deltaQ,false);
    }
  }
  stats.end();
}

Fixed version (ground truth):
public static void main(String[] args){
  Stats stats=new Stats();
  boolean deltaQ=true;
  boolean lpa=true;
  boolean random=true;
  boolean community=false;
  boolean communityNew=false;
  int[] Nodes=new int[]{2000};
  int times=5;
  for (  int nodes : Nodes) {
    if (random) {
      Network nw=CommunityDetection.random(nodes);
      CommunityDetection.plot(nw,"String_Node_Str" + nodes,times,false,lpa);
      CommunityDetection.plot(nw,"String_Node_Str" + nodes,times,deltaQ,false);
    }
    if (community) {
      Network nw=CommunityDetection.community(nodes);
      CommunityDetection.plot(nw,"String_Node_Str" + nodes,times,false,lpa);
      CommunityDetection.plot(nw,"String_Node_Str" + nodes,times,deltaQ,false);
    }
    if (communityNew) {
      Network nw=CommunityDetection.communityNew(nodes);
      CommunityDetection.plot(nw,"String_Node_Str" + nodes,times,false,lpa);
      CommunityDetection.plot(nw,"String_Node_Str" + nodes,times,deltaQ,false);
    }
  }
  stats.end();
}
Program: 39833
Project: 39833
Buggy source:
@Override public int getNextD(int current,DIdentifier target,Random rand,Node[] nodes){
  double currentDist=this.idSpaceD.getPartitions()[current].distance(target);
  double minDist=this.idSpaceD.getMaxDistance();
  int minNode=-1;
  for (  int out : nodes[current].getOutgoingEdges()) {
    double dist=this.pD[out].distance(target);
    if (dist < minDist && !done[out]) {
      minDist=dist;
      minNode=out;
    }
  }
  if (minNode == -1 && from.containsKey(current)) {
    return from.get(current);
  }
  if (minNode == -1) {
    return minNode;
  }
  if (!from.containsKey(minNode)) {
    from.put(minNode,current);
  }
  if (minDist >= currentDist) {
    done[current]=true;
  }
  return minNode;
}

Fixed version (ground truth):
@Override public int getNextD(int current,DIdentifier target,Random rand,Node[] nodes){
  double currentDist=this.idSpaceD.getPartitions()[current].distance(target);
  double minDist=this.idSpaceD.getMaxDistance();
  int minNode=-1;
  for (  int out : nodes[current].getOutgoingEdges()) {
    double dist=this.pD[out].distance(target);
    if (dist < minDist && !done[out]) {
      minDist=dist;
      minNode=out;
    }
  }
  if (minNode == -1 && from.containsKey(current)) {
    done[current]=true;
    return from.get(current);
  }
  if (minNode == -1) {
    return minNode;
  }
  if (!from.containsKey(minNode)) {
    from.put(minNode,current);
  }
  if (minDist >= currentDist) {
    done[current]=true;
  }
  return minNode;
}
Program: 39834
Project: 39834
Buggy source:
@Override public int getNextD(int current,DIdentifier target,Random rand,Node[] nodes){
  double currentDist=this.idSpaceD.getPartitions()[current].distance(target);
  double minDist=this.idSpaceD.getMaxDistance();
  int minNode=-1;
  for (  int out : nodes[current].getOutgoingEdges()) {
    double dist=this.pD[out].distance(target);
    if (dist < minDist && !done[out]) {
      minDist=dist;
      minNode=out;
    }
  }
  if (minNode == -1 && from.containsKey(current)) {
    done[current]=true;
    return from.get(current);
  }
  if (minNode == -1) {
    return minNode;
  }
  if (!from.containsKey(minNode)) {
    from.put(minNode,current);
  }
  if (minDist >= currentDist) {
    done[current]=true;
  }
  return minNode;
}

Fixed version (ground truth):
@Override public int getNextD(int current,DIdentifier target,Random rand,Node[] nodes){
  if (!from.containsKey(current)) {
    from.put(current,-1);
  }
  double currentDist=this.idSpaceD.getPartitions()[current].distance(target);
  double minDist=this.idSpaceD.getMaxDistance();
  int minNode=-1;
  for (  int out : nodes[current].getOutgoingEdges()) {
    double dist=this.pD[out].distance(target);
    if (dist < minDist && !done[out]) {
      minDist=dist;
      minNode=out;
    }
  }
  if (minNode == -1 && from.containsKey(current)) {
    done[current]=true;
    return from.get(current);
  }
  if (minNode == -1) {
    return minNode;
  }
  if (!from.containsKey(minNode)) {
    from.put(minNode,current);
  }
  if (minDist >= currentDist) {
    done[current]=true;
  }
  return minNode;
}
Program: 39835
Project: 39835
Buggy source:
public String compareValue(Network nw){
  for (int i=0; i < this.configValues.length; i++) {
    if (!this.configValues[i].equals(nw.configValues()[i])) {
      return this.configValues[i];
    }
  }
  if (this.nodes != nw.nodes()) {
    return "String_Node_Str" + this.nodes;
  }
  if (this.ra != null && nw.routingAlgorithm() != null) {
    String compared=this.ra.compareValue(nw.routingAlgorithm());
    if (!compared.equals(Config.get("String_Node_Str"))) {
      return compared;
    }
  }
  for (int i=0; i < Math.min(this.t.length,nw.transformations().length); i++) {
    String compared=this.t[i].compareValue(nw.transformations()[i]);
    if (!compared.equals(Config.get("String_Node_Str"))) {
      return compared;
    }
  }
  return Config.get("String_Node_Str");
}

Fixed version (ground truth):
public String compareValue(Network nw){
  if (this.configValues.length != nw.configValues().length) {
    return "String_Node_Str";
  }
  for (int i=0; i < this.configValues.length; i++) {
    if (!this.configValues[i].equals(nw.configValues()[i])) {
      return this.configValues[i];
    }
  }
  if (this.nodes != nw.nodes()) {
    return "String_Node_Str" + this.nodes;
  }
  if (this.ra != null && nw.routingAlgorithm() != null) {
    String compared=this.ra.compareValue(nw.routingAlgorithm());
    if (!compared.equals(Config.get("String_Node_Str"))) {
      return compared;
    }
  }
  for (int i=0; i < Math.min(this.t.length,nw.transformations().length); i++) {
    String compared=this.t[i].compareValue(nw.transformations()[i]);
    if (!compared.equals(Config.get("String_Node_Str"))) {
      return compared;
    }
  }
  return Config.get("String_Node_Str");
}
Program: 39836
Project: 39836
Buggy source:
public String compareName(Network nw,String key){
  for (int i=0; i < this.configValues.length; i++) {
    if (!this.configValues[i].equals(nw.configValues()[i])) {
      return Config.get(this.key + "String_Node_Str" + this.configKeys[i]+ "String_Node_Str"+ key);
    }
  }
  if (this.nodes != nw.nodes()) {
    return Config.get("String_Node_Str" + key);
  }
  if (this.ra != null && nw.routingAlgorithm() != null) {
    String compared=this.ra.compareName(nw.routingAlgorithm(),key);
    if (!compared.equals(Config.get("String_Node_Str"))) {
      return compared;
    }
  }
  for (int i=0; i < Math.min(this.t.length,nw.transformations().length); i++) {
    String compared=this.t[i].compareName(nw.transformations()[i],key);
    if (!compared.equals(Config.get("String_Node_Str"))) {
      return compared;
    }
  }
  return Config.get("String_Node_Str");
}

Fixed version (ground truth):
public String compareName(Network nw,String key){
  if (this.configValues.length != nw.configValues().length) {
    return "String_Node_Str";
  }
  for (int i=0; i < this.configValues.length; i++) {
    if (!this.configValues[i].equals(nw.configValues()[i])) {
      return Config.get(this.key + "String_Node_Str" + this.configKeys[i]+ "String_Node_Str"+ key);
    }
  }
  if (this.nodes != nw.nodes()) {
    return Config.get("String_Node_Str" + key);
  }
  if (this.ra != null && nw.routingAlgorithm() != null) {
    String compared=this.ra.compareName(nw.routingAlgorithm(),key);
    if (!compared.equals(Config.get("String_Node_Str"))) {
      return compared;
    }
  }
  for (int i=0; i < Math.min(this.t.length,nw.transformations().length); i++) {
    String compared=this.t[i].compareName(nw.transformations()[i],key);
    if (!compared.equals(Config.get("String_Node_Str"))) {
      return compared;
    }
  }
  return Config.get("String_Node_Str");
}
Program: 39837
Project: 39837
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: 39838
Project: 39838
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: 39839
Project: 39839
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: 39840
Project: 39840
Buggy source:
/** 
 * @return
 */
public String[] getConfigKeys();

Fixed version (ground truth):
/** 
 * Getter for all the configuration keys.
 * @return A string array containing all the configuration values.
 */
public String[] getConfigKeys();
Program: 39841
Project: 39841
Buggy source:
/** 
 * @return
 */
public String getKey();

Fixed version (ground truth):
/** 
 * Getter for the key of the particular placement model.
 * @return The key of the placement model.
 */
public String getKey();
Program: 39842
Project: 39842
Buggy source:
/** 
 * @return
 */
public double getHeight();

Fixed version (ground truth):
/** 
 * Getter for the height of the field in which the positions are to be determined.
 * @return The height of the field.
 */
public double getHeight();
Program: 39843
Project: 39843
Buggy source:
/** 
 * @return
 */
public String[] getConfigValues();

Fixed version (ground truth):
/** 
 * Getter for all the configuration values.
 * @return A string array containing all the configuration values.
 */
public String[] getConfigValues();
Program: 39844
Project: 39844
Buggy source:
/** 
 * @param hotspots
 * @return
 */
public Point[] place(int hotspots);

Fixed version (ground truth):
/** 
 * Finds and returns <code>number</code> positions.
 * @param number The number of positions to be returned.
 * @return An array of positions.
 */
public Point[] place(int number);
Program: 39845
Project: 39845
Buggy source:
/** 
 * @return
 */
public double getWidth();

Fixed version (ground truth):
/** 
 * Getter for the width of the field in which the positions are to be determined.
 * @return The width of the field.
 */
public double getWidth();
Program: 39846
Project: 39846
Buggy source:
public PlacementModelContainer(int nodes,int hotspots,PlacementModel hotspotPlacer,PlacementModel nodePlacer,Partitioner partitioner,NodeConnector nodeConnector,RoutingAlgorithm r,Transformation[] t){
  super("String_Node_Str",nodes,getConfigKeys(hotspotPlacer,nodePlacer,nodeConnector,partitioner),getConfigValues(hotspotPlacer,nodePlacer,nodeConnector,partitioner),r,t);
  this.nodes=nodes;
  this.hotspots=hotspots;
  this.hotspotPlacer=hotspotPlacer;
  this.nodePlacer=nodePlacer;
  this.partitioner=partitioner;
  this.connector=nodeConnector;
  idSpace=new PlaneIdentifierSpaceSimple(null,hotspotPlacer.getWidth(),hotspotPlacer.getHeight(),false);
}

Fixed version (ground truth):
/** 
 * Standard and only constructor for this class, gets all needed classes and all the needed information.
 * @param nodes The number of nodes in the network.
 * @param hotspots The number of hotspots in the network.
 * @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 how much nodes are placed in each hotspot.
 * @param nodeConnector The <code>NodeConnector</code> used to connect nodes depending on their position.
 * @param r The routing to be used in the network.
 * @param t The transformations that should be applied to the graph of the network.
 */
public PlacementModelContainer(int nodes,int hotspots,PlacementModel hotspotPlacer,PlacementModel nodePlacer,Partitioner partitioner,NodeConnector nodeConnector,RoutingAlgorithm r,Transformation[] t){
  super("String_Node_Str",nodes,getConfigKeys(hotspotPlacer,nodePlacer,nodeConnector,partitioner),getConfigValues(hotspotPlacer,nodePlacer,nodeConnector,partitioner),r,t);
  this.nodes=nodes;
  this.hotspots=hotspots;
  this.hotspotPlacer=hotspotPlacer;
  this.nodePlacer=nodePlacer;
  this.partitioner=partitioner;
  this.connector=nodeConnector;
  idSpace=new PlaneIdentifierSpaceSimple(null,hotspotPlacer.getWidth(),hotspotPlacer.getHeight(),false);
}
Program: 39847
Project: 39847
Buggy source:
/** 
 * @param hotspotPlacer
 * @param nodePlacer
 * @return
 */
private static String[] getConfigKeys(PlacementModel hotspotPlacer,PlacementModel nodePlacer,NodeConnector connector,Partitioner partitioner){
  return Util.mergeArrays(new String[]{getKey(hotspotPlacer,nodePlacer)},Util.mergeArrays(Util.addPrefix("String_Node_Str",partitioner.getConfigKeys()),Util.mergeArrays(Util.addPrefix("String_Node_Str",connector.getConfigKeys()),Util.mergeArrays(Util.addPrefix("String_Node_Str",hotspotPlacer.getConfigKeys()),Util.addPrefix("String_Node_Str",nodePlacer.getConfigKeys())))));
}

Fixed version (ground truth):
/** 
 * Constructs an array containing all the configuration keys used for the particular <code>PlacementModelContainer</code>. Basically combines all the configuration keys of both <code>PlacementModels</code> (prefixed by "HP_" and "NP_" respectively), the <code>Partitioner</code> (prefixed by "PART_") and the <code>NodeConnector</code> (prefixed by "NC_") into one big string array and adds "KEY" without a prefix to it.
 * @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 keys.
 */
private static String[] getConfigKeys(PlacementModel hotspotPlacer,PlacementModel nodePlacer,NodeConnector connector,Partitioner partitioner){
  return Util.mergeArrays(new String[]{"String_Node_Str"},Util.mergeArrays(Util.addPrefix("String_Node_Str",partitioner.getConfigKeys()),Util.mergeArrays(Util.addPrefix("String_Node_Str",connector.getConfigKeys()),Util.mergeArrays(Util.addPrefix("String_Node_Str",hotspotPlacer.getConfigKeys()),Util.addPrefix("String_Node_Str",nodePlacer.getConfigKeys())))));
}
Program: 39848
Project: 39848
Buggy source:
/** 
 * @param hotspotPlacer
 * @param nodePlacer
 * @return
 */
private static String getKey(PlacementModel hotspotPlacer,PlacementModel nodePlacer){
  return "String_Node_Str" + hotspotPlacer.getKey() + "String_Node_Str"+ nodePlacer.getKey();
}

Fixed version (ground truth):
/** 
 * Constructs the key of this network, which will be HSM_<hotspotPlacer.getKey()>_<nodePlacer.getKey()>.
 * @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.
 * @return The key of this network.
 */
private static String getKey(PlacementModel hotspotPlacer,PlacementModel nodePlacer){
  return "String_Node_Str" + hotspotPlacer.getKey() + "String_Node_Str"+ nodePlacer.getKey();
}