nus-yam/ex-repair huggingface dataset:
Program: 6228
Project: 6228
Buggy source:
@Override public int hashCode(){
  if (this == TOP)   return 1;
 else   return 2 + map.hashCode();
}

Fixed version (ground truth):
@Override public int hashCode(){
  if (isTop())   return 1;
 else   return 2 + map.hashCode();
}
Program: 6229
Project: 6229
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  SymbolicAddressMap other=(SymbolicAddressMap)obj;
  if (map == null || other.map == null)   return false;
  return map.equals(other.map);
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  SymbolicAddressMap other=(SymbolicAddressMap)obj;
  if (this.isTop() || other.isTop())   return (this.isTop() && other.isTop());
  return map.equals(other.map);
}
Program: 6230
Project: 6230
Buggy source:
@Override protected SymbolicAddressMap clone() throws CloneNotSupportedException {
  if (this == TOP)   return this;
  return new SymbolicAddressMap(this);
}

Fixed version (ground truth):
@Override protected SymbolicAddressMap clone(){
  if (this.isTop())   return this;
  return new SymbolicAddressMap(this);
}
Program: 6231
Project: 6231
Buggy source:
public BoundedSet<SymbolicAddress> getStack(int index){
  if (this == TOP)   return bsFactory.top();
  Location stackLoc=new Location(index);
  BoundedSet<SymbolicAddress> val=map.get(stackLoc);
  if (val == null)   throw new AssertionError("String_Node_Str" + index);
  return val;
}

Fixed version (ground truth):
public BoundedSet<SymbolicAddress> getStack(int index){
  if (this.isTop())   return bsFactory.top();
  Location stackLoc=new Location(index);
  BoundedSet<SymbolicAddress> val=map.get(stackLoc);
  if (val == null)   throw new AssertionError("String_Node_Str" + index);
  return val;
}
Program: 6232
Project: 6232
Buggy source:
/** 
 * Set stack info from other other map, upto bound. Used to restore stack frames when returning from a method 
 */
public void addStackUpto(SymbolicAddressMap in,int bound){
  for (  Entry<Location,BoundedSet<SymbolicAddress>> entry : map.entrySet()) {
    Location loc=entry.getKey();
    if (!loc.isHeapLoc() && loc.stackLoc < bound) {
      map.put(loc,in.getStack(loc.stackLoc));
    }
  }
}

Fixed version (ground truth):
/** 
 * Set stack info from other other map, upto bound. Used to restore stack frames when returning from a method 
 */
public void addStackUpto(SymbolicAddressMap in,int bound){
  if (in == null) {
    throw new AssertionError("String_Node_Str");
  }
  if (this.isTop())   return;
  if (in.isTop()) {
    setTop();
    return;
  }
  for (  Entry<Location,BoundedSet<SymbolicAddress>> entry : in.map.entrySet()) {
    Location loc=entry.getKey();
    if (!loc.isHeapLoc() && loc.stackLoc < bound) {
      map.put(loc,in.getStack(loc.stackLoc));
    }
  }
}
Program: 6233
Project: 6233
Buggy source:
public void join(SymbolicAddressMap b){
  joinReturned(b,0);
}

Fixed version (ground truth):
public void join(SymbolicAddressMap b){
  if (b == null)   return;
  joinReturned(b,0);
}
Program: 6237
Project: 6237
Buggy source:
public boolean isSubset(BoundedSet<V> otherEntry){
  if (otherEntry.isTop())   return true;
 else   if (this.isTop())   return false;
  return otherEntry.getSet().containsAll(this.getSet());
}

Fixed version (ground truth):
public boolean isSubset(BoundedSet<V> otherEntry){
  if (otherEntry.isSaturated())   return true;
 else   if (this.isSaturated())   return false;
  return otherEntry.getSet().containsAll(this.getSet());
}
Program: 6238
Project: 6238
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  BoundedSetImpl other=(BoundedSetImpl)obj;
  if (this.getSize() != other.getSize())   return false;
  if (this.isSaturated)   return other.isSaturated;
 else   return setImpl.equals(other.setImpl);
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  BoundedSetImpl other=(BoundedSetImpl)obj;
  if (this.isSaturated)   return other.isSaturated;
  if (this.getSize() != other.getSize())   return false;
 else   return setImpl.equals(other.setImpl);
}
Program: 6239
Project: 6239
Buggy source:
private BoundedSetImpl(HashSet<V> joinedSet){
  setImpl=joinedSet;
}

Fixed version (ground truth):
private BoundedSetImpl(HashSet<V> set){
  if (set.size() > limit) {
    this.isSaturated=true;
  }
 else {
    setImpl=set;
  }
}
Program: 6240
Project: 6240
Buggy source:
public BoundedSet<V> join(BoundedSet<V> other){
  HashSet<V> joinedSet=new HashSet<V>();
  joinedSet.addAll(this.getSet());
  if (other == null)   return new BoundedSetImpl(joinedSet);
  joinedSet.addAll(other.getSet());
  if (joinedSet.size() >= limit) {
    return top;
  }
 else {
    return new BoundedSetImpl(joinedSet);
  }
}

Fixed version (ground truth):
public BoundedSet<V> join(BoundedSet<V> other){
  if (this.isSaturated())   return this;
 else   if (other.isSaturated())   return other;
  HashSet<V> joinedSet=new HashSet<V>();
  joinedSet.addAll(this.getSet());
  if (other != null)   joinedSet.addAll(other.getSet());
  BoundedSetImpl r=new BoundedSetImpl(joinedSet);
  System.out.println(String.format("String_Node_Str",this,other,r));
  return r;
}
Program: 6241
Project: 6241
Buggy source:
public BoundedSet<SymbolicAddress> getTopOfStack(){
  return map.get(new Location(topOfStack));
}

Fixed version (ground truth):
public BoundedSet<SymbolicAddress> getTopOfStack(){
  if (this == TOP)   return bsFactory.top();
  return map.get(new Location(topOfStack));
}
Program: 6242
Project: 6242
Buggy source:
public void put(Location l,BoundedSet<SymbolicAddress> bs){
  if (!l.isHeapLoc() && l.stackLoc > this.topOfStack) {
    this.topOfStack=l.stackLoc;
  }
  this.map.put(l,bs);
}

Fixed version (ground truth):
public void put(Location l,BoundedSet<SymbolicAddress> bs){
  if (this == TOP)   return;
  if (!l.isHeapLoc() && l.stackLoc > this.topOfStack) {
    this.topOfStack=l.stackLoc;
  }
  this.map.put(l,bs);
}
Program: 6243
Project: 6243
Buggy source:
public void putStack(int index,BoundedSet<SymbolicAddress> bs){
  this.put(new Location(index),bs);
}

