nus-yam/ex-repair huggingface dataset:
Program: 187030
Project: 187030
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: 187031
Project: 187031
Buggy source:
@Override public boolean finished(){
  return false;
}

Fixed version (ground truth):
public boolean finished(){
  return false;
}
Program: 187032
Project: 187032
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: 187033
Project: 187033
Buggy source:
public void exitUsage(boolean dumpConfig){
  System.err.println(MessageFormat.format("String_Node_Str" + "String_Node_Str",configFile,execClass.getCanonicalName()));
  System.err.println(MessageFormat.format("String_Node_Str",configFile,WCETAnalysis.class.getName(),ProjectConfig.APP_CLASS_NAME.getKey(),"String_Node_Str"));
  System.err.println("String_Node_Str" + "String_Node_Str");
  for (  Option<?> o : Config.instance().availableOptions()) {
    System.err.println("String_Node_Str" + o.toString(15));
  }
  System.err.println("String_Node_Str");
  if (dumpConfig)   System.err.println("String_Node_Str" + Config.instance().dumpConfiguration(4));
  System.exit(1);
}

Fixed version (ground truth):
public void exitUsage(boolean dumpConfig){
  printUsage(dumpConfig);
  System.exit(1);
}
Program: 187034
Project: 187034
Buggy source:
@Override public void appendDeclarations(NTASystem system,String NUM_METHODS){
  super.appendDeclarations(system,NUM_METHODS);
  system.appendDeclaration(String.format("String_Node_Str",NUM_METHODS,initNumBlocks()));
  system.appendDeclaration(String.format("String_Node_Str",NUM_METHODS,cache.getNumBlocks(),initCache(NUM_METHODS)));
  system.appendDeclaration(String.format("String_Node_Str"));
  system.appendDeclaration("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + cache.getNumBlocks() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ (cache.getNumBlocks() - 1)+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
@Override public void appendDeclarations(NTASystem system,String NUM_METHODS){
  super.appendDeclarations(system,NUM_METHODS);
  system.appendDeclaration(String.format("String_Node_Str",NUM_METHODS,initNumBlocks()));
  system.appendDeclaration(String.format("String_Node_Str",NUM_METHODS,cache.getNumBlocks(),initCache(NUM_METHODS)));
  system.appendDeclaration(String.format("String_Node_Str"));
  system.appendDeclaration("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + cache.getNumBlocks() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ (cache.getNumBlocks() - 1)+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ NUM_METHODS+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}
Program: 187035
Project: 187035
Buggy source:
public static void main(String[] args){
  DFAAppInfo program=new DFAAppInfo(new DFAClassInfo());
  program.parseOptions(args);
  try {
    program.load();
  }
 catch (  IOException exc) {
    exc.printStackTrace();
  }
  System.out.println("String_Node_Str");
  long startTime=System.currentTimeMillis();
  ReceiverTypes rt=new ReceiverTypes();
  program.setReceivers(program.runAnalysis(rt));
  long rtTime=System.currentTimeMillis();
  System.out.println("String_Node_Str" + (rtTime - startTime));
  LoopBounds lb=new LoopBounds();
  program.runAnalysis(lb);
  lb.printResult(program);
  long lbTime=System.currentTimeMillis();
  System.out.println("String_Node_Str" + (lbTime - rtTime));
}

Fixed version (ground truth):
public static void main(String[] args){
  DFAAppInfo program=new DFAAppInfo(new DFAClassInfo());
  program.parseOptions(args);
  try {
    program.load();
  }
 catch (  IOException exc) {
    exc.printStackTrace();
  }
  System.out.println("String_Node_Str");
  long startTime=System.currentTimeMillis();
  ReceiverTypes rt=new ReceiverTypes();
  program.setReceivers(program.runAnalysis(rt));
  rt.printResult(program);
  long rtTime=System.currentTimeMillis();
  System.out.println("String_Node_Str" + (rtTime - startTime));
  LoopBounds lb=new LoopBounds();
  program.runAnalysis(lb);
  lb.printResult(program);
  long lbTime=System.currentTimeMillis();
  System.out.println("String_Node_Str" + (lbTime - rtTime));
}
Program: 187037
Project: 187037
Buggy source:
public ValueMapping(ValueMapping val,boolean full){
  assigned=new Interval(val.assigned);
  constrained=new Interval(val.constrained);
  if (full) {
    if (val.increment != null) {
      increment=new Interval(val.increment);
    }
 else {
      increment=null;
    }
    source=val.source;
    cnt=val.cnt;
  }
 else {
    increment=null;
    source=null;
    cnt=0;
  }
}

Fixed version (ground truth):
public ValueMapping(ValueMapping val,boolean full){
  assigned=new Interval(val.assigned);
  constrained=new Interval(val.constrained);
  if (full) {
    if (val.increment != null) {
      increment=new Interval(val.increment);
    }
 else {
      increment=null;
    }
    source=val.source;
    cnt=val.cnt;
    defscope=val.defscope;
    softinc=val.softinc;
  }
 else {
    increment=null;
    source=null;
    cnt=0;
    defscope=scope;
    softinc=false;
  }
}
Program: 187038
Project: 187038
Buggy source:
public void printResult(DFAAppInfo program){
  for (Iterator<InstructionHandle> i=bounds.keySet().iterator(); i.hasNext(); ) {
    InstructionHandle instr=i.next();
    ContextMap<List<HashedString>,Pair<ValueMapping>> r=bounds.get(instr);
    Context c=r.getContext();
    LineNumberTable lines=program.getMethod(c.method).getMethod().getLineNumberTable();
    int sourceLine=lines.getSourceLine(instr.getPosition());
    for (Iterator<List<HashedString>> k=r.keySet().iterator(); k.hasNext(); ) {
      List<HashedString> callString=k.next();
      Pair<ValueMapping> bounds=r.get(callString);
      LoopBounds.ValueMapping first=bounds.getFirst();
      LoopBounds.ValueMapping second=bounds.getSecond();
      System.out.println(c.method + "String_Node_Str" + sourceLine+ "String_Node_Str"+ callString+ "String_Node_Str");
      System.out.print("String_Node_Str");
      System.out.println(first);
      System.out.print("String_Node_Str");
      System.out.println(second);
      System.out.print("String_Node_Str");
      int val=ValueMapping.computeBound(first,second);
      if (val >= 0) {
        System.out.println(val);
      }
 else {
        System.out.println("String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
public void printResult(DFAAppInfo program){
  for (Iterator<InstructionHandle> i=bounds.keySet().iterator(); i.hasNext(); ) {
    InstructionHandle instr=i.next();
    ContextMap<List<HashedString>,Pair<ValueMapping>> r=bounds.get(instr);
    Context c=r.getContext();
    LineNumberTable lines=program.getMethod(c.method).getMethod().getLineNumberTable();
    int sourceLine=lines.getSourceLine(instr.getPosition());
    for (Iterator<List<HashedString>> k=r.keySet().iterator(); k.hasNext(); ) {
      List<HashedString> callString=k.next();
      Pair<ValueMapping> bounds=r.get(callString);
      LoopBounds.ValueMapping first=bounds.getFirst();
      LoopBounds.ValueMapping second=bounds.getSecond();
      System.out.println(c.method + "String_Node_Str" + sourceLine+ "String_Node_Str"+ callString+ "String_Node_Str"+ scopes.get(instr)+ "String_Node_Str");
      System.out.print("String_Node_Str");
      System.out.println(first);
      System.out.print("String_Node_Str");
      System.out.println(second);
      System.out.print("String_Node_Str");
      int val=getBound(program,instr);
      if (val >= 0) {
        System.out.println(val);
      }
 else {
        System.out.println("String_Node_Str");
      }
    }
  }
}
Program: 187040
Project: 187040
Buggy source:
public boolean equals(Object o){
  ValueMapping m=(ValueMapping)o;
  boolean inceq=false;
  if (increment == null && m.increment == null) {
    inceq=true;
  }
 else   if (increment == null || m.increment == null) {
    inceq=false;
  }
 else {
    inceq=increment.equals(m.increment);
  }
  return assigned.equals(m.assigned) && constrained.equals(m.constrained) && inceq;
}

Fixed version (ground truth):
public boolean equals(Object o){
  ValueMapping m=(ValueMapping)o;
  boolean inceq=false;
  if (increment == null && m.increment == null) {
    inceq=true;
  }
 else   if (increment == null || m.increment == null) {
    inceq=false;
  }
 else {
    inceq=increment.equals(m.increment);
  }
  return assigned.equals(m.assigned) && constrained.equals(m.constrained) && inceq&& softinc == m.softinc;
}
Program: 187041
Project: 187041
Buggy source:
public static int computeBound(ValueMapping first,ValueMapping second){
  if (first.increment == null || second.increment == null) {
    return -1;
  }
  if (!first.assigned.hasLb() || !first.assigned.hasUb() || !second.assigned.hasLb()|| !second.assigned.hasUb()) {
    return -1;
  }
  if (first.increment.getLb() * first.increment.getUb() <= 0 || second.increment.getLb() * second.increment.getUb() <= 0) {
    return -1;
  }
  int firstRange=first.assigned.getUb() - first.assigned.getLb() + 1;
  int secondRange=second.assigned.getUb() - second.assigned.getLb() + 1;
  if (firstRange < 0 || secondRange < 0) {
    return -1;
  }
  int firstBound;
  if (first.assigned.getUb() < first.assigned.getLb()) {
    firstBound=0;
  }
 else {
    firstBound=(int)Math.ceil((double)firstRange / Math.min(Math.abs(first.increment.getUb()),Math.abs(first.increment.getLb())));
  }
  int secondBound;
  if (second.assigned.getUb() < second.assigned.getLb()) {
    secondBound=0;
  }
 else {
    secondBound=(int)Math.ceil((double)secondRange / Math.min(Math.abs(second.increment.getUb()),Math.abs(second.increment.getLb())));
  }
  return Math.max(firstBound,secondBound);
}

Fixed version (ground truth):
public static int computeBound(ValueMapping first,ValueMapping second){
  if (first.increment == null || second.increment == null) {
    return -1;
  }
  if (!first.assigned.hasLb() || !first.assigned.hasUb() || !second.assigned.hasLb()|| !second.assigned.hasUb()) {
    return -1;
  }
  if (first.increment.getLb() * first.increment.getUb() <= 0 || second.increment.getLb() * second.increment.getUb() <= 0) {
    return -1;
  }
  int firstRange=first.assigned.getUb() - first.assigned.getLb() + 1;
  int secondRange=second.assigned.getUb() - second.assigned.getLb() + 1;
  int firstBound;
  if (first.assigned.getUb() < first.assigned.getLb()) {
    firstBound=0;
  }
 else {
    firstBound=(int)Math.ceil((double)firstRange / Math.min(Math.abs(first.increment.getUb()),Math.abs(first.increment.getLb())));
  }
  int secondBound;
  if (second.assigned.getUb() < second.assigned.getLb()) {
    secondBound=0;
  }
 else {
    secondBound=(int)Math.ceil((double)secondRange / Math.min(Math.abs(second.increment.getUb()),Math.abs(second.increment.getLb())));
  }
  return Math.max(firstBound,secondBound);
}
Program: 187042
Project: 187042
Buggy source:
public String toString(){
  return "String_Node_Str" + assigned + "String_Node_Str"+ constrained+ "String_Node_Str"+ source+ "String_Node_Str"+ cnt+ "String_Node_Str"+ increment+ "String_Node_Str";
}

Fixed version (ground truth):
public String toString(){
  return "String_Node_Str" + assigned + "String_Node_Str"+ constrained+ "String_Node_Str"+ source+ "String_Node_Str"+ cnt+ "String_Node_Str"+ increment+ "String_Node_Str"+ defscope+ "String_Node_Str"+ softinc+ "String_Node_Str";
}
Program: 187044
Project: 187044
Buggy source:
public int getBound(DFAAppInfo program,InstructionHandle instr){
  ContextMap<List<HashedString>,Pair<ValueMapping>> r=bounds.get(instr);
  if (r == null) {
    return -1;
  }
  int maxValue=-1;
  for (Iterator<List<HashedString>> k=r.keySet().iterator(); k.hasNext(); ) {
    List<HashedString> callString=k.next();
    Pair<ValueMapping> bounds=r.get(callString);
    LoopBounds.ValueMapping first=bounds.getFirst();
    LoopBounds.ValueMapping second=bounds.getSecond();
    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<List<HashedString>,Pair<ValueMapping>> r=bounds.get(instr);
  if (r == null) {
    return -1;
  }
  int maxValue=-1;
  for (Iterator<List<HashedString>> k=r.keySet().iterator(); k.hasNext(); ) {
    List<HashedString> 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;
}
Program: 187046
Project: 187046
Buggy source:
public static void main(String[] args){
  AppInfo program=new AppInfo(new ClassInfo());
  program.parseOptions(args);
  try {
    program.load();
  }
 catch (  IOException exc) {
    exc.printStackTrace();
  }
  ReceiverTypes rt=new ReceiverTypes();
  program.setReceivers(program.runAnalysis(rt));
  LoopBounds lb=new LoopBounds();
  program.runAnalysis(lb);
  lb.printResult(program);
}

Fixed version (ground truth):
public static void main(String[] args){
  DFAAppInfo program=new DFAAppInfo(new DFAClassInfo());
  program.parseOptions(args);
  try {
    program.load();
  }
 catch (  IOException exc) {
    exc.printStackTrace();
  }
  System.out.println("String_Node_Str");
  long startTime=System.currentTimeMillis();
  ReceiverTypes rt=new ReceiverTypes();
  program.setReceivers(program.runAnalysis(rt));
  long rtTime=System.currentTimeMillis();
  System.out.println("String_Node_Str" + (rtTime - startTime));
  LoopBounds lb=new LoopBounds();
  program.runAnalysis(lb);
  lb.printResult(program);
  long lbTime=System.currentTimeMillis();
  System.out.println("String_Node_Str" + (lbTime - rtTime));
}
Program: 187048
Project: 187048
Buggy source:
public void printResult(AppInfo program){
  for (Iterator<InstructionHandle> i=bounds.keySet().iterator(); i.hasNext(); ) {
    InstructionHandle instr=i.next();
    ContextMap<List<HashedString>,Pair<ValueMapping>> r=bounds.get(instr);
    Context c=r.getContext();
    LineNumberTable lines=program.getMethod(c.method).getMethod().getLineNumberTable();
    int sourceLine=lines.getSourceLine(instr.getPosition());
    for (Iterator<List<HashedString>> k=r.keySet().iterator(); k.hasNext(); ) {
      List<HashedString> callString=k.next();
      Pair<ValueMapping> bounds=r.get(callString);
      LoopBounds.ValueMapping first=bounds.getFirst();
      LoopBounds.ValueMapping second=bounds.getSecond();
      System.out.println(c.method + "String_Node_Str" + sourceLine+ "String_Node_Str"+ callString+ "String_Node_Str");
      System.out.print("String_Node_Str");
      System.out.println(first);
      System.out.print("String_Node_Str");
      System.out.println(second);
      System.out.print("String_Node_Str");
      int val=ValueMapping.computeBound(first,second);
      if (val >= 0) {
        System.out.println(val);
      }
 else {
        System.out.println("String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
public void printResult(DFAAppInfo program){
  for (Iterator<InstructionHandle> i=bounds.keySet().iterator(); i.hasNext(); ) {
    InstructionHandle instr=i.next();
    ContextMap<List<HashedString>,Pair<ValueMapping>> r=bounds.get(instr);
    Context c=r.getContext();
    LineNumberTable lines=program.getMethod(c.method).getMethod().getLineNumberTable();
    int sourceLine=lines.getSourceLine(instr.getPosition());
    for (Iterator<List<HashedString>> k=r.keySet().iterator(); k.hasNext(); ) {
      List<HashedString> callString=k.next();
      Pair<ValueMapping> bounds=r.get(callString);
      LoopBounds.ValueMapping first=bounds.getFirst();
      LoopBounds.ValueMapping second=bounds.getSecond();
      System.out.println(c.method + "String_Node_Str" + sourceLine+ "String_Node_Str"+ callString+ "String_Node_Str");
      System.out.print("String_Node_Str");
      System.out.println(first);
      System.out.print("String_Node_Str");
      System.out.println(second);
      System.out.print("String_Node_Str");
      int val=ValueMapping.computeBound(first,second);
      if (val >= 0) {
        System.out.println(val);
      }
 else {
        System.out.println("String_Node_Str");
      }
    }
  }
}
Program: 187050
Project: 187050
Buggy source:
public int getBound(AppInfo program,InstructionHandle instr){
  ContextMap<List<HashedString>,Pair<ValueMapping>> r=bounds.get(instr);
  if (r == null) {
    return -1;
  }
  int maxValue=-1;
  for (Iterator<List<HashedString>> k=r.keySet().iterator(); k.hasNext(); ) {
    List<HashedString> callString=k.next();
    Pair<ValueMapping> bounds=r.get(callString);
    LoopBounds.ValueMapping first=bounds.getFirst();
    LoopBounds.ValueMapping second=bounds.getSecond();
    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<List<HashedString>,Pair<ValueMapping>> r=bounds.get(instr);
  if (r == null) {
    return -1;
  }
  int maxValue=-1;
  for (Iterator<List<HashedString>> k=r.keySet().iterator(); k.hasNext(); ) {
    List<HashedString> callString=k.next();
    Pair<ValueMapping> bounds=r.get(callString);
    LoopBounds.ValueMapping first=bounds.getFirst();
    LoopBounds.ValueMapping second=bounds.getSecond();
    int val=ValueMapping.computeBound(first,second);
    if (val < 0) {
      return -1;
    }
 else {
      maxValue=Math.max(maxValue,val);
    }
  }
  return maxValue;
}
Program: 187052
Project: 187052
Buggy source:
public void printResult(AppInfo program){
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public void printResult(DFAAppInfo program){
  System.out.println("String_Node_Str");
}
Program: 187055
Project: 187055
Buggy source:
public void printHelp(PrintStream out){
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}

Fixed version (ground truth):
public void printHelp(PrintStream out){
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  out.println("String_Node_Str");
}
Program: 187059
Project: 187059
Buggy source:
/** 
 * Inline an invocation. This also sets the accessed fields to public if needed. The graph modified flag must be set, and the graph features must be updated correctly. This can be done by calling   {@link #setGraphModified(com.jopdesign.libgraph.cfg.ControlFlowGraph)}.
 * @see #findInlines
 * @see #checkSize(CheckResult,int)
 * @see #changeToPublic(java.util.Collection)
 * @param check the checkresult of the invocation to inline.
 * @return an inlineresult.
 */
public InlineResult doInline(CheckResult check) throws ActionException {
  changeToPublic(check.getChangePublic());
  InlineResult result;
  try {
    result=inliner.doInline(check);
  }
 catch (  GraphException e) {
    throw new ActionException("String_Node_Str",e);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Inline an invocation. This also sets the accessed fields to public if needed. The graph modified flag must be set, and the graph features must be updated correctly. This can be done by calling   {@link #setGraphModified(com.jopdesign.libgraph.cfg.ControlFlowGraph)}.
 * @see #findInlines
 * @see #checkSize(CheckResult,int)
 * @see #changeToPublic(java.util.Collection)
 * @param check the checkresult of the invocation to inline.
 * @return an inlineresult.
 */
public InlineResult doInline(CheckResult check) throws ActionException {
  changeToPublic(check.getChangePublic());
  InlineResult result;
  try {
    result=inliner.doInline(check);
  }
 catch (  GraphException e) {
    throw new ActionException("String_Node_Str" + check.getInvokedMethod().getFQMethodName() + "String_Node_Str",e);
  }
  return result;
}
Program: 187060
Project: 187060
Buggy source:
/** 
 * Consume all command line options and turn them into properties.<br/> <p>The arguments are processed as follows: If an argument is of the form "-option" or "--option", it is considered to be an option. If an argument is an option, the next argument is considered to be the parameter, and we add the pair to our properties, consuming both arguments. The first non-option or the argument string   {@code --} terminates the option list.
 * @param argv The argument list
 * @param options The properties to update
 * @return An array of unconsumed arguments
 */
public String[] consumeOptions(String[] argv){
  int i=0;
  Vector<String> rest=new Vector<String>();
  while (i + 1 < argv.length && argv[i].startsWith("String_Node_Str") && !(argv[i].equals("String_Node_Str") || argv[i].equals("String_Node_Str"))) {
    String key, val;
    if (argv[i].charAt(1) == '-')     key=argv[i].substring(2);
 else     key=argv[i].substring(1);
    val=argv[i + 1];
    if (optionSet.containsKey(key)) {
      options.put(key,val);
    }
 else {
      rest.add(argv[i]);
      rest.add(argv[i + 1]);
    }
    i+=2;
  }
  for (; i < argv.length; i++)   rest.add(argv[i]);
  return rest.toArray(argv);
}

Fixed version (ground truth):
/** 
 * Consume all command line options and turn them into properties.<br/> <p>The arguments are processed as follows: If an argument is of the form "-option" or "--option", it is considered to be an option. If an argument is an option, the next argument is considered to be the parameter, and we add the pair to our properties, consuming both arguments. The first non-option or the argument string   {@code --} terminates the option list.
 * @param argv The argument list
 * @param options The properties to update
 * @return An array of unconsumed arguments
 */
public String[] consumeOptions(String[] argv){
  int i=0;
  Vector<String> rest=new Vector<String>();
  while (i + 1 < argv.length && argv[i].startsWith("String_Node_Str") && !(argv[i].equals("String_Node_Str") || argv[i].equals("String_Node_Str"))) {
    String key, val;
    if (argv[i].charAt(1) == '-')     key=argv[i].substring(2);
 else     key=argv[i].substring(1);
    val=argv[i + 1];
    if (optionSet.containsKey(key)) {
      options.put(key,val);
    }
 else {
      System.err.println("String_Node_Str" + key + "String_Node_Str"+ Arrays.toString(argv));
      rest.add(key);
      rest.add(val);
    }
    i+=2;
  }
  for (; i < argv.length; i++)   rest.add(argv[i]);
  String[] restArray=new String[rest.size()];
  return rest.toArray(restArray);
}
Program: 187061
Project: 187061
Buggy source:
private static void exitUsage(){
  System.err.println("String_Node_Str" + "String_Node_Str" + CONFIG_FILE_PROP + "String_Node_Str"+ WCETAnalysis.class.getCanonicalName()+ "String_Node_Str");
  System.err.println("String_Node_Str" + "String_Node_Str" + CONFIG_FILE_PROP + "String_Node_Str"+ WCETAnalysis.class.getName()+ "String_Node_Str"+ CacheConfig.BLOCK_SIZE+ "String_Node_Str"+ "String_Node_Str"+ Config.ROOT_CLASS_NAME+ "String_Node_Str");
  System.err.print("String_Node_Str");
  System.err.println("String_Node_Str");
  for (  Option o : Config.availableOptions()) {
    System.err.println("String_Node_Str" + o.toString(15));
  }
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str" + Config.instance().getOptions());
  System.err.println("String_Node_Str" + System.getProperties());
  System.exit(1);
}

Fixed version (ground truth):
private static void exitUsage(){
  System.err.println("String_Node_Str" + "String_Node_Str" + CONFIG_FILE_PROP + "String_Node_Str"+ WCETAnalysis.class.getCanonicalName()+ "String_Node_Str");
  System.err.println("String_Node_Str" + "String_Node_Str" + CONFIG_FILE_PROP + "String_Node_Str"+ WCETAnalysis.class.getName()+ "String_Node_Str"+ CacheConfig.BLOCK_SIZE+ "String_Node_Str"+ "String_Node_Str"+ Config.ROOT_CLASS_NAME+ "String_Node_Str");
  System.err.print("String_Node_Str");
  System.err.println("String_Node_Str");
  for (  Option o : Config.availableOptions()) {
    System.err.println("String_Node_Str" + o.toString(15));
  }
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str" + Config.instance().getOptions());
  System.exit(1);
}
Program: 187062
Project: 187062
Buggy source:
/** 
 * @param args
 */
private static void loadConfig(String[] args){
  try {
    String[] argsrest=Config.load(System.getProperty(CONFIG_FILE_PROP),args);
    Config c=Config.instance();
    if (argsrest.length != 0 || c.helpRequested())     exitUsage();
    tlLogger.info("String_Node_Str" + Config.instance().getOptions());
    c.checkOptions();
    if (Config.instance().hasReportDir()) {
      tlLogger.info("String_Node_Str");
      Config.instance().initializeReport();
    }
  }
 catch (  MissingConfigurationError e) {
    System.err.println("String_Node_Str" + e.getMessage());
    exitUsage();
  }
catch (  BadConfigurationError e) {
    System.err.println("String_Node_Str" + e.getMessage());
    exitUsage();
  }
catch (  Exception e) {
    e.printStackTrace();
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    System.exit(1);
  }
}

Fixed version (ground truth):
/** 
 * @param args
 */
private static void loadConfig(String[] args){
  try {
    String[] argsrest=Config.load(System.getProperty(CONFIG_FILE_PROP),args);
    Config c=Config.instance();
    if (c.helpRequested())     exitUsage();
    if (argsrest.length != 0) {
      System.err.println("String_Node_Str" + Arrays.toString(argsrest));
      exitUsage();
    }
    tlLogger.info("String_Node_Str" + Config.instance().getOptions());
    c.checkOptions();
    if (Config.instance().hasReportDir()) {
      tlLogger.info("String_Node_Str");
      Config.instance().initializeReport();
    }
  }
 catch (  MissingConfigurationError e) {
    System.err.println("String_Node_Str" + e.getMessage());
    exitUsage();
  }
catch (  BadConfigurationError e) {
    System.err.println("String_Node_Str" + e.getMessage());
    exitUsage();
  }
catch (  Exception e) {
    e.printStackTrace();
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    System.exit(1);
  }
}
Program: 187064
Project: 187064
Buggy source:
/** 
 * Find a local variable based on an entry in the LocalVariableTable attribute.
 * @see http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#5956
 * @param index
 * @param pc
 * @return local variable type and name or "NA"
 */
public String getLocalVarName(int index,int pc){
  LocalVariableTable lvt=mi.getMethod().getLocalVariableTable();
  String lvName="String_Node_Str";
  boolean match=false;
  if (lvt != null) {
    LocalVariable[] lva=lvt.getLocalVariableTable();
    for (int i=0; i < lva.length; i++) {
      LocalVariable lv=lva[i];
      if (lv.getIndex() == index) {
        if (pc >= lv.getStartPC()) {
          if (pc <= lv.getStartPC() + lv.getLength()) {
            lvName=lv.getSignature() + "String_Node_Str" + lv.getName();
            if (match) {
              System.out.println("String_Node_Str");
              System.exit(-1);
            }
            match=true;
          }
        }
      }
    }
  }
  return lvName;
}

Fixed version (ground truth):
/** 
 * Find a local variable based on an entry in the LocalVariableTable attribute.
 * @see http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#5956
 * @param index
 * @param pc
 * @return local variable type and name or "NA"
 */
public String getLocalVarName(int index,int pc){
  LocalVariableTable lvt=mi.getMethod().getLocalVariableTable();
  String lvName="String_Node_Str";
  boolean match=false;
  if (lvt != null) {
    LocalVariable[] lva=lvt.getLocalVariableTable();
    for (int i=0; i < lva.length; i++) {
      LocalVariable lv=lva[i];
      if (lv.getIndex() == index) {
        if (pc >= lv.getStartPC()) {
          if (pc <= lv.getStartPC() + lv.getLength()) {
            if (match && !lvName.equals(lv.getSignature() + "String_Node_Str" + lv.getName())) {
              System.out.println("String_Node_Str");
              System.exit(-1);
            }
            lvName=lv.getSignature() + "String_Node_Str" + lv.getName();
            match=true;
          }
        }
      }
    }
  }
  return lvName;
}
Program: 187065
Project: 187065
Buggy source:
/** 
 * Method getFunctionOutput, which will return the functional output for point represented by a input vector only.
 * @param xtest -the input vector
 * @return the functinal output
 */
static public int getFunctionOutputTestPointFP(int[] xtest){
  int functionalOutput_fp=0;
  int[][] data_fp_local=data_fp;
  int m=data_fp_local.length;
  int n=xtest.length;
  for (int i=0; i < m; i++) {
    if (alpha_fp[i] > 0) {
      while (n != 0) {
        n=n - 1;
        functionalOutput_fp+=(data_fp_local[m][n] >> 8) * (xtest[n] >> 8);
      }
    }
  }
  functionalOutput_fp-=bias_fp;
  return functionalOutput_fp;
}

Fixed version (ground truth):
/** 
 * Method getFunctionOutput, which will return the functional output for point represented by a input vector only.
 * @param xtest -the input vector
 * @return the functinal output
 */
static public int getFunctionOutputTestPointFP(int[] xtest){
  int functionalOutput_fp=0;
  int[][] data_fp_local=data_fp;
  int m=data_fp_local.length;
  int n=xtest.length;
  int n2=data_fp_local[0].length;
  for (int i=0; i < m; i++) {
    if (alpha_fp[i] > 0) {
      n=xtest.length;
      while (n != 0) {
        n=n - 1;
        functionalOutput_fp+=(data_fp_local[i][n] >> 8) * (xtest[n] >> 8);
      }
    }
  }
  functionalOutput_fp-=bias_fp;
  return functionalOutput_fp;
}
Program: 187069
Project: 187069
Buggy source:
public int size(){
  return variables.size();
}

Fixed version (ground truth):
public int size(){
  return variables.size() + 1;
}
Program: 187070
Project: 187070
Buggy source:
protected void compileGraph(ControlFlowGraph graph) throws GraphException {
  ConstantPoolGen cpg=methodInfo.getConstantPoolGen();
  BcelGraphCompiler compiler=new BcelGraphCompiler(methodInfo.getClassInfo(),cpg);
  method=compiler.compile(graph,methodInfo.getClassInfo().getClassName(),method);
  methodInfo.setMethod(method);
}

Fixed version (ground truth):
protected void compileGraph(ControlFlowGraph graph) throws GraphException {
  ConstantPoolGen cpg=methodInfo.getConstantPoolGen();
  ClassInfo classInfo=methodInfo.getClassInfo();
  BcelGraphCompiler compiler=new BcelGraphCompiler(classInfo,cpg);
  method=compiler.compile(graph,classInfo.getClassName(),method);
  methodInfo.setMethod(method);
}
Program: 187072
Project: 187072
Buggy source:
public StmtHandle processStatement(StmtHandle stmt){
  PutfieldStmt put=(PutfieldStmt)stmt.getStatement();
  StmtHandle nextStmt=stmt.getNext();
  if (nextStmt == null || !(nextStmt.getStatement() instanceof GetfieldStmt)) {
    return null;
  }
  GetfieldStmt get=(GetfieldStmt)nextStmt.getStatement();
  if (!get.getConstantField().equals(put.getConstantField())) {
    return null;
  }
  if (get.getConstantField().isAnonymous() || get.getConstantField().getFieldInfo().isVolatile()) {
    return null;
  }
  stmt.setStatement(new StackDup(put.getConstantField().getFieldInfo().getType()));
  nextStmt.setStatement(put);
  return nextStmt;
}

Fixed version (ground truth):
public StmtHandle processStatement(StmtHandle stmt){
  PutfieldStmt put=(PutfieldStmt)stmt.getStatement();
  StmtHandle nextStmt=stmt.getNext();
  if (nextStmt == null || !(nextStmt.getStatement() instanceof GetfieldStmt)) {
    return null;
  }
  GetfieldStmt get=(GetfieldStmt)nextStmt.getStatement();
  if (!get.getConstantField().equals(put.getConstantField())) {
    return null;
  }
  if (get.getConstantField().isAnonymous() || get.getConstantField().getFieldInfo().isVolatile()) {
    return null;
  }
  if (!get.isStatic() || !put.isStatic()) {
    return null;
  }
  stmt.setStatement(new StackDup(put.getConstantField().getFieldInfo().getType()));
  nextStmt.setStatement(put);
  return nextStmt;
}
Program: 187073
Project: 187073
Buggy source:
static void markAndCopy(){
  int i, ref;
  getStaticRoots();
  if (!concurrentGc) {
    getStackRoots();
  }
  for (; ; ) {
synchronized (mutex) {
      ref=greyList;
      if (ref == GREY_END) {
        break;
      }
      greyList=Native.rdMem(ref + OFF_GREY);
      Native.wrMem(0,ref + OFF_GREY);
    }
    if (Native.rdMem(ref + OFF_SPACE) == toSpace) {
      continue;
    }
    int addr=Native.rdMem(ref);
    int flags=Native.rdMem(ref + OFF_TYPE);
    if (flags == IS_REFARR) {
      int size=Native.rdMem(ref + OFF_MTAB_ALEN);
      for (i=0; i < size; ++i) {
        push(Native.rdMem(addr + i));
      }
    }
 else     if (flags == IS_OBJ) {
      flags=Native.rdMem(ref + OFF_MTAB_ALEN);
      flags=Native.rdMem(flags + Const.MTAB2GC_INFO);
      for (i=0; flags != 0; ++i) {
        if ((flags & 1) != 0) {
          push(Native.rdMem(addr + i));
        }
        flags>>>=1;
      }
    }
    int size;
    int dest;
synchronized (mutex) {
      size=Native.rdMem(ref + OFF_SIZE);
      dest=copyPtr;
      copyPtr+=size;
      Native.wrMem(toSpace,ref + OFF_SPACE);
    }
    if (size > 0) {
      for (i=0; i < size; i++) {
        Native.memCopy(dest,addr,i);
      }
    }
    Native.wrMem(dest,ref + OFF_PTR);
    for (i=0; i < 10; i++)     ;
    Native.memCopy(dest,dest,-1);
  }
}

Fixed version (ground truth):
static void markAndCopy(){
  int i, ref;
  if (!concurrentGc) {
    getStackRoots();
  }
  getStaticRoots();
  for (; ; ) {
synchronized (mutex) {
      ref=greyList;
      if (ref == GREY_END) {
        break;
      }
      greyList=Native.rdMem(ref + OFF_GREY);
      Native.wrMem(0,ref + OFF_GREY);
    }
    if (Native.rdMem(ref + OFF_SPACE) == toSpace) {
      continue;
    }
    int addr=Native.rdMem(ref);
    int flags=Native.rdMem(ref + OFF_TYPE);
    if (flags == IS_REFARR) {
      int size=Native.rdMem(ref + OFF_MTAB_ALEN);
      for (i=0; i < size; ++i) {
        push(Native.rdMem(addr + i));
      }
    }
 else     if (flags == IS_OBJ) {
      flags=Native.rdMem(ref + OFF_MTAB_ALEN);
      flags=Native.rdMem(flags + Const.MTAB2GC_INFO);
      for (i=0; flags != 0; ++i) {
        if ((flags & 1) != 0) {
          push(Native.rdMem(addr + i));
        }
        flags>>>=1;
      }
    }
    int size;
    int dest;
synchronized (mutex) {
      size=Native.rdMem(ref + OFF_SIZE);
      dest=copyPtr;
      copyPtr+=size;
      Native.wrMem(toSpace,ref + OFF_SPACE);
    }
    if (size > 0) {
      for (i=0; i < size; i++) {
        Native.memCopy(dest,addr,i);
      }
    }
    Native.wrMem(dest,ref + OFF_PTR);
    for (i=0; i < 10; i++)     ;
    Native.memCopy(dest,dest,-1);
  }
}
Program: 187074
Project: 187074
Buggy source:
public void initArchitecture(String arch) throws ConfigurationException {
  if ("String_Node_Str".equals(arch)) {
    URL config=getClass().getResource("String_Node_Str");
    setArchConfig(config);
  }
 else   if ("String_Node_Str".equals(arch)) {
    URL config=getClass().getResource("String_Node_Str");
    setArchConfig(config);
    if (!isSet(CONF_LIBRARY_PATH)) {
      setOption(CONF_LIBRARY_PATH,"String_Node_Str");
    }
  }
 else {
    throw new ConfigurationException("String_Node_Str" + arch + "String_Node_Str");
  }
}

Fixed version (ground truth):
public void initArchitecture(String arch) throws ConfigurationException {
  if ("String_Node_Str".equals(arch)) {
    URL config=getClass().getResource("String_Node_Str");
    if (config == null) {
      throw new ConfigurationException("String_Node_Str");
    }
    setArchConfig(config);
  }
 else   if ("String_Node_Str".equals(arch)) {
    URL config=getClass().getResource("String_Node_Str");
    if (config == null) {
      throw new ConfigurationException("String_Node_Str");
    }
    setArchConfig(config);
    if (!isSet(CONF_LIBRARY_PATH)) {
      setOption(CONF_LIBRARY_PATH,"String_Node_Str");
    }
  }
 else {
    throw new ConfigurationException("String_Node_Str" + arch + "String_Node_Str");
  }
}
Program: 187076
Project: 187076
Buggy source:
public void changeToPublic(Collection changePublic){
  for (Iterator it=changePublic.iterator(); it.hasNext(); ) {
    ModifierInfo mod=(ModifierInfo)it.next();
    if (mod instanceof MethodInfo && mod.isPrivate() && !((MethodInfo)mod).getName().equals("String_Node_Str")) {
      mod.setFinal(true);
    }
    mod.setAccessType(ModifierInfo.ACC_PUBLIC);
  }
}

Fixed version (ground truth):
public boolean changeToPublic(Collection changePublic){
  for (Iterator it=changePublic.iterator(); it.hasNext(); ) {
    ModifierInfo mod=(ModifierInfo)it.next();
    if (mod instanceof MethodInfo && mod.isPrivate() && !((MethodInfo)mod).getName().equals("String_Node_Str")) {
      try {
        setVirtual((MethodInfo)mod);
      }
 catch (      GraphException e) {
        return false;
      }
      mod.setFinal(true);
    }
    mod.setAccessType(ModifierInfo.ACC_PUBLIC);
  }
  return true;
}
Program: 187077
Project: 187077
Buggy source:
public void dump(PrintWriter out,ClassInfo strcli,int arrygcinfo){
  int addr=stringTableAddress + startAddress;
  commentary(string,addr,out);
  out.println("String_Node_Str" + (addr + 4) + "String_Node_Str");
  out.println("String_Node_Str" + strcli.methodsAddress + "String_Node_Str");
  out.println("String_Node_Str" + (addr + 5) + "String_Node_Str");
  out.println("String_Node_Str" + string.length() + "String_Node_Str");
  out.println("String_Node_Str" + (addr + 2) + "String_Node_Str");
  byte chrsp[]=string.getBytes();
  out.print("String_Node_Str");
  for (int i=0; i < chrsp.length; i++) {
    out.print(chrsp[i] + "String_Node_Str");
    if ((i & 0x07) == 7) {
      out.println();
      out.print("String_Node_Str");
    }
  }
  out.println();
}

Fixed version (ground truth):
public void dump(PrintWriter out,ClassInfo strcli,int arrygcinfo){
  int addr=stringTableAddress + startAddress;
  commentary(string,addr,out);
  out.println("String_Node_Str" + (addr + 4) + "String_Node_Str");
  out.println("String_Node_Str" + strcli.methodsAddress + "String_Node_Str");
  out.println("String_Node_Str" + (addr + 5) + "String_Node_Str");
  out.println("String_Node_Str" + string.length() + "String_Node_Str");
  out.println("String_Node_Str" + (addr + 2) + "String_Node_Str");
  byte chrsp[]=null;
  try {
    chrsp=string.getBytes("String_Node_Str");
  }
 catch (  java.io.UnsupportedEncodingException e) {
    System.err.println(e);
    System.exit(-1);
  }
  out.print("String_Node_Str");
  for (int i=0; i < chrsp.length; i++) {
    out.print(chrsp[i] + "String_Node_Str");
    if ((i & 0x07) == 7) {
      out.println();
      out.print("String_Node_Str");
    }
  }
  out.println();
}
Program: 187078
Project: 187078
Buggy source:
/** 
 * Scan all thread stacks atomic.
 */
static void getStackRoots(){
  int i, j, cnt;
synchronized (mutex) {
    i=Native.getSP();
    for (j=128; j <= i; ++j) {
      push(Native.rdIntMem(j));
    }
    cnt=RtThreadImpl.getCnt();
    for (i=0; i < cnt; ++i) {
      if (i != RtThreadImpl.getActive()) {
        int[] mem=RtThreadImpl.getStack(i);
        int sp=RtThreadImpl.getSP(i) - 128;
        for (j=0; j <= sp; ++j) {
          push(mem[j]);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Scan all thread stacks atomic.
 */
static void getStackRoots(){
  int i, j, cnt;
synchronized (mutex) {
    i=Native.getSP();
    for (j=Const.STACK_OFF; j <= i; ++j) {
      push(Native.rdIntMem(j));
    }
    cnt=RtThreadImpl.getCnt();
    for (i=0; i < cnt; ++i) {
      if (i != RtThreadImpl.getActive()) {
        int[] mem=RtThreadImpl.getStack(i);
        int sp=RtThreadImpl.getSP(i) - Const.STACK_OFF;
        for (j=0; j <= sp; ++j) {
          push(mem[j]);
        }
      }
    }
  }
}
Program: 187079
Project: 187079
Buggy source:
public static void debug(){
synchronized (monitor) {
    int i, j;
    for (i=cnt - 1; i >= 0; --i) {
      util.Dbg.wr('\n');
      util.Dbg.intVal(ref[i].sp);
      util.Dbg.wr('\n');
      for (j=0; j <= ref[i].sp - 128; ++j) {
        util.Dbg.intVal(ref[i].stack[j]);
      }
      util.Dbg.wr('\n');
      trace(ref[i].stack,ref[i].sp);
    }
  }
}

Fixed version (ground truth):
public static void debug(){
synchronized (monitor) {
    int i, j;
    for (i=cnt - 1; i >= 0; --i) {
      util.Dbg.wr('\n');
      util.Dbg.intVal(ref[i].sp);
      util.Dbg.wr('\n');
      for (j=0; j <= ref[i].sp - Const.STACK_OFF; ++j) {
        util.Dbg.intVal(ref[i].stack[j]);
      }
      util.Dbg.wr('\n');
      trace(ref[i].stack,ref[i].sp);
    }
  }
}
Program: 187080
Project: 187080
Buggy source:
static void trace(int[] stack,int sp){
  int fp, mp, vp, addr, loc, args;
  int val;
  fp=sp - 4;
  while (fp > 128 + 5) {
    mp=stack[fp + 4 - 128];
    vp=stack[fp + 2 - 128];
    val=Native.rdMem(mp);
    addr=val >>> 10;
    util.Dbg.intVal(addr);
    val=Native.rdMem(mp + 1);
    args=val & 0x1f;
    loc=(val >>> 5) & 0x1f;
    fp=vp + args + loc;
  }
}

Fixed version (ground truth):
static void trace(int[] stack,int sp){
  int fp, mp, vp, addr, loc, args;
  int val;
  fp=sp - 4;
  while (fp > Const.STACK_OFF + 5) {
    mp=stack[fp + 4 - Const.STACK_OFF];
    vp=stack[fp + 2 - Const.STACK_OFF];
    val=Native.rdMem(mp);
    addr=val >>> 10;
    util.Dbg.intVal(addr);
    val=Native.rdMem(mp + 1);
    args=val & 0x1f;
    loc=(val >>> 5) & 0x1f;
    fp=vp + args + loc;
  }
}
Program: 187081
Project: 187081
Buggy source:
/** 
 * Set the "flags" field.
 * @param value
 */
public synchronized void setFlags(int value){
  arrayOutputStream.overwriteInt(value,FLAGS_INDEX);
}

Fixed version (ground truth):
/** 
 * Set the "flags" field.
 * @param value
 */
public synchronized void setFlags(int value){
  arrayOutputStream.overwriteByte(value,FLAGS_INDEX);
}
Program: 187082
Project: 187082
Buggy source:
/** 
 * Read a set of bytes from the stream. Limited from 1 until 4 bytes.
 * @param location
 * @param size
 * @return
 */
private synchronized int readBytes(int location,int size){
  int value;
  int i;
  if ((size < 1) || (size > 4) || (location + size >= buf.length)) {
    throw new ArrayIndexOutOfBoundsException("String_Node_Str" + location);
  }
  value=0;
  for (i=0; i < size; i++) {
    value<<=8;
    value=value | buf[location];
    location++;
  }
  return value;
}

Fixed version (ground truth):
/** 
 * Read a set of bytes from the stream. Limited from 1 until 4 bytes.
 * @param location
 * @param size
 * @return
 */
private synchronized int readBytes(int location,int size){
  int value;
  int i;
  if ((size < 1) || (size > 4) || (location + size > buf.length)) {
    throw new ArrayIndexOutOfBoundsException("String_Node_Str" + location + "String_Node_Str"+ size+ "String_Node_Str");
  }
  value=0;
  for (i=0; i < size; i++) {
    value<<=8;
    value=value | (buf[location] & 0x00ff);
    location++;
  }
  return value;
}
Program: 187083
Project: 187083
Buggy source:
/** 
 * Add a method to the table. Return its method ID.
 * @param method
 * @return
 */
public int addMethod(MethodInfo method){
  int methodId=method.getCodeAddress();
  if (isValidIndex(methodId) == false) {
    methodList.setSize(methodId + 1);
  }
  methodList.setElementAt(method,methodId);
  return methodId;
}

Fixed version (ground truth):
/** 
 * Add a method to the table. Return its method ID.
 * @param method
 * @return
 */
public int addMethod(MethodInfo method){
  int methodId=getMethodId(method);
  if (isValidIndex(methodId) == false) {
    methodList.setSize(methodId + 1);
  }
  methodList.setElementAt(method,methodId);
  return methodId;
}
Program: 187084
Project: 187084
Buggy source:
public int getMethodStructPointer(String className,String methodSignature){
  int methodId;
  MethodInfo methodInfo;
  methodInfo=getMethodInfo(className,methodSignature);
  methodId=methodInfo.getStructAddress();
  return methodId;
}

Fixed version (ground truth):
public int getMethodStructPointer(String className,String methodSignature){
  int methodStructPointer;
  MethodInfo methodInfo;
  methodInfo=getMethodInfo(className,methodSignature);
  methodStructPointer=methodInfo.getStructAddress();
  return methodStructPointer;
}