nus-yam/ex-repair huggingface dataset:
Program: 43899
Project: 43899
Buggy source:
/** 
 * This method returns the content of a text object
 * @param response
 * @return
 * @throws IllegalStateException
 * @throws IOException
 */
public static String getTextContent(HttpResponse response) throws IllegalStateException, IOException {
  JSONParser parser=new JSONParser();
  InputStream stream=response.getEntity().getContent();
  InputStreamReader is=new InputStreamReader(stream);
  ContainerFactory containerFactory=new ContainerFactory(){
    public List creatArrayContainer(){
      return new LinkedList();
    }
    public Map createObjectContainer(){
      return new LinkedHashMap();
    }
  }
;
  try {
    Map json=(Map)parser.parse(is,containerFactory);
    return json.get("String_Node_Str").toString();
  }
 catch (  ParseException pe) {
    System.err.println(pe.getMessage());
  }
 finally {
    stream.close();
    is.close();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * This method returns the content of a text object
 * @param response
 * @return
 * @throws IllegalStateException
 * @throws IOException
 * @throws ParseException
 */
public static String getTextContent(HttpResponse response) throws IOException, ParseException {
  JSONParser parser=new JSONParser();
  InputStream stream=response.getEntity().getContent();
  InputStreamReader is=new InputStreamReader(stream);
  ContainerFactory containerFactory=new ContainerFactory(){
    public List creatArrayContainer(){
      return new LinkedList();
    }
    public Map createObjectContainer(){
      return new LinkedHashMap();
    }
  }
;
  Map json=(Map)parser.parse(is,containerFactory);
  return json.get("String_Node_Str").toString();
}
Program: 43900
Project: 43900
Buggy source:
/** 
 * This method returns the content of a binary file decoded using Base64
 * @param response
 * @return
 * @throws IllegalStateException
 * @throws IOException
 */
public static Object getObjectContent(HttpResponse response) throws IllegalStateException, IOException {
  JSONParser parser=new JSONParser();
  InputStream stream=response.getEntity().getContent();
  InputStreamReader is=new InputStreamReader(stream);
  ContainerFactory containerFactory=new ContainerFactory(){
    public List creatArrayContainer(){
      return new LinkedList();
    }
    public Map createObjectContainer(){
      return new LinkedHashMap();
    }
  }
;
  try {
    Map json=(Map)parser.parse(is,containerFactory);
    String content=json.get("String_Node_Str").toString();
    Base64 decoder=new Base64();
    System.out.println(new String(decoder.decodeBase64(content)));
    return decoder.decodeBase64(content);
  }
 catch (  ParseException pe) {
    System.err.println(pe.getMessage());
  }
 finally {
    stream.close();
    is.close();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * This method returns the content of a binary file decoded using Base64
 * @param response
 * @return
 * @throws IllegalStateException
 * @throws IOException
 */
public static Object getObjectContent(HttpResponse response) throws IOException {
  JSONParser parser=new JSONParser();
  InputStream stream=response.getEntity().getContent();
  InputStreamReader is=new InputStreamReader(stream);
  Map json=null;
  parser=new JSONParser();
  stream=response.getEntity().getContent();
  is=new InputStreamReader(stream);
  ContainerFactory containerFactory=new ContainerFactory(){
    public List creatArrayContainer(){
      return new LinkedList();
    }
    public Map createObjectContainer(){
      return new LinkedHashMap();
    }
  }
;
  String content=json.get("String_Node_Str").toString();
  Base64 decoder=new Base64();
  return decoder.decodeBase64(content);
}
Program: 43902
Project: 43902
Buggy source:
@Configuration public static Option[] configuration(){
}

Fixed version (ground truth):
@Configuration public static Option[] configuration(){
  return options(felix(),mavenConfiguration(),wrappedBundle(mavenBundle("String_Node_Str","String_Node_Str").version("String_Node_Str")));
}
Program: 43903
Project: 43903
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void execute(){
  System.out.println("String_Node_Str" + input.getContainingType().toString());
  output=(PList<O>)CollectionFactory.listFromType(input.getContainingType().toString());
  if (end > start) {
    output.set(end - 1 - start,input.get(0));
  }
  cTask=ForTask.createFor(CPUDevice.rt,new aeminium.runtime.helpers.loops.Range(start,end),new ForBody<Integer>(){
    @Override public void iterate(    Integer line,    aeminium.runtime.Runtime rt,    Task current){
      O acc;
      if (reduceFun instanceof LambdaReducerWithSeed) {
        LambdaReducerWithSeed<O> red=(LambdaReducerWithSeed<O>)reduceFun;
        acc=red.getSeed();
        for (int i=line * outputSize; i < (line + 1) * outputSize; i++) {
          acc=reduceFun.combine(acc,input.get(i));
        }
      }
 else {
        acc=input.get(line * outputSize);
        for (int i=line * outputSize + 1; i < (line + 1) * outputSize; i++) {
          acc=reduceFun.combine(acc,input.get(i));
        }
      }
      output.set(line - start,acc);
    }
  }
,Runtime.NO_HINTS);
  CPUDevice.submit(cTask);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void execute(){
  output=(PList<O>)CollectionFactory.listFromType(input.getContainingType().getSimpleName());
  if (end > start) {
    output.set(end - 1 - start,input.get(0));
  }
  cTask=ForTask.createFor(CPUDevice.rt,new aeminium.runtime.helpers.loops.Range(start,end),new ForBody<Integer>(){
    @Override public void iterate(    Integer line,    aeminium.runtime.Runtime rt,    Task current){
      O acc;
      if (reduceFun instanceof LambdaReducerWithSeed) {
        LambdaReducerWithSeed<O> red=(LambdaReducerWithSeed<O>)reduceFun;
        acc=red.getSeed();
        for (int i=line * outputSize; i < (line + 1) * outputSize; i++) {
          acc=reduceFun.combine(acc,input.get(i));
        }
      }
 else {
        acc=input.get(line * outputSize);
        for (int i=line * outputSize + 1; i < (line + 1) * outputSize; i++) {
          acc=reduceFun.combine(acc,input.get(i));
        }
      }
      output.set(line - start,acc);
    }
  }
,Runtime.NO_HINTS);
  CPUDevice.submit(cTask);
}
Program: 43905
Project: 43905
Buggy source:
private static String sameOperationAs(String op){
  if (op.equals("String_Node_Str") || op.equals("String_Node_Str") || op.equals("String_Node_Str"))   return "String_Node_Str";
  return op;
}

Fixed version (ground truth):
private static String sameOperationAs(String op){
  if (op.equals("String_Node_Str") || op.equals("String_Node_Str") || op.equals("String_Node_Str")|| op.equals("String_Node_Str"))   return "String_Node_Str";
  if (op.equals("String_Node_Str"))   return "String_Node_Str";
  return op;
}
Program: 43906
Project: 43906
Buggy source:
private static long getInterpolatedValue(String prefix,int size,String sufix){
  int sb=1 * (int)Math.pow(10,("String_Node_Str" + size).length());
  int st=1 * (int)Math.pow(10,("String_Node_Str" + size).length() + 1);
  int cutPoint=Integer.parseInt(("String_Node_Str" + size).substring(0,1));
  long bottom=0;
  long top=0;
  try {
    bottom=getOrFail(prefix + sb + sufix);
  }
 catch (  Exception e) {
    return 0;
  }
  try {
    top=getOrFail(prefix + st + sufix);
    if (top == 0)     throw new Exception();
  }
 catch (  Exception e) {
    return bottom;
  }
  return (bottom * cutPoint + top * (10 - cutPoint)) / 10;
}

Fixed version (ground truth):
public static long getInterpolatedValue(String prefix,int size,String sufix){
  int sb=(int)Math.pow(10,Math.floor(Math.log10(size)));
  int st=(int)Math.pow(10,Math.ceil(Math.log10(size)));
  float cutPoint=size / ((float)st);
  long bottom=0;
  long top=0;
  try {
    bottom=getOrFail(prefix + sb + sufix);
  }
 catch (  Exception e) {
    return 0;
  }
  try {
    top=getOrFail(prefix + st + sufix);
    if (top == 0)     throw new Exception();
  }
 catch (  Exception e) {
    return bottom;
  }
  return (long)(bottom * cutPoint + top * (1 - cutPoint));
}
Program: 43907
Project: 43907
Buggy source:
private static long getCPUEstimation(int size,String code,String complexity,boolean isRange){
  long pTimeCPU=0;
  String[] parts=complexity.split("String_Node_Str");
  for (  String part : parts) {
    String[] kv=part.split("String_Node_Str");
    try {
      int times=Integer.parseInt(kv[0]);
      String v=kv[1];
      pTimeCPU+=times * (getInterpolatedValue("String_Node_Str",size,"String_Node_Str" + v));
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str" + part + "String_Node_Str"+ e);
      e.printStackTrace();
    }
  }
  return pTimeCPU;
}

Fixed version (ground truth):
public static long getCPUEstimation(int size,String code,String complexity,boolean isRange){
  long pTimeCPU=0;
  String[] parts=complexity.split("String_Node_Str");
  for (  String part : parts) {
    String[] kv=part.split("String_Node_Str");
    try {
      int times=Integer.parseInt(kv[0]);
      String v=kv[1];
      pTimeCPU+=times * (getInterpolatedValue("String_Node_Str",size,"String_Node_Str" + v));
    }
 catch (    Exception e) {
      System.out.println("String_Node_Str" + part + "String_Node_Str"+ e);
      e.printStackTrace();
    }
  }
  return pTimeCPU;
}
Program: 43908
Project: 43908
Buggy source:
private static long getGPUEstimation(int size,String code,String complexity,boolean isRange){
  long pTimeGPU=0;
  if (!isRange) {
    pTimeGPU+=getInterpolatedValue("String_Node_Str",size,"String_Node_Str");
  }
  pTimeGPU+=getInterpolatedValue("String_Node_Str",size,"String_Node_Str");
  String[] parts=complexity.split("String_Node_Str");
  for (  String part : parts) {
    String[] kv=part.split("String_Node_Str");
    try {
      int times=Integer.parseInt(kv[0]);
      String v=kv[1];
      pTimeGPU+=(getInterpolatedValue("String_Node_Str",size,"String_Node_Str" + v));
      pTimeGPU+=times * (getInterpolatedValue("String_Node_Str",size,"String_Node_Str" + v));
    }
 catch (    Exception e) {
      if (System.getenv("String_Node_Str") != null) {
        System.out.println("String_Node_Str" + part);
      }
    }
  }
  return pTimeGPU;
}

Fixed version (ground truth):
public static long getGPUEstimation(int size,String code,String complexity,boolean isRange){
  long pTimeGPU=0;
  if (!isRange) {
    pTimeGPU+=getInterpolatedValue("String_Node_Str",size,"String_Node_Str");
  }
  pTimeGPU+=getInterpolatedValue("String_Node_Str",size,"String_Node_Str");
  String[] parts=complexity.split("String_Node_Str");
  for (  String part : parts) {
    String[] kv=part.split("String_Node_Str");
    try {
      int times=Integer.parseInt(kv[0]);
      String v=kv[1];
      pTimeGPU+=(getInterpolatedValue("String_Node_Str",size,"String_Node_Str" + v));
      pTimeGPU+=times * (getInterpolatedValue("String_Node_Str",size,"String_Node_Str" + v));
    }
 catch (    Exception e) {
      if (System.getenv("String_Node_Str") != null) {
        System.out.println("String_Node_Str" + part);
      }
    }
  }
  return pTimeGPU;
}
Program: 43909
Project: 43909
Buggy source:
private static String sameOperationAs(String op){
  if (op.equals("String_Node_Str") || op.equals("String_Node_Str") || op.equals("String_Node_Str"))   return "String_Node_Str";
  return op;
}

Fixed version (ground truth):
private static String sameOperationAs(String op){
  if (op.equals("String_Node_Str") || op.equals("String_Node_Str") || op.equals("String_Node_Str")|| op.equals("String_Node_Str"))   return "String_Node_Str";
  return op;
}
Program: 43910
Project: 43910
Buggy source:
@Override public <T>CLBuffer<?> createInputBufferFor(CLContext context,PList<T> list){
  char[] ar=((CharList)list).getArray();
  CharBuffer ibuffer=CharBuffer.wrap(ar);
  ibuffer.put(ar,0,list.size());
  return context.createCharBuffer(CLMem.Usage.Input,ibuffer,true);
}

Fixed version (ground truth):
@Override public <T>CLBuffer<?> createInputBufferFor(CLContext context,PList<T> list){
  char[] ar=((CharList)list).getArray();
  CharBuffer ibuffer=CharBuffer.wrap(ar,0,list.size());
  return context.createCharBuffer(CLMem.Usage.Input,ibuffer,true);
}
Program: 43911
Project: 43911
Buggy source:
@Override public <T>CLBuffer<?> createInputBufferFor(CLContext context,PList<T> list){
  double[] ar=((DoubleList)list).getArray();
  DoubleBuffer ibuffer=DoubleBuffer.wrap(ar);
  return context.createDoubleBuffer(CLMem.Usage.Input,ibuffer,true);
}

Fixed version (ground truth):
@Override public <T>CLBuffer<?> createInputBufferFor(CLContext context,PList<T> list){
  double[] ar=((DoubleList)list).getArray();
  DoubleBuffer ibuffer=DoubleBuffer.wrap(ar,0,list.size());
  return context.createDoubleBuffer(CLMem.Usage.Input,ibuffer,true);
}
Program: 43912
Project: 43912
Buggy source:
@Override public <T>CLBuffer<?> createInputBufferFor(CLContext context,PList<T> list){
  float[] ar=((FloatList)list).getArray();
  FloatBuffer ibuffer=FloatBuffer.wrap(ar);
  ibuffer.put(ar,0,list.size());
  return context.createFloatBuffer(CLMem.Usage.Input,ibuffer,true);
}

Fixed version (ground truth):
@Override public <T>CLBuffer<?> createInputBufferFor(CLContext context,PList<T> list){
  float[] ar=((FloatList)list).getArray();
  FloatBuffer ibuffer=FloatBuffer.wrap(ar,0,list.size());
  return context.createFloatBuffer(CLMem.Usage.Input,ibuffer,true);
}
Program: 43913
Project: 43913
Buggy source:
@Override public <T>CLBuffer<?> createInputBufferFor(CLContext context,PList<T> list){
  int[] ar=((IntList)list).getArray();
  IntBuffer ibuffer=IntBuffer.wrap(ar);
  return context.createIntBuffer(CLMem.Usage.Input,ibuffer,true);
}

Fixed version (ground truth):
@Override public <T>CLBuffer<?> createInputBufferFor(CLContext context,PList<T> list){
  int[] ar=((IntList)list).getArray();
  IntBuffer ibuffer=IntBuffer.wrap(ar,0,list.size());
  return context.createIntBuffer(CLMem.Usage.Input,ibuffer,true);
}
Program: 43914
Project: 43914
Buggy source:
@Override public <T>CLBuffer<?> createInputBufferFor(CLContext context,PList<T> list){
  long[] ar=((LongList)list).getArray();
  LongBuffer ibuffer=LongBuffer.wrap(ar);
  ibuffer.put(ar,0,list.size());
  return context.createLongBuffer(CLMem.Usage.Input,ibuffer,true);
}

Fixed version (ground truth):
@Override public <T>CLBuffer<?> createInputBufferFor(CLContext context,PList<T> list){
  long[] ar=((LongList)list).getArray();
  LongBuffer ibuffer=LongBuffer.wrap(ar,0,list.size());
  return context.createLongBuffer(CLMem.Usage.Input,ibuffer,true);
}
Program: 43915
Project: 43915
Buggy source:
abstract public String getOtherSources();

Fixed version (ground truth):
public String getOtherSources(){
  return otherSources;
}
Program: 43916
Project: 43916
Buggy source:
public <O>boolean canMergeWithMap(Mapper<T,O> mapFun);

Fixed version (ground truth):
public <O>boolean canMergeWithMap(LambdaMapper<T,O> mapFun);
Program: 43917
Project: 43917
Buggy source:
@Override public <T>CLBuffer<?> createInputBufferFor(CLContext context,PList<T> list){
  char[] ar=((CharList)list).getArray();
  System.out.println("String_Node_Str" + ar.length);
  for (int i=0; i < list.size(); i++) {
    System.out.println("String_Node_Str" + i + "String_Node_Str"+ ar[i]);
  }
  CharBuffer ibuffer=CharBuffer.wrap(ar,0,list.size());
  return context.createCharBuffer(CLMem.Usage.Input,ibuffer,true);
}

Fixed version (ground truth):
@Override public <T>CLBuffer<?> createInputBufferFor(CLContext context,PList<T> list){
  char[] ar=((CharList)list).getArray();
  byte[] car=encodeCharToBytes(ar);
  ByteBuffer ibuffer=ByteBuffer.wrap(car,0,list.size());
  return context.createByteBuffer(CLMem.Usage.Input,ibuffer,true);
}
Program: 43918
Project: 43918
Buggy source:
@Override public PList<?> extractFromBuffer(CLBuffer<?> outbuffer,CLQueue q,CLEvent ev,int size){
  char[] content=new char[size];
  outbuffer.asCLCharBuffer().read(q,ev).get(content);
  System.out.println("String_Node_Str" + content.length);
  for (int i=0; i < size; i++) {
    System.out.println("String_Node_Str" + i + "String_Node_Str"+ content[i]);
  }
  return new CharList(content,size);
}

Fixed version (ground truth):
@Override public PList<?> extractFromBuffer(CLBuffer<?> outbuffer,CLQueue q,CLEvent ev,int size){
  byte[] pcontent=new byte[size];
  outbuffer.asCLByteBuffer().read(q,ev).get(pcontent);
  char[] content=decodeBytesToChar(pcontent);
  return new CharList(content,size);
}
Program: 43919
Project: 43919
Buggy source:
public void testMapCharToChar(){
  PList<Character> example=new CharList();
  for (int i=0; i < TEST_SIZE; i++) {
    example.add('h');
  }
  PList<Character> output=example.map(new LambdaMapper<Character,Character>(){
    @Override public Character map(    Character ch){
      return 'f';
    }
    public String getSource(){
      return "String_Node_Str";
    }
  }
);
  for (int i=0; i < TEST_SIZE; i++) {
    System.out.println("String_Node_Str" + (int)output.get(i));
  }
}

Fixed version (ground truth):
public void testMapCharToChar(){
  PList<Character> example=new CharList();
  for (int i=0; i < TEST_SIZE; i++) {
    example.add('h');
  }
  PList<Character> output=example.map(new LambdaMapper<Character,Character>(){
    @Override public Character map(    Character ch){
      return 'f';
    }
    public String getSource(){
      return "String_Node_Str";
    }
  }
);
  for (int i=0; i < TEST_SIZE; i++) {
    assertTrue(output.get(i).compareTo('f') == 0);
  }
}
Program: 43920
Project: 43920
Buggy source:
public DashStyleTemp getGridLineDashStyle(){
  return mGridLineDashStyle;
}

Fixed version (ground truth):
public DashStyle getGridLineDashStyle(){
  return mGridLineDashStyle;
}
Program: 43921
Project: 43921
Buggy source:
public Axis setGridLineDashStyle(DashStyleTemp pGridLineDashStyle){
  mGridLineDashStyle=pGridLineDashStyle;
  return this;
}

Fixed version (ground truth):
public Axis setGridLineDashStyle(DashStyle pGridLineDashStyle){
  mGridLineDashStyle=pGridLineDashStyle;
  return this;
}
Program: 43922
Project: 43922
Buggy source:
public Axis setMinorGridLineDashStyle(DashStyleTemp pMinorGridLineDashStyle){
  mMinorGridLineDashStyle=pMinorGridLineDashStyle;
  return this;
}

Fixed version (ground truth):
public Axis setMinorGridLineDashStyle(DashStyle pMinorGridLineDashStyle){
  mMinorGridLineDashStyle=pMinorGridLineDashStyle;
  return this;
}
Program: 43923
Project: 43923
Buggy source:
public DashStyleTemp getMinorGridLineDashStyle(){
  return mMinorGridLineDashStyle;
}

Fixed version (ground truth):
public DashStyle getMinorGridLineDashStyle(){
  return mMinorGridLineDashStyle;
}
Program: 43924
Project: 43924
Buggy source:
public PlotLine setDashStyle(DashStyleTemp pDashStyle){
  mDashStyle=pDashStyle;
  return this;
}

Fixed version (ground truth):
public PlotLine setDashStyle(DashStyle pDashStyle){
  mDashStyle=pDashStyle;
  return this;
}
Program: 43925
Project: 43925
Buggy source:
public DashStyleTemp getDashStyle(){
  return mDashStyle;
}

Fixed version (ground truth):
public DashStyle getDashStyle(){
  return mDashStyle;
}
Program: 43926
Project: 43926
Buggy source:
public DashStyle getGridLineDashStyle(){
  return mGridLineDashStyle;
}

Fixed version (ground truth):
public DashStyleTemp getGridLineDashStyle(){
  return mGridLineDashStyle;
}
Program: 43927
Project: 43927
Buggy source:
public Axis setGridLineDashStyle(DashStyle pGridLineDashStyle){
  mGridLineDashStyle=pGridLineDashStyle;
  return this;
}

Fixed version (ground truth):
public Axis setGridLineDashStyle(DashStyleTemp pGridLineDashStyle){
  mGridLineDashStyle=pGridLineDashStyle;
  return this;
}
Program: 43928
Project: 43928
Buggy source:
public Axis setMinorGridLineDashStyle(DashStyle pMinorGridLineDashStyle){
  mMinorGridLineDashStyle=pMinorGridLineDashStyle;
  return this;
}

Fixed version (ground truth):
public Axis setMinorGridLineDashStyle(DashStyleTemp pMinorGridLineDashStyle){
  mMinorGridLineDashStyle=pMinorGridLineDashStyle;
  return this;
}
Program: 43929
Project: 43929
Buggy source:
public DashStyle getMinorGridLineDashStyle(){
  return mMinorGridLineDashStyle;
}

Fixed version (ground truth):
public DashStyleTemp getMinorGridLineDashStyle(){
  return mMinorGridLineDashStyle;
}
Program: 43930
Project: 43930
Buggy source:
public PlotLine setDashStyle(DashStyle pDashStyle){
  mDashStyle=pDashStyle;
  return this;
}

Fixed version (ground truth):
public PlotLine setDashStyle(DashStyleTemp pDashStyle){
  mDashStyle=pDashStyle;
  return this;
}
Program: 43931
Project: 43931
Buggy source:
public DashStyle getDashStyle(){
  return mDashStyle;
}

Fixed version (ground truth):
public DashStyleTemp getDashStyle(){
  return mDashStyle;
}
Program: 43932
Project: 43932
Buggy source:
public JsonElement serialize(Object[] src,Type typeOfSrc,JsonSerializationContext context){
  System.out.println("String_Node_Str" + mParser.parse(mGson.toJson(src)).toString());
  return mParser.parse(mGson.toJson(src,typeOfSrc));
}

Fixed version (ground truth):
public JsonElement serialize(ISeries src,Type typeOfSrc,JsonSerializationContext context){
  return mParser.parse(mGson.toJson(src));
}
Program: 43933
Project: 43933
Buggy source:
public String toJson(){
  String json="String_Node_Str";
  json=gson.toJson(this);
  System.out.println(json);
  return json;
}

Fixed version (ground truth):
public String toJson(){
  String json="String_Node_Str";
  json=mGson.toJson(this);
  System.out.println(json);
  return json;
}
Program: 43934
Project: 43934
Buggy source:
SeriesSerializer(){
  GsonBuilder builder=new GsonBuilder().registerTypeAdapter(Object[].class,new ObjectArraySerializer(1)).setPrettyPrinting();
  mGson=builder.create();
}

Fixed version (ground truth):
SeriesSerializer(){
  GsonBuilder builder=new GsonBuilder().setPrettyPrinting();
  mGson=builder.create();
}
Program: 43935
Project: 43935
Buggy source:
ISeries<DataType> setName(String pName);

Fixed version (ground truth):
/** 
 * Sets the name of the series as shown in the legend, tooltip etc.
 * @param pName the name of the series as shown in the legend, tooltip etc
 * @return this object for convenient chaining, not a copy
 */
ISeries<DataType> setName(String pName);
Program: 43936
Project: 43936
Buggy source:
ISeries<DataType> setStack(String pStack);

Fixed version (ground truth):
/** 
 * Sets the stack identifier for a stacked chart. Series with the same stack identifier will be stacked together.
 * @param pStack the stack identifier for a stacked chart
 * @return this object for convenient chaining, not a copy
 */
ISeries<DataType> setStack(String pStack);
Program: 43937
Project: 43937
Buggy source:
ISeries<DataType> setXAxis(Integer pXAxis);

Fixed version (ground truth):
/** 
 * Sets the id of the connected xAxis. When using dual or multiple xAxes, this number defines which xAxis the particular series is connected to. It refers to the index of the axis in the xAxis array, which begins with 0.
 * @param pXAxis the id of the connected xAxis
 * @return this object for convenient chaining, not a copy
 */
ISeries<DataType> setXAxis(Integer pXAxis);
Program: 43938
Project: 43938
Buggy source:
Integer getYAxis();

Fixed version (ground truth):
/** 
 * Gets the id of the connected yAxis. When using dual or multiple yAxes, this number defines which yAxis the particular series is connected to. It refers to the index of the axis in the yAxis array, which begins with 0.
 * @return the id of the connected yAxis
 */
Integer getYAxis();
Program: 43939
Project: 43939
Buggy source:
String getName();

Fixed version (ground truth):
/** 
 * Gets the name of the series as shown in the legend, tooltip etc.
 * @return the name of the series as shown in the legend, tooltip etc
 */
String getName();
Program: 43940
Project: 43940
Buggy source:
Type getType();

Fixed version (ground truth):
/** 
 * Gets the type of this series. If this is set, the default type of your chart will be ignored for this series.
 * @return the type of this series.
 * @see com.comsysto.insight.model.options.Type
 */
Type getType();
Program: 43941
Project: 43941
Buggy source:
ISeries<DataType> setData(DataType pData);

Fixed version (ground truth):
/** 
 * Sets an array of data points for this series. The concrete implementation of this interface defines which kind of data is allowed, read its JavaDocs for detailed information. To see which data are generally supported by Highcharts, look at href="http://www.highcharts.com/ref/#series.
 * @param pData an array of data points for this series
 * @return this object for convenient chaining, not a copy
 */
ISeries<DataType> setData(DataType pData);
Program: 43942
Project: 43942
Buggy source:
String getStack();

Fixed version (ground truth):
/** 
 * Gets the stack identifier for a stacked chart. Series with the same stack identifier will be stacked together.
 * @return stack identifier for a stacked chart
 */
String getStack();
Program: 43943
Project: 43943
Buggy source:
Integer getXAxis();

Fixed version (ground truth):
/** 
 * Gets the id of the connected xAxis. When using dual or multiple xAxes, this number defines which xAxis the particular series is connected to. It refers to the index of the axis in the xAxis array, which begins with 0.
 * @return the id of the connected X-axis
 */
Integer getXAxis();
Program: 43944
Project: 43944
Buggy source:
ISeries<DataType> setType(Type pType);

Fixed version (ground truth):
/** 
 * Sets the type of this series. If you set this, the default type of your chart will be ignored for this series.
 * @param pType the type of this series
 * @return this object for convenient chaining, not a copy
 * @see com.comsysto.insight.model.options.Type
 */
ISeries<DataType> setType(Type pType);
Program: 43945
Project: 43945
Buggy source:
ISeries<DataType> setYAxis(Integer pYAxis);

Fixed version (ground truth):
/** 
 * Sets the id of the connected YAxis. When using dual or multiple YAxes, this number defines which xAxis the particular series is connected to. It refers to the index of the axis in the YAxis array, which begins with 0.
 * @param pYAxis the id of the connected yAxis
 * @return this object for convenient chaining, not a copy
 */
ISeries<DataType> setYAxis(Integer pYAxis);
Program: 43946
Project: 43946
Buggy source:
DataType getData();

Fixed version (ground truth):
/** 
 * Gets an array of data points for this series. The concrete implementation of this interface defines which kind of data is allowed, read its JavaDocs for detailed information. To see which data are generally supported by Highcharts, look at href="http://www.highcharts.com/ref/#series.
 * @return an array of data points for the series
 */
DataType getData();
Program: 43947
Project: 43947
Buggy source:
int indexupvalue(LuaString name,expdesc v){
  int i;
  for (i=0; i < f.nups; i++) {
    if (upvalues[i].k == v.k && upvalues[i].info == v.u.s.info) {
      _assert(f.upvalues[i] == name);
      return i;
    }
  }
  checklimit(f.nups + 1,LUAI_MAXUPVALUES,"String_Node_Str");
  if (f.upvalues == null || f.nups + 1 > f.upvalues.length)   f.upvalues=realloc(f.upvalues,f.nups * 2 + 1);
  f.upvalues[f.nups]=name;
  _assert(v.k == LexState.VLOCAL || v.k == LexState.VUPVAL);
  upvalues[f.nups]=new upvaldesc();
  upvalues[f.nups].k=(byte)(v.k);
  upvalues[f.nups].info=(byte)(v.u.s.info);
  return f.nups++;
}

Fixed version (ground truth):
int indexupvalue(LuaString name,expdesc v){
  int i;
  for (i=0; i < f.nups; i++) {
    if (upvalues[i].k == v.k && upvalues[i].info == v.u.s.info) {
      _assert(f.upvalues[i] == name);
      return i;
    }
  }
  checklimit(f.nups + 1,LUAI_MAXUPVALUES,"String_Node_Str");
  if (f.upvalues == null || f.nups + 1 > f.upvalues.length)   f.upvalues=realloc(f.upvalues,f.nups * 2 + 1);
  f.upvalues[f.nups]=name;
  _assert(v.k == LexState.VLOCAL || v.k == LexState.VUPVAL);
  upvalues[f.nups]=new upvaldesc();
  upvalues[f.nups].k=(short)(v.k);
  upvalues[f.nups].info=(short)(v.u.s.info);
  return f.nups++;
}
Program: 43948
Project: 43948
Buggy source:
private Varargs lines(final File f) throws Exception {
  IoLib iter=(IoLib)getClass().newInstance();
  iter.setfenv(f);
  return iter.bindv("String_Node_Str",LINES_ITER);
}

Fixed version (ground truth):
private Varargs lines(final File f){
  try {
    IoLib iter=(IoLib)getClass().newInstance();
    iter.setfenv(f);
    return iter.bindv("String_Node_Str",LINES_ITER);
  }
 catch (  Exception e) {
    return error("String_Node_Str" + e);
  }
}
Program: 43950
Project: 43950
Buggy source:
public static final LuaFunction getCallstackFunction(int level){
  return level >= 0 || level < running_thread.calls ? running_thread.callstack[running_thread.calls - level - 1] : null;
}

Fixed version (ground truth):
public static final LuaFunction getCallstackFunction(int level){
  return level > 0 || level < running_thread.calls ? running_thread.callstack[running_thread.calls - level - 1] : null;
}
Program: 43952
Project: 43952
Buggy source:
private void sethook(LuaState vm){
  LuaState threadVm=vm;
  if (vm.gettop() >= 4) {
    threadVm=vm.checkthread(2).vm;
    vm.remove(2);
  }
  LFunction func=vm.checkfunction(2);
  LString str=vm.checklstring(3);
  int count=vm.optint(4,0);
  int mask=0;
  for (int i=0; i < str.m_length; i++) switch (str.m_bytes[str.m_offset + i]) {
case 'c':
    mask|=LuaState.LUA_MASKCALL;
  break;
case 'l':
mask|=LuaState.LUA_MASKLINE;
break;
case 'r':
mask|=LuaState.LUA_MASKRET;
break;
}
threadVm.sethook(func,mask,count);
vm.resettop();
}

Fixed version (ground truth):
private void sethook(LuaState vm){
  LuaState threadVm=vm;
  if (vm.gettop() >= 4) {
    threadVm=vm.checkthread(2).vm;
    vm.remove(2);
  }
  LFunction func=vm.isnoneornil(2) ? null : vm.checkfunction(2);
  String str=vm.optstring(3,"String_Node_Str");
  int count=vm.optint(4,0);
  int mask=0;
  for (int i=0; i < str.length(); i++) switch (str.charAt(i)) {
case 'c':
    mask|=LuaState.LUA_MASKCALL;
  break;
case 'l':
mask|=LuaState.LUA_MASKLINE;
break;
case 'r':
mask|=LuaState.LUA_MASKRET;
break;
}
threadVm.sethook(func,mask,count);
vm.resettop();
}
Program: 43953
Project: 43953
Buggy source:
private void traceback(LuaState vm){
  LuaState threadVm=vm;
  int level=1;
  String message="String_Node_Str";
  StringBuffer sb=new StringBuffer();
  if (vm.gettop() >= 4) {
    threadVm=vm.checkthread(2).vm;
    vm.remove(2);
  }
  if (vm.gettop() >= 3)   level=vm.optint(3,1);
  if (vm.gettop() >= 2)   message=vm.tostring(2) + "String_Node_Str";
  message+=threadVm.getStackTrace(level);
  vm.resettop();
  vm.pushstring(sb.toString());
}

Fixed version (ground truth):
private void traceback(LuaState vm){
  LuaState threadVm=vm;
  int level=1;
  String message="String_Node_Str";
  if (vm.gettop() >= 4) {
    threadVm=vm.checkthread(2).vm;
    vm.remove(2);
  }
  if (vm.gettop() >= 3)   level=vm.optint(3,1);
  if (vm.gettop() >= 2)   message=vm.tostring(2) + "String_Node_Str";
  String trace=threadVm.getStackTrace(level - 1);
  if (trace.endsWith("String_Node_Str"))   trace=trace.substring(0,trace.length() - 1);
  vm.resettop();
  vm.pushstring(message + trace);
}
Program: 43954
Project: 43954
Buggy source:
private void debugReturnHooks(int pc){
  if (hookfunc != null && ((hookmask & LUA_MASKRET) != 0)) {
    debugCallHook(LUA_HOOKRET,debugGetLineNumber(calls[cc]));
    hookline=-1;
  }
}

Fixed version (ground truth):
private void debugReturnHooks(){
  if (hookfunc != null && ((hookmask & LUA_MASKRET) != 0)) {
    debugCallHook(LUA_HOOKRET,debugGetLineNumber(calls[cc]));
  }
}
Program: 43955
Project: 43955
Buggy source:
private int debugGetLineNumber(CallInfo ci){
  int[] lineNumbers=ci.closure.p.lineinfo;
  int pc=getCurrentPc(ci);
  int line=(lineNumbers != null && lineNumbers.length > pc ? lineNumbers[pc] : -1);
  return line;
}

Fixed version (ground truth):
public int debugGetLineNumber(CallInfo ci){
  int[] li=ci.closure.p.lineinfo;
  int pc=ci.pc - 1;
  if (li != null && pc >= 0 && pc < li.length)   return li[pc];
  return -1;
}
Program: 43956
Project: 43956
Buggy source:
private void debugCallHook(int mask,int newline){
  int prevmask=hookmask;
  try {
    hookmask=0;
    this.pushfunction(hookfunc);
switch (mask) {
default :
      this.pushstring("String_Node_Str");
    break;
case LUA_HOOKCOUNT:
  this.pushstring("String_Node_Str");
break;
case LUA_HOOKCALL:
this.pushstring("String_Node_Str");
break;
case LUA_HOOKRET:
this.pushstring("String_Node_Str");
break;
case LUA_HOOKTAILRET:
this.pushstring("String_Node_Str");
break;
}
this.pushinteger(newline);
this.pcall(2,0,0);
}
  finally {
hookmask=prevmask;
}
}

Fixed version (ground truth):
private void debugCallHook(int mask,int line){
  int prevmask=hookmask;
  int oldtop=top;
  LValue lineval=LNil.NIL;
  try {
    if (cc >= 0)     top=base + this.calls[cc].closure.p.maxstacksize;
    hookmask=0;
    this.pushfunction(hookfunc);
switch (mask) {
case LUA_HOOKCOUNT:
      this.pushstring("String_Node_Str");
    break;
case LUA_HOOKCALL:
  this.pushstring("String_Node_Str");
break;
case LUA_HOOKRET:
this.pushstring("String_Node_Str");
break;
case LUA_HOOKTAILRET:
this.pushstring("String_Node_Str");
break;
default :
lineval=LInteger.valueOf(line);
this.pushstring("String_Node_Str");
break;
}
this.pushlvalue(lineval);
this.pcall(2,0,0);
}
  finally {
hookmask=prevmask;
top=oldtop;
}
}
Program: 43957
Project: 43957
Buggy source:
private void debugBytecodeHooks(int pc){
  if (hookfunc != null && (hookmask & LUA_MASKLINE) != 0) {
    int line=debugGetLineNumber(calls[cc]);
    if (line != hookline) {
      hookline=line;
      debugCallHook(LUA_HOOKLINE,line);
    }
    if (hookcount != 0) {
      if (--hookincr <= 0) {
        hookincr=hookcount;
        debugCallHook(LUA_HOOKCOUNT,-1);
      }
    }
  }
}

Fixed version (ground truth):
private void debugBytecodeHooks(int pc){
  if (hookfunc != null && (hookmask & LUA_MASKLINE) != 0) {
    int line=debugGetLineNumber(calls[cc]);
    if ((line != hookline || cc != hookcc) && line >= 0) {
      hookline=line;
      hookcc=cc;
      debugCallHook(LUA_HOOKLINE,line);
    }
    if (hookcount != 0) {
      if (--hookincr <= 0) {
        hookincr=hookcount;
        debugCallHook(LUA_HOOKCOUNT,-1);
      }
    }
  }
}
Program: 43959
Project: 43959
Buggy source:
private void debugCallHooks(int pc){
  if (hookfunc != null && ((hookmask & LUA_MASKCALL) != 0)) {
    debugCallHook(LUA_HOOKCALL,debugGetLineNumber(calls[cc]));
    hookline=-1;
  }
}

Fixed version (ground truth):
private void debugCallHooks(){
  if (hookfunc != null && ((hookmask & LUA_MASKCALL) != 0)) {
    debugCallHook(LUA_HOOKCALL,debugGetLineNumber(calls[cc]));
  }
}
Program: 43960
Project: 43960
Buggy source:
private void debugTailReturnHooks(int pc){
  if (hookfunc != null && ((hookmask & LUA_MASKRET) != 0)) {
    debugCallHook(LUA_HOOKTAILRET,debugGetLineNumber(calls[cc]));
    hookline=-1;
  }
}

Fixed version (ground truth):
private void debugTailReturnHooks(){
  if (hookfunc != null && ((hookmask & LUA_MASKRET) != 0)) {
    debugCallHook(LUA_HOOKTAILRET,debugGetLineNumber(calls[cc]));
  }
}
Program: 43961
Project: 43961
Buggy source:
private void getlocal(LuaState vm){
  LuaState threadVm=vm;
  if (vm.gettop() >= 4) {
    threadVm=vm.checkthread(2).vm;
    vm.remove(2);
  }
  int level=vm.checkint(2);
  int local=vm.checkint(3);
  CallInfo ci=getcallinfo(vm,threadVm,level);
  LValue value=LNil.NIL;
  LValue name=LNil.NIL;
  LocVars[] vars=ci.closure.p.locvars;
  if (local > 0 && local <= ci.top - ci.base) {
    value=threadVm.stack[ci.base + local - 1];
    if (vars != null && local > 0 && local <= vars.length)     name=vars[local - 1].varname;
  }
  vm.resettop();
  vm.pushlvalue(name);
  vm.pushlvalue(value);
}

Fixed version (ground truth):
private void getlocal(LuaState vm){
  LuaState threadVm=vm;
  if (vm.gettop() >= 4) {
    threadVm=vm.checkthread(2).vm;
    vm.remove(2);
  }
  int level=vm.checkint(2);
  int local=vm.checkint(3);
  LString name=getlocal(threadVm,threadVm.cc - (level - 1),local);
  if (name != null) {
    LValue value=vm.poplvalue();
    vm.resettop();
    vm.pushlvalue(name);
    vm.pushlvalue(value);
  }
 else {
    vm.resettop();
    vm.pushnil();
  }
}
Program: 43962
Project: 43962
Buggy source:
private void setlocal(LuaState vm){
  LuaState threadVm=vm;
  if (vm.gettop() >= 5) {
    threadVm=vm.checkthread(2).vm;
    vm.remove(2);
  }
  int level=vm.checkint(2);
  int local=vm.checkint(3);
  LValue value=vm.topointer(4);
  CallInfo ci=getcallinfo(vm,threadVm,level);
  LValue name=LNil.NIL;
  LocVars[] vars=ci.closure.p.locvars;
  if (local > 0 && local <= ci.top - ci.base) {
    threadVm.stack[ci.base + local - 1]=value;
    if (vars != null && local > 0 && local <= vars.length)     name=vars[local - 1].varname;
  }
  vm.resettop();
  vm.pushlvalue(name);
}

Fixed version (ground truth):
private void setlocal(LuaState vm){
  LuaState threadVm=vm;
  if (vm.gettop() >= 5) {
    threadVm=vm.checkthread(2).vm;
    vm.remove(2);
  }
  int level=vm.checkint(2);
  int local=vm.checkint(3);
  vm.settop(4);
  LString name=setlocal(threadVm,threadVm.cc - (level - 1),local);
  vm.resettop();
  if (name != null) {
    vm.pushlvalue(name);
  }
 else {
    vm.pushnil();
  }
}
Program: 43963
Project: 43963
Buggy source:
/** 
 * This utility method implements both string.find and string.match.
 */
static int str_find_aux(LuaState vm,boolean find){
  LString s=vm.checklstring(1);
  LString pat=vm.checklstring(2);
  int init=vm.optint(3,1);
  if (init > 0) {
    init=Math.min(init - 1,s.length());
  }
 else   if (init < 0) {
    init=Math.max(0,s.length() + init);
  }
  boolean fastMatch=find && (vm.toboolean(5) || pat.indexOfAny(SPECIALS) == -1);
  if (fastMatch) {
    int result=s.indexOf(pat,init);
    if (result != -1) {
      vm.pushinteger(result + 1);
      vm.pushinteger(result + pat.length());
      return 2;
    }
  }
 else {
    MatchState ms=new MatchState(vm,s,pat);
    boolean anchor=false;
    int poff=0;
    if (pat.luaByte(0) == '^') {
      anchor=true;
      poff=1;
    }
    int soff=init;
    vm.resettop();
    do {
      int res;
      ms.reset();
      if ((res=ms.match(soff,poff)) != -1) {
        if (find) {
          vm.pushinteger(soff + 1);
          vm.pushinteger(res);
          ms.push_captures(false,soff,res);
        }
 else {
          ms.push_captures(true,soff,res);
        }
        return -1;
      }
    }
 while (soff++ < s.length() && !anchor);
  }
  vm.pushnil();
  return 1;
}

Fixed version (ground truth):
/** 
 * This utility method implements both string.find and string.match.
 */
static int str_find_aux(LuaState vm,boolean find){
  LString s=vm.checklstring(1);
  LString pat=vm.checklstring(2);
  int init=vm.optint(3,1);
  if (init > 0) {
    init=Math.min(init - 1,s.length());
  }
 else   if (init < 0) {
    init=Math.max(0,s.length() + init);
  }
  boolean fastMatch=find && (vm.toboolean(4) || pat.indexOfAny(SPECIALS) == -1);
  if (fastMatch) {
    int result=s.indexOf(pat,init);
    if (result != -1) {
      vm.pushinteger(result + 1);
      vm.pushinteger(result + pat.length());
      return 2;
    }
  }
 else {
    MatchState ms=new MatchState(vm,s,pat);
    boolean anchor=false;
    int poff=0;
    if (pat.luaByte(0) == '^') {
      anchor=true;
      poff=1;
    }
    int soff=init;
    vm.resettop();
    do {
      int res;
      ms.reset();
      if ((res=ms.match(soff,poff)) != -1) {
        if (find) {
          vm.pushinteger(soff + 1);
          vm.pushinteger(res);
          ms.push_captures(false,soff,res);
        }
 else {
          ms.push_captures(true,soff,res);
        }
        return -1;
      }
    }
 while (soff++ < s.length() && !anchor);
  }
  vm.pushnil();
  return 1;
}
Program: 43964
Project: 43964
Buggy source:
private void getmetatable(LuaState vm){
  LValue object=vm.topointer(2);
  vm.resettop();
  vm.pushlvalue(object.luaGetMetatable());
}

Fixed version (ground truth):
private void getmetatable(LuaState vm){
  LValue object=vm.topointer(2);
  vm.resettop();
  LValue mt=object.luaGetMetatable();
  if (mt != null)   vm.pushlvalue(object.luaGetMetatable());
 else   vm.pushnil();
}
Program: 43965
Project: 43965
Buggy source:
private void setmetatable(LuaState vm){
  LValue object=vm.topointer(2);
  LValue table=vm.totable(3);
  object.luaSetMetatable(table);
  vm.resettop();
  vm.pushlvalue(object);
}

Fixed version (ground truth):
private void setmetatable(LuaState vm){
  LValue object=vm.topointer(2);
  try {
    if (!vm.isnoneornil(3))     object.luaSetMetatable(vm.checktable(3));
 else     object.luaSetMetatable(null);
    vm.resettop();
    vm.pushboolean(true);
  }
 catch (  LuaErrorException e) {
    vm.resettop();
    vm.pushboolean(false);
    vm.pushstring(e.toString());
  }
}
Program: 43966
Project: 43966
Buggy source:
private void getupvalue(LuaState vm){
  LFunction func=vm.checkfunction(2);
  int up=vm.checkint(3);
  vm.resettop();
  if (func instanceof LClosure) {
    LClosure c=(LClosure)func;
    if (c.upVals != null && up > 0 && up < c.upVals.length) {
      vm.pushlvalue(c.upVals[up].getValue());
      return;
    }
  }
  vm.pushnil();
}

Fixed version (ground truth):
private void getupvalue(LuaState vm){
  LFunction func=vm.checkfunction(2);
  int up=vm.checkint(3);
  vm.resettop();
  if (func instanceof LClosure) {
    LClosure c=(LClosure)func;
    LString name=findupvalue(c,up);
    if (name != null) {
      vm.pushlstring(name);
      vm.pushlvalue(c.upVals[up - 1].getValue());
      return;
    }
  }
  vm.pushnil();
}
Program: 43967
Project: 43967
Buggy source:
private void setupvalue(LuaState vm){
  LFunction func=vm.checkfunction(2);
  int up=vm.checkint(3);
  LValue value=vm.topointer(4);
  vm.resettop();
  if (func instanceof LClosure) {
    LClosure c=(LClosure)func;
    if (c.upVals != null && up > 0 && up < c.upVals.length) {
      c.upVals[up].setValue(value);
      if (c.p.upvalues != null && up < c.p.upvalues.length)       vm.pushlvalue(c.p.upvalues[up]);
 else       vm.pushstring("String_Node_Str" + up + "String_Node_Str");
      return;
    }
  }
  vm.pushnil();
}

Fixed version (ground truth):
private void setupvalue(LuaState vm){
  LFunction func=vm.checkfunction(2);
  int up=vm.checkint(3);
  LValue value=vm.topointer(4);
  vm.resettop();
  if (func instanceof LClosure) {
    LClosure c=(LClosure)func;
    LString name=findupvalue(c,up);
    if (name != null) {
      c.upVals[up - 1].setValue(value);
      vm.pushlstring(name);
      return;
    }
  }
  vm.pushnil();
}
Program: 43968
Project: 43968
Buggy source:
/** 
 * Valid for tables 
 * @param the new LTable, or null or LNil.NIL to reset the metatable to none
 * @return this if unchanged, or new LTable if copied using weak table 
 */
public LTable luaSetMetatable(LValue metatable){
  throw new LuaErrorException("String_Node_Str" + metatable.luaGetTypeName());
}

Fixed version (ground truth):
/** 
 * Valid for tables 
 * @param the new LTable, or null or LNil.NIL to reset the metatable to none
 * @return this if unchanged, or new LTable if copied using weak table 
 */
public LTable luaSetMetatable(LValue metatable){
  throw new LuaErrorException("String_Node_Str" + this.luaGetTypeName());
}
Program: 43969
Project: 43969
Buggy source:
private void getfenv(LuaState vm){
  LValue object=vm.topointer(2);
  LValue env=object.luaGetEnv(null);
  vm.pushlvalue(env != null ? env : LNil.NIL);
}

Fixed version (ground truth):
private void getfenv(LuaState vm){
  LValue object=vm.topointer(2);
  LValue env=object.luaGetEnv(null);
  vm.resettop();
  vm.pushlvalue(env != null ? env : LNil.NIL);
}
Program: 43970
Project: 43970
Buggy source:
private void setfenv(LuaState vm){
  LValue object=vm.topointer(2);
  LTable table=vm.checktable(3);
  object.luaSetEnv(table);
}

Fixed version (ground truth):
private void setfenv(LuaState vm){
  LValue object=vm.topointer(2);
  LTable table=vm.checktable(3);
  object.luaSetEnv(table);
  vm.settop(1);
}
Program: 43971
Project: 43971
Buggy source:
private void getlocal(LuaState vm){
  LuaState threadVm=vm;
  if (vm.gettop() >= 4) {
    threadVm=vm.checkthread(2).vm;
    vm.remove(2);
  }
  int level=vm.checkint(2);
  int local=vm.checkint(3);
  CallInfo ci=getcallinfo(vm,threadVm,level);
  LValue value=LNil.NIL;
  LValue name=LNil.NIL;
  if (local >= 0 && local < ci.top - ci.base) {
    value=threadVm.stack[ci.base + local];
    LocVars[] vars=ci.closure.p.locvars;
    if (vars != null && local >= 0 && local < vars.length)     name=vars[local].varname;
  }
  vm.resettop();
  vm.pushlvalue(name);
  vm.pushlvalue(value);
}

Fixed version (ground truth):
private void getlocal(LuaState vm){
  LuaState threadVm=vm;
  if (vm.gettop() >= 4) {
    threadVm=vm.checkthread(2).vm;
    vm.remove(2);
  }
  int level=vm.checkint(2);
  int local=vm.checkint(3);
  CallInfo ci=getcallinfo(vm,threadVm,level);
  LValue value=LNil.NIL;
  LValue name=LNil.NIL;
  LocVars[] vars=ci.closure.p.locvars;
  if (local > 0 && local <= ci.top - ci.base) {
    value=threadVm.stack[ci.base + local - 1];
    if (vars != null && local > 0 && local <= vars.length)     name=vars[local - 1].varname;
  }
  vm.resettop();
  vm.pushlvalue(name);
  vm.pushlvalue(value);
}
Program: 43972
Project: 43972
Buggy source:
public static void install(LuaState vm){
  LTable debug=new LTable();
  for (int i=0; i < NAMES.length; i++)   debug.put(NAMES[i],new DebugLib(i + 1));
  vm._G.put("String_Node_Str",debug);
  PackageLib.setIsLoaded("String_Node_Str",debug);
}

Fixed version (ground truth):
public static void install(LuaState vm){
  LTable debug=new LTable();
  for (int i=1; i < NAMES.length; i++)   debug.put(NAMES[i],new DebugLib(i));
  vm._G.put("String_Node_Str",debug);
  PackageLib.setIsLoaded("String_Node_Str",debug);
}
Program: 43973
Project: 43973
Buggy source:
private void setlocal(LuaState vm){
  LuaState threadVm=vm;
  if (vm.gettop() >= 4) {
    threadVm=vm.checkthread(2).vm;
    vm.remove(2);
  }
  int level=vm.checkint(2);
  int local=vm.checkint(3);
  LValue value=vm.topointer(4);
  CallInfo ci=getcallinfo(vm,threadVm,level);
  LValue name=LNil.NIL;
  if (local >= 0 && local < ci.top - ci.base) {
    threadVm.stack[ci.base + local]=value;
    LocVars[] vars=ci.closure.p.locvars;
    if (vars != null && local >= 0 && local < vars.length)     name=vars[local].varname;
  }
  vm.resettop();
  vm.pushlvalue(name);
}

Fixed version (ground truth):
private void setlocal(LuaState vm){
  LuaState threadVm=vm;
  if (vm.gettop() >= 5) {
    threadVm=vm.checkthread(2).vm;
    vm.remove(2);
  }
  int level=vm.checkint(2);
  int local=vm.checkint(3);
  LValue value=vm.topointer(4);
  CallInfo ci=getcallinfo(vm,threadVm,level);
  LValue name=LNil.NIL;
  LocVars[] vars=ci.closure.p.locvars;
  if (local > 0 && local <= ci.top - ci.base) {
    threadVm.stack[ci.base + local - 1]=value;
    if (vars != null && local > 0 && local <= vars.length)     name=vars[local - 1].varname;
  }
  vm.resettop();
  vm.pushlvalue(name);
}
Program: 43974
Project: 43974
Buggy source:
private CallInfo getcallinfo(LuaState vm,LuaState threadVm,int level){
  if (level <= 0 || level > threadVm.cc)   vm.error("String_Node_Str");
  int cc=threadVm.cc - (level - 1);
  return threadVm.calls[cc];
}

Fixed version (ground truth):
private CallInfo getcallinfo(LuaState vm,LuaState threadVm,int level){
  --level;
  if (level < 0 || level > threadVm.cc)   vm.error("String_Node_Str");
  int cc=threadVm.cc - level;
  return threadVm.calls[cc];
}