Fixed version (ground truth):
public void putStack(int index,BoundedSet<SymbolicAddress> bs){
  if (this == TOP)   return;
  this.put(new Location(index),bs);
}
Program: 6244
Project: 6244
Buggy source:
public BoundedSet<SymbolicAddress> getStack(int index){
  if (this == TOP)   throw new AssertionError("String_Node_Str");
  Location stackLoc=new Location(index);
  BoundedSet<SymbolicAddress> val=map.get(stackLoc);
  if (val == null)   throw new AssertionError("String_Node_Str" + index);
  return val;
}

Fixed version (ground truth):
public BoundedSet<SymbolicAddress> getStack(int index){
  if (this == TOP)   return bsFactory.top();
  Location stackLoc=new Location(index);
  BoundedSet<SymbolicAddress> val=map.get(stackLoc);
  if (val == null)   throw new AssertionError("String_Node_Str" + index);
  return val;
}
Program: 6246
Project: 6246
Buggy source:
public List<Type> getObjectFields(String className){
  List<Type> l=new LinkedList<Type>();
  ClassInfo cli=project.getWcetAppInfo().getClassInfo(className);
  if (cli.superClass != null) {
    l.addAll(getObjectFields(cli.superClass.toString()));
  }
  Field[] f=cli.clazz.getFields();
  for (int i=0; i < f.length; i++) {
    l.add(f[i].getType());
  }
  return l;
}

Fixed version (ground truth):
public List<Type> getObjectFields(String className){
  List<Type> l=new LinkedList<Type>();
  ClassInfo cli=project.getWcetAppInfo().getClassInfo(className);
  if (cli.superClass != null) {
    l.addAll(getObjectFields(cli.superClass.toString()));
  }
  Field[] f=cli.clazz.getFields();
  for (int i=0; i < f.length; i++) {
    if (!f[i].isStatic()) {
      l.add(f[i].getType());
    }
  }
  return l;
}
Program: 6247
Project: 6247
Buggy source:
private void checkScope(InstructionHandle stmt){
  if (scopes.get(stmt) == null) {
    ValueMapping.scope=++ValueMapping.scopeCnt;
    scopes.put(stmt,new Integer(ValueMapping.scope));
  }
}

Fixed version (ground truth):
private void checkScope(Context context,InstructionHandle stmt){
  if (scopes.get(stmt) == null) {
    scopes.put(stmt,new ContextMap<CallString,Integer>(context,new HashMap<CallString,Integer>()));
  }
  if (scopes.get(stmt).get(context.callString) == null) {
    ValueMapping.scope=++ValueMapping.scopeCnt;
    scopes.get(stmt).put(context.callString,new Integer(ValueMapping.scope));
  }
}
Program: 6249
Project: 6249
Buggy source:
public int getBound(DFAAppInfo program,InstructionHandle instr){
  ContextMap<CallString,Pair<ValueMapping>> r=bounds.get(instr);
  if (r == null) {
    return -1;
  }
  int maxValue=-1;
  for (Iterator<CallString> k=r.keySet().iterator(); k.hasNext(); ) {
    CallString callString=k.next();
    Pair<ValueMapping> bounds=r.get(callString);
    LoopBounds.ValueMapping first=bounds.getFirst();
    LoopBounds.ValueMapping second=bounds.getSecond();
    if (scopes.get(instr).intValue() <= first.defscope || scopes.get(instr).intValue() <= second.defscope) {
      return -1;
    }
    int val=ValueMapping.computeBound(first,second);
    if (val < 0) {
      return -1;
    }
 else {
      maxValue=Math.max(maxValue,val);
    }
  }
  return maxValue;
}

Fixed version (ground truth):
public int getBound(DFAAppInfo program,InstructionHandle instr){
  ContextMap<CallString,Pair<ValueMapping>> r=bounds.get(instr);
  if (r == null) {
    return -1;
  }
  int maxValue=-1;
  for (Iterator<CallString> k=r.keySet().iterator(); k.hasNext(); ) {
    CallString callString=k.next();
    Pair<ValueMapping> bounds=r.get(callString);
    LoopBounds.ValueMapping first=bounds.getFirst();
    LoopBounds.ValueMapping second=bounds.getSecond();
    InstructionHandle target=((BranchInstruction)instr.getInstruction()).getTarget();
    if (scopes.get(target) != null) {
      if (scopes.get(target).get(callString).intValue() <= first.defscope || scopes.get(target).get(callString).intValue() <= second.defscope) {
        return -1;
      }
    }
    if (scopes.get(instr).get(callString).intValue() <= first.defscope || scopes.get(instr).get(callString).intValue() <= second.defscope) {
      return -1;
    }
    int val=ValueMapping.computeBound(first,second);
    if (val < 0) {
      return -1;
    }
 else {
      maxValue=Math.max(maxValue,val);
    }
  }
  return maxValue;
}
Program: 6253
Project: 6253
Buggy source:
private static int f_multianewarray(){
  JVMHelp.wr("String_Node_Str");
  JVMHelp.wr("String_Node_Str");
  int ret=0;
  int i, j;
  int sp=Native.getSP();
  int fp=sp - 4;
  int pc=Native.rdIntMem(fp + 1);
  pc+=2;
  int mp=Native.rdIntMem(fp + 4);
  int start=Native.rdMem(mp) >>> 10;
  int dim=Native.rdMem(start + (pc >> 2));
  for (i=(pc & 0x03); i < 3; ++i)   dim>>=8;
  dim&=0xff;
  Native.wrIntMem(pc + 1,fp + 1);
  sp=Native.rdIntMem(fp);
  sp-=dim;
  Native.wrIntMem(sp,fp);
  if (dim != 2) {
    System.out.print(dim);
    System.out.println("String_Node_Str");
    JVMHelp.noim();
  }
  int cnt=Native.rdIntMem(sp + 1);
  int cnt2=Native.rdIntMem(sp + 2);
  ret=f_anewarray(cnt,0);
  int ref=Native.rdMem(ret);
  for (i=0; i < cnt; ++i) {
    Native.wrMem(f_newarray(cnt2,10),ref + i);
  }
  return ret;
}

Fixed version (ground truth):
private static int f_multianewarray(){
  JVMHelp.wr("String_Node_Str");
  JVMHelp.wr("String_Node_Str");
  int ret=0;
  int i, j;
  int sp=Native.getSP();
  int fp=sp - 4;
  int pc=Native.rdIntMem(fp + 1);
  pc+=2;
  int mp=Native.rdIntMem(fp + 4);
  int start=Native.rdMem(mp) >>> 10;
  int dim=Native.rdMem(start + (pc >> 2));
  for (i=(pc & 0x03); i < 3; ++i)   dim>>=8;
  dim&=0xff;
  Native.wrIntMem(pc + 1,fp + 1);
  sp=Native.rdIntMem(fp);
  sp-=dim;
  Native.wrIntMem(sp,fp);
  if (dim != 2) {
    System.out.print(dim);
    System.out.println("String_Node_Str");
    JVMHelp.noim();
  }
  int cnt=Native.rdIntMem(sp + 1);
  int cnt2=Native.rdIntMem(sp + 2);
  ret=f_anewarray(cnt,0);
  for (i=0; i < cnt; ++i) {
    int arr=f_newarray(cnt2,10);
synchronized (GC.mutex) {
      Native.wrMem(arr,Native.rdMem(ret) + i);
    }
  }
  return ret;
}
Program: 6254
Project: 6254
Buggy source:
/** 
 * Remove problematic characters from a method name  Note that fully qualified methods might become non-unique, so use an additional unique identifier if you need unique names. 
 */
public static String sanitizeFileName(String str){
  StringBuffer sanitized=new StringBuffer(str.length());
  for (int i=0; i < str.length(); i++) {
    if (Character.isLetterOrDigit(str.charAt(i)) || str.charAt(i) == '.') {
      sanitized.append(str.charAt(i));
    }
 else {
      sanitized.append('_');
    }
  }
  return sanitized.toString();
}

Fixed version (ground truth):
/** 
 * Remove problematic characters from a method name Note that fully qualified methods might become non-unique, so use an additional unique identifier if you need unique names. 
 */
public static String sanitizeFileName(String str){
  StringBuffer sanitized=new StringBuffer(str.length());
  for (int i=0; i < str.length(); i++) {
    if (Character.isLetterOrDigit(str.charAt(i)) || str.charAt(i) == '.') {
      sanitized.append(str.charAt(i));
    }
 else {
      sanitized.append('_');
    }
  }
  return sanitized.toString();
}
Program: 6255
Project: 6255
Buggy source:
public static <V,E>List<V> topologicalOrder(DirectedGraph<V,E> acyclicGraph){
  TopologicalOrderIterator<V,E> topo=new TopologicalOrderIterator<V,E>(acyclicGraph);
  List<V> topoList=new ArrayList<V>();
  while (topo.hasNext()) {
    topoList.add(topo.next());
  }
  return topoList;
}

Fixed version (ground truth):
public static <V,E>List<V> topologicalOrder(DirectedGraph<V,E> acyclicGraph){
  List<V> topoList=new ArrayList<V>();
  if (acyclicGraph.vertexSet().size() > 0) {
    TopologicalOrderIterator<V,E> topo=new TopologicalOrderIterator<V,E>(acyclicGraph);
    while (topo.hasNext()) {
      topoList.add(topo.next());
    }
  }
  return topoList;
}
Program: 6256
Project: 6256
Buggy source:
public int hashCode(){
  return method.getMethod().hashCode();
}

Fixed version (ground truth):
public int hashCode(){
  return method.hashCode();
}
Program: 6257
Project: 6257
Buggy source:
private void build() throws MethodNotFoundException {
  this.buildGraph();
  classInfos=new HashSet<ClassInfo>();
  for (  CallGraphNode cgn : callGraph.vertexSet()) {
    classInfos.add(cgn.getReferencedMethod().getReceiver());
  }
  Pair<List<CallGraphNode>,List<CallGraphNode>> cycle=DirectedCycleDetector.findCycle(callGraph,rootNode);
  if (cycle != null) {
    throw new AssertionError(cyclicCallGraphMsg(cycle));
  }
  invalidate();
}

Fixed version (ground truth):
private void build() throws MethodNotFoundException {
  this.buildGraph();
  classInfos=new HashSet<ClassInfo>();
  for (  CallGraphNode cgn : callGraph.vertexSet()) {
    classInfos.add(cgn.getReferencedMethod().getReceiver());
  }
  Pair<List<CallGraphNode>,List<CallGraphNode>> cycle=DirectedCycleDetector.findCycle(callGraph,rootNode);
  if (cycle != null) {
    for (    DefaultEdge e : callGraph.edgeSet()) {
      CallGraphNode src=callGraph.getEdgeSource(e);
      CallGraphNode target=callGraph.getEdgeTarget(e);
      System.err.println("String_Node_Str" + src + "String_Node_Str"+ target);
    }
    throw new AssertionError(cyclicCallGraphMsg(cycle));
  }
  invalidate();
}
Program: 6258
Project: 6258
Buggy source:
public boolean equals(Object that){
  return (that instanceof CallGraphNode) ? (method.getMethod().equals(((CallGraphNode)that).method.getMethod())) : false;
}

Fixed version (ground truth):
public boolean equals(Object that){
  return (that instanceof CallGraphNode) ? (method.equals(((CallGraphNode)that).method)) : false;
}
Program: 6259
Project: 6259
Buggy source:
/** 
 * Method getFunctionOutput, which will return the functional output for point p.
 * @param p - the point index
 * @param parallel - true if to be done in parallel
 * @return the functinal output
 */
static float getFunctionOutputFloat(int p,boolean parallel){
  float functionalOutput_fp=0;
  SVMHelp.p=p;
  if (parallel) {
    SVMHelp.functionalOutput_fp=0.0f;
    ParallelExecutor pe=new ParallelExecutor();
    System.out.print("String_Node_Str");
    System.out.println(m);
    pe.executeParallel(new SVMHelp(),m);
    SVMHelp.functionalOutput_fp-=bias_fp;
    functionalOutput_fp=SVMHelp.functionalOutput_fp;
  }
 else {
    for (int i=0; i < m; i++) {
      if (alph[i] > 0) {
        functionalOutput_fp+=target[i] * alph[i] * getKernelOutputFloat(i,p);
      }
    }
    functionalOutput_fp-=bias_fp;
  }
  return functionalOutput_fp;
}

Fixed version (ground truth):
/** 
 * Method getFunctionOutput, which will return the functional output for point p.
 * @param p - the point index
 * @param parallel - true if to be done in parallel
 * @return the functinal output
 */
static float getFunctionOutputFloat(int p,boolean parallel){
  float functionalOutput_fp=0;
  SVMHelp.p=p;
  if (parallel) {
    SVMHelp.functionalOutput_fp=0.0f;
    System.out.print("String_Node_Str");
    System.out.println(m);
    pe.executeParallel(new SVMHelp(),m);
    SVMHelp.functionalOutput_fp-=bias_fp;
    functionalOutput_fp=SVMHelp.functionalOutput_fp;
  }
 else {
    for (int i=0; i < m; i++) {
      if (alph[i] > 0) {
        functionalOutput_fp+=target[i] * alph[i] * getKernelOutputFloat(i,p);
      }
    }
    functionalOutput_fp-=bias_fp;
  }
  return functionalOutput_fp;
}
Program: 6260
Project: 6260
Buggy source:
public void read(){
  for (int i=0; i < aDat.length; i++) {
    aDat[i]=(i + 30) % SIZE;
  }
}

Fixed version (ground truth):
public void read(){
  for (i=0; i < aDat.length; i++) {
    aDat[i]=(i + 30) % SIZE;
  }
}
Program: 6261
Project: 6261
Buggy source:
public void sort(){
  i=0;
  while (i < aDat.length) {
    j=aDat.length - 1;
    while (j >= i) {
      cond=aDat[j] < aDat[j - 1];
      temp=aDat[j];
      aDat[j]=Native.condMove(aDat[j - 1],aDat[j],cond);
      aDat[j - 1]=Native.condMove(temp,aDat[j - 1],cond);
      j=j - 1;
    }
    i=i + 1;
  }
}

Fixed version (ground truth):
public void sort(){
  i=0;
  while (i < aDat.length) {
    j=aDat.length - 1;
    while (j > i) {
      cond=aDat[j] < aDat[j - 1];
      temp=aDat[j];
      aDat[j]=Native.condMove(aDat[j - 1],aDat[j],cond);
      aDat[j - 1]=Native.condMove(temp,aDat[j - 1],cond);
      j=j - 1;
    }
    i=i + 1;
  }
}
Program: 6262
Project: 6262
Buggy source:
public void write(){
}

Fixed version (ground truth):
public void write(){
  for (i=0; i < aDat.length; i++) {
    System.out.println("String_Node_Str" + i + "String_Node_Str"+ aDat[i]+ "String_Node_Str");
  }
}
Program: 6264
Project: 6264
Buggy source:
private boolean implementsInterface(String ifname){
  ClassInfo cli=this;
  do {
    String[] interfaces=cli.clazz.getInterfaceNames();
    for (int i=0; i < interfaces.length; i++) {
      if (ifname.equals(interfaces[i])) {
        return true;
      }
 else {
        boolean match=((JopClassInfo)appInfo.cliMap.get(interfaces[i])).implementsInterface(ifname);
        if (match) {
          return true;
        }
      }
    }
    cli=(ClassInfo)cli.superClass;
  }
 while (cli != null);
  return false;
}

Fixed version (ground truth):
private boolean implementsInterface(String ifname){
  ClassInfo cli=this;
  do {
    String[] interfaces=cli.clazz.getInterfaceNames();
    for (int i=0; i < interfaces.length; i++) {
      if (ifname.equals(interfaces[i])) {
        return true;
      }
 else {
        JopClassInfo superCli=(JopClassInfo)appInfo.cliMap.get(interfaces[i]);
        boolean match=superCli.implementsInterface(ifname);
        if (match) {
          return true;
        }
      }
    }
    cli=(ClassInfo)cli.superClass;
  }
 while (cli != null);
  return false;
}
Program: 6265
Project: 6265
Buggy source:
public void Start(){
  final int max_mac_size=10000;
  final int max_cycles=100000;
  int[] array1=new int[max_mac_size];
  int[] array2=new int[max_mac_size];
  System.out.println("String_Node_Str");
  mac_coprocessor m=new mac_coprocessor();
  int ts=Native.rdMem(Const.IO_CNT);
  int te=Native.rdMem(Const.IO_CNT);
  int to=te - ts;
  int icount=0;
  for (int mac_size=1; mac_size < max_mac_size; icount++) {
    int i, j, time, out, expect=0;
    boolean error=false;
    int max_time=0;
    int min_time=1 << 30;
    int total_time=0;
    for (i=0; i < mac_size; i++) {
      array1[i]=mac_size + 123 + (i * 99)+ (i * i * 12);
      array2[i]=mac_size + 456 + (i * 78)+ (i * i * 9);
      expect+=array1[i] * array2[i];
    }
    System.out.print(mac_size);
    System.out.print("String_Node_Str");
    out=m.mac1(mac_size,array1,array2);
    for (i=0; i < max_cycles; i++) {
      ts=Native.rdMem(Const.IO_CNT);
      out=m.mac1(mac_size,array1,array2);
      te=Native.rdMem(Const.IO_CNT);
      time=te - ts - to;
      if (time > max_time) {
        max_time=time;
      }
      if (time < min_time) {
        min_time=time;
      }
      total_time+=time;
      if (out != expect) {
        error=true;
        break;
      }
    }
    if (error) {
      System.out.println("String_Node_Str");
      break;
    }
    System.out.print(min_time);
    System.out.print("String_Node_Str");
    System.out.print(total_time / max_cycles);
    System.out.print("String_Node_Str");
    System.out.println(max_time);
    mac_size++;
    if (icount > 100) {
      mac_size+=mac_size / 4;
    }
  }
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public void Start(){
  array1=new int[max_mac_size + 1];
  array2=new int[max_mac_size + 1];
  System.out.println("String_Node_Str");
  m=new mac_coprocessor();
  int icount=0;
  boolean error=false;
  for (int mac_size=1; (mac_size < max_mac_size) && !error; icount++) {
    error=Measure(mac_size);
    mac_size++;
    if (icount > 100) {
      mac_size+=mac_size / 4;
    }
  }
  if (!error) {
    Measure(max_mac_size);
  }
  System.out.println("String_Node_Str");
}
Program: 6266
Project: 6266
Buggy source:
public int search_max(int size,int[] data){
  int max=0;
  for (int i=0; i < size; i++) {
    int d=data[i];
    if (d > max)     max=d;
  }
  return max;
}

Fixed version (ground truth):
public int search_max(int size,int[] data){
  int max=0;
  int one=1;
  for (int i=0; i < size; i+=one) {
    int d=data[i];
    if (d > max)     max=d;
  }
  return max;
}
Program: 6268
Project: 6268
Buggy source:
public int bit_count2(int size,int[] data){
  int count=0;
  for (int i=0; i < size; i++) {
    int d=data[i];
    for (int j=0; j < 4; j++) {
      count+=lut[d & 255];
      d=d >> 8;
    }
  }
  return count;
}

Fixed version (ground truth):
public int bit_count2(int size,int[] data){
  int count=0;
  int one=1;
  for (int i=0; i < size; i+=one) {
    int d=data[i];
    for (int j=0; j < 4; j+=one) {
      count+=lut[d & 255];
      d=d >> 8;
    }
  }
  return count;
}
Program: 6269
Project: 6269
Buggy source:
public int bit_count1(int size,int[] data){
  int count=0;
  for (int i=0; i < size; i++) {
    int d=data[i];
    for (int j=0; j < 32; j++) {
      if ((d & 1) == 1)       count++;
      d=d >> 1;
    }
  }
  return count;
}

Fixed version (ground truth):
public int bit_count1(int size,int[] data){
  int count=0;
  int one=1;
  for (int i=0; i < size; i+=one) {
    int d=data[i];
    for (int j=0; j < 32; j+=one) {
      if ((d & 1) == 1)       count+=one;
      d=d >> 1;
    }
  }
  return count;
}
Program: 6270
Project: 6270
Buggy source:
public static int measure(){
  int val=-expect;
  for (int i=0; i < mac_size; i++) {
    val+=array1[i] * array2[i];
  }
  return val;
}

Fixed version (ground truth):
public static void measure(){
  hwm.mac(hwm.max_test_size,hwm.test_vector,hwm.test_vector);
}
Program: 6271
Project: 6271
Buggy source:
public static void main(String[] args){
  measure();
}

Fixed version (ground truth):
public static void main(String[] args){
  hwm=new HWMethTest();
  hwm.Prepare_Noisy_Vector(hwm.max_test_size);
  measure();
}
Program: 6272
Project: 6272
Buggy source:
public int measure(){
  return m.mac1(mac_size,array1,array2) - expect;
}

Fixed version (ground truth):
public static void measure(){
  m.mac1(hwm.max_test_size,hwm.test_vector,hwm.test_vector);
}
Program: 6273
Project: 6273
Buggy source:
public static void main(String[] args){
  MacTestHW mt=new MacTestHW();
  mt.measure();
}

Fixed version (ground truth):
public static void main(String[] args){
  hwm=new HWMethTest();
  hwm.Prepare_Noisy_Vector(hwm.max_test_size);
  m=mac_coprocessor.getInstance();
  measure();
}
Program: 6276
Project: 6276
Buggy source:
private void calculateDepthAndHeight(){
  if (this.maxDistanceToRoot != null)   return;
  this.maxDistanceToRoot=new HashMap<CallGraphNode,Integer>();
  this.maxCallStackLeaf=this.getRootNode();
  this.maxCallstackDAG=new HashMap<CallGraphNode,CallGraphNode>();
  this.subgraphHeight=new HashMap<CallGraphNode,Integer>();
  Vector<CallGraphNode> toList=new Vector<CallGraphNode>();
  TopologicalOrderIterator<CallGraphNode,DefaultEdge> toIter=new TopologicalOrderIterator<CallGraphNode,DefaultEdge>(callGraph);
  int globalMaxDist=0;
  while (toIter.hasNext()) {
    CallGraphNode node=toIter.next();
    toList.add(node);
    int maxDist=0;
    CallGraphNode maxCallStackPred=null;
    for (    DefaultEdge e : callGraph.incomingEdgesOf(node)) {
      CallGraphNode pred=callGraph.getEdgeSource(e);
      int distViaPred=maxDistanceToRoot.get(pred) + 1;
      if (distViaPred > maxDist) {
        maxDist=distViaPred;
        maxCallStackPred=pred;
      }
    }
    this.maxDistanceToRoot.put(node,maxDist);
    if (maxCallStackPred != null)     this.maxCallstackDAG.put(node,maxCallStackPred);
    if (maxDist > globalMaxDist)     this.maxCallStackLeaf=node;
  }
  Collections.reverse(toList);
  for (  CallGraphNode n : toList) {
    int maxHeight=0;
    for (    DefaultEdge e : callGraph.outgoingEdgesOf(n)) {
      int predHeight=subgraphHeight.get(callGraph.getEdgeTarget(e));
      maxHeight=Math.max(maxHeight,predHeight);
    }
    subgraphHeight.put(n,maxHeight);
  }
}

Fixed version (ground truth):
private void calculateDepthAndHeight(){
  if (this.maxDistanceToRoot != null)   return;
  this.maxDistanceToRoot=new HashMap<CallGraphNode,Integer>();
  this.maxCallStackLeaf=this.getRootNode();
  this.maxCallstackDAG=new HashMap<CallGraphNode,CallGraphNode>();
  this.subgraphHeight=new HashMap<CallGraphNode,Integer>();
  Vector<CallGraphNode> toList=new Vector<CallGraphNode>();
  TopologicalOrderIterator<CallGraphNode,DefaultEdge> toIter=new TopologicalOrderIterator<CallGraphNode,DefaultEdge>(callGraph);
  int globalMaxDist=0;
  while (toIter.hasNext()) {
    CallGraphNode node=toIter.next();
    toList.add(node);
    int maxDist=0;
    CallGraphNode maxCallStackPred=null;
    for (    DefaultEdge e : callGraph.incomingEdgesOf(node)) {
      CallGraphNode pred=callGraph.getEdgeSource(e);
      int distViaPred=maxDistanceToRoot.get(pred) + 1;
      if (distViaPred > maxDist) {
        maxDist=distViaPred;
        maxCallStackPred=pred;
      }
    }
    this.maxDistanceToRoot.put(node,maxDist);
    if (maxCallStackPred != null)     this.maxCallstackDAG.put(node,maxCallStackPred);
    if (maxDist > globalMaxDist)     this.maxCallStackLeaf=node;
  }
  Collections.reverse(toList);
  for (  CallGraphNode n : toList) {
    int maxHeight=0;
    for (    DefaultEdge e : callGraph.outgoingEdgesOf(n)) {
      int predHeight=subgraphHeight.get(callGraph.getEdgeTarget(e));
      maxHeight=Math.max(maxHeight,predHeight + 1);
    }
    subgraphHeight.put(n,maxHeight);
  }
}
Program: 6277
Project: 6277
Buggy source:
/** 
 * Get the maximum height of the call stack. <p>A leaf method has height 1, an abstract method's height is the maximum height of its children, and the height of an implemented method is the maximum height of its children + 1. <p>
 * @return
 */
public Vector<CallGraphNode> getMaximalCallStack(){
  Map<CallGraphNode,Integer> depth=new HashMap<CallGraphNode,Integer>();
  HashMap<CallGraphNode,CallGraphNode> prev=new HashMap<CallGraphNode,CallGraphNode>();
  CallGraphNode deepestLeaf=rootNode;
  TopologicalOrderIterator<CallGraphNode,DefaultEdge> toIter=new TopologicalOrderIterator<CallGraphNode,DefaultEdge>(callGraph);
  depth.put(rootNode,0);
  int maxDepth=0;
  Set<CallGraphNode> visited=new HashSet<CallGraphNode>();
  while (toIter.hasNext()) {
    CallGraphNode n=toIter.next();
    visited.add(n);
    int thisDepth=depth.get(n);
    for (    DefaultEdge e : callGraph.outgoingEdgesOf(n)) {
      CallGraphNode target=callGraph.getEdgeTarget(e);
      if (visited.contains(target)) {
        throw new AssertionError("String_Node_Str");
      }
      int oldDepth;
{
        Integer tmp=depth.get(target);
        oldDepth=tmp == null ? 0 : tmp.intValue();
      }
      if (thisDepth + 1 > oldDepth) {
        depth.put(target,thisDepth + 1);
        prev.put(target,n);
        if (thisDepth + 1 > maxDepth) {
          maxDepth=thisDepth + 1;
          deepestLeaf=target;
        }
      }
    }
  }
  Vector<CallGraphNode> maxCallStack=new Vector<CallGraphNode>();
  CallGraphNode n=deepestLeaf;
  while (prev.containsKey(n)) {
    maxCallStack.add(n);
    n=prev.get(n);
  }
  maxCallStack.add(n);
  Collections.reverse(maxCallStack);
  return maxCallStack;
}

Fixed version (ground truth):
/** 
 * Get the maximum height of the call stack. <p>A leaf method has height 1, an abstract method's height is the maximum height of its children, and the height of an implemented method is the maximum height of its children + 1. <p>
 * @return
 */
public Vector<CallGraphNode> getMaximalCallStack(){
  if (maxCallStackLeaf == null)   calculateDepthAndHeight();
  CallGraphNode n=this.maxCallStackLeaf;
  Vector<CallGraphNode> maxCallStack=new Vector<CallGraphNode>();
  maxCallStack.add(n);
  while (maxCallstackDAG.containsKey(n)) {
    n=maxCallstackDAG.get(n);
    maxCallStack.add(n);
  }
  Collections.reverse(maxCallStack);
  return maxCallStack;
}
Program: 6278
Project: 6278
Buggy source:
/** 
 * Build a callgraph rooted at the given method
 * @param cli The class loader (with classes loaded)
 * @param className The class where the root method of the callgraph is located
 * @param methodSig The root method of the call graph. Either a plain method name(e.g. "measure"), if unique, or a method with signature (e.g. "measure()Z")
 * @throws MethodNotFoundException 
 */
public static CallGraph buildCallGraph(WcetAppInfo cli,String className,String methodSig) throws MethodNotFoundException {
  MethodInfo rootMethod=cli.searchMethod(className,methodSig);
  CallGraph cg=new CallGraph(cli,rootMethod);
  cg.build();
  return cg;
}

Fixed version (ground truth):
/** 
 * Build a callgraph rooted at the given method
 * @param appInfo   The application (with classes loaded)
 * @param className The class where the root method of the callgraph is located
 * @param methodSig The root method of the call graph. Either a plain method name(e.g. "measure"), if unique, or a method with signature (e.g. "measure()Z")
 * @throws MethodNotFoundException 
 */
public static CallGraph buildCallGraph(WcetAppInfo appInfo,String className,String methodSig) throws MethodNotFoundException {
  MethodInfo rootMethod=appInfo.searchMethod(className,methodSig);
  CallGraph cg=new CallGraph(appInfo,rootMethod);
  cg.build();
  return cg;
}
Program: 6279
Project: 6279
Buggy source:
public void exportDOT(Writer w) throws IOException {
  new AdvancedDOTExporter<CallGraphNode,DefaultEdge>().exportDOT(w,this.callGraph);
}

Fixed version (ground truth):
/** 
 * Export callgraph as .dot file
 * @param w
 * @throws IOException
 */
public void exportDOT(Writer w) throws IOException {
  new AdvancedDOTExporter<CallGraphNode,DefaultEdge>().exportDOT(w,this.callGraph);
}
Program: 6280
Project: 6280
Buggy source:
/** 
 * get non-abstract methods reachable from the given method, in DFS order
 * @return
 */
public List<MethodInfo> getReachableImplementations(MethodInfo rootMethod){
  List<MethodInfo> implemented=new Vector<MethodInfo>();
  CallGraphNode root=this.getNode(rootMethod);
  DepthFirstIterator<CallGraphNode,DefaultEdge> ti=new DepthFirstIterator<CallGraphNode,DefaultEdge>(callGraph,root);
  ti.setCrossComponentTraversal(false);
  while (ti.hasNext()) {
    MethodInfo m=ti.next().getMethodImpl();
    if (m != null)     implemented.add(m);
  }
  return implemented;
}

Fixed version (ground truth):
/** 
 * get non-abstract methods reachable from the given method, in DFS order
 * @return
 */
public List<MethodInfo> getReachableImplementations(MethodInfo rootMethod){
  List<MethodInfo> implemented=new Vector<MethodInfo>();
  CallGraphNode root=this.getNode(rootMethod);
  DepthFirstIterator<CallGraphNode,DefaultEdge> ti=new DepthFirstIterator<CallGraphNode,DefaultEdge>(callGraph,root);
  ti.setCrossComponentTraversal(false);
  while (ti.hasNext()) {
    MethodInfo m=ti.next().getMethodImpl();
    if (m == null)     throw new AssertionError("String_Node_Str");
    implemented.add(m);
  }
  return implemented;
}
Program: 6281
Project: 6281
Buggy source:
public int getMaxHeight(){
  return this.getMaximalCallStack().size();
}

Fixed version (ground truth):
public int getMaxHeight(){
  calculateDepthAndHeight();
  return this.subgraphHeight.get(this.rootNode);
}
Program: 6282
Project: 6282
Buggy source:
/** 
 * Initialize a CallGraph object.
 * @param appInfo
 * @param rootMethod The root method of the callgraph. Must not be abstract.
 */
protected CallGraph(WcetAppInfo appInfo,MethodInfo rootMethod){
  this.appInfo=appInfo;
  this.callGraph=new DefaultDirectedGraph<CallGraphNode,DefaultEdge>(DefaultEdge.class);
  this.rootNode=new CallGraphNode(rootMethod);
  this.callGraph.addVertex(rootNode);
}

Fixed version (ground truth):
/** 
 * Initialize a CallGraph object.
 * @param appInfo    Uplink to the application info.
 * @param rootMethod The root method of the callgraph (not abstract).
 */
protected CallGraph(WcetAppInfo appInfo,MethodInfo rootMethod){
  this.appInfo=appInfo;
  this.callGraph=new DefaultDirectedGraph<CallGraphNode,DefaultEdge>(DefaultEdge.class);
  this.rootNode=new CallGraphNode(rootMethod);
  this.callGraph.addVertex(rootNode);
}
Program: 6283
Project: 6283
Buggy source:
private void build() throws MethodNotFoundException {
  this.buildGraph();
  classInfos=new HashSet<ClassInfo>();
  for (  CallGraphNode cgn : callGraph.vertexSet()) {
    classInfos.add(cgn.getReferencedMethod().getReceiver());
  }
  Pair<List<CallGraphNode>,List<CallGraphNode>> cycle=DirectedCycleDetector.findCycle(callGraph,rootNode);
  if (cycle != null) {
    throw new AssertionError(cyclicCallGraphMsg(cycle));
  }
}

Fixed version (ground truth):
private void build() throws MethodNotFoundException {
  this.buildGraph();
  classInfos=new HashSet<ClassInfo>();
  for (  CallGraphNode cgn : callGraph.vertexSet()) {
    classInfos.add(cgn.getReferencedMethod().getReceiver());
  }
  Pair<List<CallGraphNode>,List<CallGraphNode>> cycle=DirectedCycleDetector.findCycle(callGraph,rootNode);
  if (cycle != null) {
    throw new AssertionError(cyclicCallGraphMsg(cycle));
  }
  invalidate();
}
Program: 6284
Project: 6284
Buggy source:
protected CallGraphNode getNode(MethodInfo m){
  return nodeMap.get(m);
}

Fixed version (ground truth):
private CallGraphNode getNode(MethodInfo m){
  return nodeMap.get(m);
}
Program: 6285
Project: 6285
Buggy source:
/** 
 * Compute the maximal total cache-miss penalty for <strong>invoking and executing</strong> m. <p> Precondition: The set of all methods reachable from <code>m</code> fit into the cache </p><p> Algorithm: If all methods reachable from <code>m</code> (including <code>m</code>) fit  into the cache, we can compute the WCET of <m> using the   {@link ALWAYS_HIT@} cacheapproximation, and then add the sum of cache miss penalties for every reachable method. </p><p> Note that when using this approximation, we attribute the total cache miss cost to the invocation of that method. </p><p> Explanation: We know that there is only one cache miss per method, but for FIFO caches we do not know when the cache miss will occur (on return or invoke), except for leaf methods. Let <code>h</code> be the number of cycles hidden by <strong>any</strong> return or  invoke instructions. Then the cache miss penalty is bounded by <code>(b-h)</code> per  method. </p>
 * @param m The method invoked
 * @return the cache miss penalty
 */
public long getMissOnceCummulativeCacheCost(MethodInfo m){
  long miss=0;
  Iterator<CallGraphNode> iter=project.getCallGraph().getReachableMethods(m);
  while (iter.hasNext()) {
    CallGraphNode n=iter.next();
    miss+=missOnceCost(n.getMethodImpl());
  }
  return miss;
}

Fixed version (ground truth):
/** 
 * Compute the maximal total cache-miss penalty for <strong>invoking and executing</strong> m. <p> Precondition: The set of all methods reachable from <code>m</code> fit into the cache </p><p> Algorithm: If all methods reachable from <code>m</code> (including <code>m</code>) fit  into the cache, we can compute the WCET of <m> using the   {@link ALWAYS_HIT@} cacheapproximation, and then add the sum of cache miss penalties for every reachable method. </p><p> Note that when using this approximation, we attribute the total cache miss cost to the invocation of that method. </p><p> Explanation: We know that there is only one cache miss per method, but for FIFO caches we do not know when the cache miss will occur (on return or invoke), except for leaf methods. Let <code>h</code> be the number of cycles hidden by <strong>any</strong> return or  invoke instructions. Then the cache miss penalty is bounded by <code>(b-h)</code> per  method. </p>
 * @param m The method invoked
 * @return the cache miss penalty
 */
public long getMissOnceCummulativeCacheCost(MethodInfo m){
  long miss=0;
  for (  MethodInfo reachable : project.getCallGraph().getReachableImplementations(m)) {
    miss+=missOnceCost(reachable);
  }
  return miss;
}
Program: 6286
Project: 6286
Buggy source:
/** 
 * Compute the number of cache blocks which might be needed when calling this method
 * @param mi
 * @return the maximum number of cache blocks needed, s.t. we won't run out of cacheblocks when invoking the given method
 * @throws TypeException 
 */
public long getAllFitCacheBlocks(MethodInfo mi){
  int size=0;
  Iterator<CallGraphNode> iter=project.getCallGraph().getReachableMethods(mi);
  while (iter.hasNext()) {
    CallGraphNode n=iter.next();
    size+=requiredNumberOfBlocks(project.getSizeInWords(n.getMethodImpl()));
  }
  return size;
}

Fixed version (ground truth):
/** 
 * Compute the number of cache blocks which might be needed when calling this method
 * @param invoked
 * @return the maximum number of cache blocks needed, s.t. we won't run out of cacheblocks when invoking the given method
 * @throws TypeException 
 */
public long getAllFitCacheBlocks(MethodInfo invoked){
  int size=0;
  for (  MethodInfo mi : project.getCallGraph().getReachableImplementations(invoked)) {
    size+=requiredNumberOfBlocks(project.getSizeInWords(mi));
  }
  return size;
}
Program: 6287
Project: 6287
Buggy source:
/** 
 * Check that cache is big enough to hold any method possibly invoked Return largest method 
 */
public MethodInfo checkCache() throws Exception {
  int maxWords=0;
  MethodInfo largestMethod=null;
  for (  MethodInfo mi : project.getCallGraph().getImplementedMethods()) {
    Code code=mi.getCode();
    if (code == null)     continue;
    int size=code.getLength();
    int words=MiscUtils.bytesToWords(size);
    if (!this.fitsInCache(words)) {
      throw new Exception("String_Node_Str" + mi.getFQMethodName() + "String_Node_Str"+ words+ "String_Node_Str");
    }
    if (words >= maxWords) {
      largestMethod=mi;
      maxWords=words;
    }
  }
  return largestMethod;
}

Fixed version (ground truth):
/** 
 * Check that cache is big enough to hold any method possibly invoked Return largest method 
 */
public MethodInfo checkCache() throws Exception {
  int maxWords=0;
  MethodInfo largestMethod=null;
  for (  MethodInfo mi : project.getCallGraph().getImplementedMethods()) {
    Code code=mi.getCode();
    if (code == null)     continue;
    int size=code.getCode().length;
    int words=MiscUtils.bytesToWords(size);
    if (!this.fitsInCache(words)) {
      throw new Exception("String_Node_Str" + mi.getFQMethodName() + "String_Node_Str"+ words+ "String_Node_Str");
    }
    if (words >= maxWords) {
      largestMethod=mi;
      maxWords=words;
    }
  }
  return largestMethod;
}
Program: 6289
Project: 6289
Buggy source:
public void established(Packet p){
  Ip.setData(p,Tcp.DATA,"String_Node_Str");
}

Fixed version (ground truth):
public Packet established(Packet p){
  Ip.setData(p,Tcp.DATA,"String_Node_Str");
  return p;
}
Program: 6290
Project: 6290
Buggy source:
public void request(Packet p){
  StringBuffer hello=new StringBuffer("String_Node_Str");
  Ip.getData(p,Tcp.DATA,sb);
  StringBuffer resp=null;
  if (sb.length() != 0) {
    System.out.print("String_Node_Str");
    System.out.println(sb);
    for (int i=0; i < sb.length(); ++i) {
      char ch=sb.charAt(i);
      if (ch != '\n' && ch != '\r') {
        cmd.append(ch);
      }
 else {
        String s=cmd.toString();
        if (s.equals("String_Node_Str")) {
          resp=hello;
        }
        cmd.setLength(0);
      }
    }
  }
  if (resp != null) {
    Ip.setData(p,Tcp.DATA,resp);
  }
 else {
    p.len=Tcp.DATA << 2;
  }
}

Fixed version (ground truth):
public Packet request(Packet p){
  StringBuffer hello=new StringBuffer("String_Node_Str");
  Ip.getData(p,Tcp.DATA,sb);
  StringBuffer resp=null;
  if (sb.length() != 0) {
    System.out.print("String_Node_Str");
    System.out.println(sb);
    for (int i=0; i < sb.length(); ++i) {
      char ch=sb.charAt(i);
      if (ch != '\n' && ch != '\r') {
        cmd.append(ch);
      }
 else {
        String s=cmd.toString();
        if (s.equals("String_Node_Str")) {
          resp=hello;
        }
        cmd.setLength(0);
      }
    }
  }
  if (resp != null) {
    Ip.setData(p,Tcp.DATA,resp);
  }
 else {
    p.len=Tcp.DATA << 2;
  }
  return p;
}
Program: 6291
Project: 6291
Buggy source:
@Override public boolean finished(){
  return false;
}

Fixed version (ground truth):
public boolean finished(){
  return false;
}
Program: 6292
Project: 6292
Buggy source:
/** 
 * Sends one datagram
 * @param p
 * @throws IOException
 */
public void send(Datagram p) throws IOException {
  Payload pay=null;
  int dgRemPort=StringFunctions.getPortFromConnectorStr(p.getAddress());
  int dgRemAddr=dgRemPort > -1 ? StringFunctions.getAddrFromConnectorStr(p.getAddress()) : 0;
  while (true) {
    pay=UDP.preparePayload((short)dgRemPort,(short)localPort);
    if (pay != null)     break;
    Thread.sleep(100);
  }
  UDPPacket.setData(pay,((DatagramPacket)p).getBuffer(),0,p.getLength());
  UDPPacket.setLength(pay,(short)pay.length);
  if (Debug.enabled)   Debug.println("String_Node_Str",Debug.DBG_UDP);
  IP.asyncSendPayload(pay,dgRemAddr,IP.PROT_UDP);
}

Fixed version (ground truth):
/** 
 * Sends one datagram
 * @param p
 * @throws IOException
 */
public void send(Datagram p) throws IOException {
  Payload pay=null;
  int dgRemPort=StringFunctions.getPortFromConnectorStr(p.getAddress());
  int dgRemAddr=dgRemPort > -1 ? StringFunctions.getAddrFromConnectorStr(p.getAddress()) : 0;
  while (true) {
    pay=UDP.preparePayload((short)dgRemPort,(short)localPort);
    if (pay != null)     break;
    try {
      Thread.sleep(100);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
  UDPPacket.setData(pay,((DatagramPacket)p).getBuffer(),0,p.getLength());
  UDPPacket.setLength(pay,(short)pay.length);
  if (Debug.enabled)   Debug.println("String_Node_Str",Debug.DBG_UDP);
  IP.asyncSendPayload(pay,dgRemAddr,IP.PROT_UDP);
}
Program: 6293
Project: 6293
Buggy source:
public String getTargetName(){
  return Config.sanitizeFileName(projectConfig.getAppClassName() + "String_Node_Str" + projectConfig.getTargetMethodName());
}

Fixed version (ground truth):
public String getTargetName(){
  return MiscUtils.sanitizeFileName(projectConfig.getAppClassName() + "String_Node_Str" + projectConfig.getTargetMethodName());
}
Program: 6294
Project: 6294
Buggy source:
public String getProjectName(){
  return config.getOptionWithDefault(PROJECT_NAME,Config.sanitizeFileName(getAppClassName() + "String_Node_Str" + getTargetMethodName()));
}

Fixed version (ground truth):
public String getProjectName(){
  return config.getOptionWithDefault(PROJECT_NAME,MiscUtils.sanitizeFileName(getAppClassName() + "String_Node_Str" + getTargetMethodName()));
}
Program: 6295
Project: 6295
Buggy source:
/** 
 * If no instance of project is available, us this one to get a path for writing a file (not recommended, but sometimes useful for debugging stuff)
 * @param subdir
 * @param name 
 */
public static File getOutFile(String subdir,String name){
  return new File(getOutDir(subdir),Config.sanitizeFileName(name));
}

Fixed version (ground truth):
/** 
 * If no instance of project is available, us this one to get a path for writing a file (not recommended, but sometimes useful for debugging stuff)
 * @param subdir
 * @param name 
 */
public static File getOutFile(String subdir,String name){
  return new File(getOutDir(subdir),MiscUtils.sanitizeFileName(name));
}
Program: 6296
Project: 6296
Buggy source:
public UppaalAnalysis(Logger logger,Project project,File outDir){
  this.logger=logger;
  this.project=project;
  this.outDir=outDir;
}

Fixed version (ground truth):
public UppaalAnalysis(Logger logger,Project project,File outDir){
  this.uppaalConfig=new UppAalConfig(project.getConfig(),outDir);
  this.logger=logger;
  this.project=project;
}
Program: 6297
Project: 6297
Buggy source:
public WcetCost calculateWCET(MethodInfo m,long ub) throws IOException, DuplicateKeyException, XmlSerializationException {
  Long upperBound=null;
  if (ub > 0)   upperBound=ub;
  logger.info("String_Node_Str" + m.getFQMethodName());
  Translator translator=new Translator(project,outDir);
  translator.translateProgram(m);
  translator.writeOutput();
  logger.info("String_Node_Str" + outDir);
  logger.info("String_Node_Str" + translator.getModelFile());
  if (UppAalConfig.hasVerifier(project.getConfig())) {
    logger.info("String_Node_Str");
    WcetSearch search=new WcetSearch(project.getConfig(),translator.getModelFile());
    long start=System.nanoTime();
    long wcet=search.searchWCET(upperBound);
    long end=System.nanoTime();
    searchtime+=((double)(end - start)) / 1E9;
    solvertimemax=Math.max(solvertimemax,search.getMaxSolverTime());
    return WcetCost.totalCost(wcet);
  }
 else {
    throw new IOException("String_Node_Str");
  }
}

Fixed version (ground truth):
public WcetCost calculateWCET(MethodInfo m,long ub) throws IOException, DuplicateKeyException, XmlSerializationException {
  Long upperBound=null;
  if (ub > 0)   upperBound=ub;
  logger.info("String_Node_Str" + m.getFQMethodName());
  Translator translator=new Translator(uppaalConfig,project);
  translator.translateProgram(m);
  translator.writeOutput();
  logger.info("String_Node_Str" + uppaalConfig.outDir);
  logger.info("String_Node_Str" + translator.getModelFile());
  if (uppaalConfig.hasVerifier()) {
    logger.info("String_Node_Str");
    WcetSearch search=new WcetSearch(project.getConfig(),translator.getModelFile());
    long start=System.nanoTime();
    long wcet=search.searchWCET(upperBound);
    long end=System.nanoTime();
    searchtime+=((double)(end - start)) / 1E9;
    solvertimemax=Math.max(solvertimemax,search.getMaxSolverTime());
    return WcetCost.totalCost(wcet);
  }
 else {
    throw new IOException("String_Node_Str");
  }
}
Program: 6298
Project: 6298
Buggy source:
private static String pageOf(MethodInfo i){
  return sanitizeFileName(i.getFQMethodName()) + "String_Node_Str";
}

Fixed version (ground truth):
private static String pageOf(MethodInfo i){
  return MiscUtils.sanitizeFileName(i.getFQMethodName()) + "String_Node_Str";
}