nus-yam/ex-repair huggingface dataset:
Program: 99680
Project: 99680
Buggy source:
public CAstNode translateDoLoop(CAstNode loopTest,CAstNode loopBody,CAstNode continueNode,CAstNode breakNode,WalkContext<?,?> wc){
  if (replicateForDoLoops) {
    loopBody=Ast.makeNode(CAstNode.BLOCK_STMT,loopBody,continueNode);
    CAstRewriter.Rewrite x=(new CAstCloner(Ast,false)).copy(loopBody,wc.cfg(),wc.pos(),wc.getNodeTypeMap(),null);
    CAstNode otherBody=x.newRoot();
    wc.cfg().addAll(x.newCfg());
    wc.pos().addAll(x.newPos());
    wc.getNodeTypeMap().addAll(x.newTypes());
    return Ast.makeNode(CAstNode.BLOCK_STMT,loopBody,Ast.makeNode(CAstNode.LOOP,loopTest,otherBody),breakNode);
  }
 else {
    CAstNode header=Ast.makeNode(CAstNode.EMPTY);
    CAstNode loopGoto=Ast.makeNode(CAstNode.IFGOTO,loopTest);
    wc.cfg().map(header,header);
    wc.cfg().map(loopGoto,loopGoto);
    wc.cfg().add(loopGoto,header,Boolean.TRUE);
    return Ast.makeNode(CAstNode.BLOCK_STMT,header,Ast.makeNode(CAstNode.BLOCK_STMT,loopBody,continueNode),loopGoto,breakNode);
  }
}

Fixed version (ground truth):
public CAstNode translateDoLoop(CAstNode loopTest,CAstNode loopBody,CAstNode continueNode,CAstNode breakNode,WalkContext<?,?> wc){
  if (replicateForDoLoops) {
    loopBody=Ast.makeNode(CAstNode.BLOCK_STMT,loopBody,continueNode);
    CAstRewriter.Rewrite x=(new CAstCloner(Ast,false)).copy(loopBody,wc.cfg(),wc.pos(),wc.getNodeTypeMap(),null);
    CAstNode otherBody=x.newRoot();
    wc.cfg().addAll(x.newCfg());
    wc.pos().addAll(x.newPos());
    wc.getNodeTypeMap().addAll(x.newTypes());
    return Ast.makeNode(CAstNode.BLOCK_STMT,loopBody,Ast.makeNode(CAstNode.LOOP,loopTest,otherBody),breakNode);
  }
 else {
    CAstNode header=Ast.makeNode(CAstNode.LABEL_STMT,Ast.makeConstant("String_Node_Str"),Ast.makeNode(CAstNode.EMPTY));
    CAstNode loopGoto=Ast.makeNode(CAstNode.IFGOTO,loopTest);
    wc.cfg().map(header,header);
    wc.cfg().map(loopGoto,loopGoto);
    wc.cfg().add(loopGoto,header,Boolean.TRUE);
    return Ast.makeNode(CAstNode.BLOCK_STMT,header,Ast.makeNode(CAstNode.BLOCK_STMT,loopBody,continueNode),loopGoto,breakNode);
  }
}
Program: 99682
Project: 99682
Buggy source:
@Override public SSAAbstractInvokeInstruction addDirectCall(int function,int[] params,CallSiteReference site){
  CallSiteReference newSite=new JSCallSiteReference(statements.size());
  JavaScriptInvoke s=new JavaScriptInvoke(function,nextLocal++,params,nextLocal++,newSite);
  statements.add(s);
  return s;
}

Fixed version (ground truth):
@Override public SSAAbstractInvokeInstruction addDirectCall(int function,int[] params,CallSiteReference site){
  CallSiteReference newSite=new JSCallSiteReference(statements.size());
  JavaScriptInvoke s=new JavaScriptInvoke(statements.size(),function,nextLocal++,params,nextLocal++,newSite);
  statements.add(s);
  return s;
}
Program: 99683
Project: 99683
Buggy source:
private int passActualPropertyValsAsParams(JSInstructionFactory insts,int nargs,JavaScriptSummary S,int[] paramsToPassToInvoked){
  int curValNum=nargs + 2;
  for (int i=1; i < paramsToPassToInvoked.length; i++) {
    final int constVN=curValNum++;
    S.addConstant(constVN,new ConstantValue(i - 1));
    int propertyReadResult=curValNum++;
    S.addStatement(insts.PropertyRead(S.getNextProgramCounter(),propertyReadResult,4,constVN));
    paramsToPassToInvoked[i]=propertyReadResult;
  }
  return curValNum;
}

Fixed version (ground truth):
private int passActualPropertyValsAsParams(JSInstructionFactory insts,int nargs,JavaScriptSummary S,int[] paramsToPassToInvoked){
  int curValNum=nargs + 2;
  for (int i=1; i < paramsToPassToInvoked.length; i++) {
    final int constVN=curValNum++;
    S.addConstant(constVN,new ConstantValue(i - 1));
    int propertyReadResult=curValNum++;
    S.addStatement(insts.PropertyRead(S.getNumberOfStatements(),propertyReadResult,4,constVN));
    S.getNextProgramCounter();
    paramsToPassToInvoked[i]=propertyReadResult;
  }
  return curValNum;
}
Program: 99684
Project: 99684
Buggy source:
private IR makeIRForArgList(CGNode node){
  MethodReference ref=node.getMethod().getReference();
  IClass declaringClass=node.getMethod().getDeclaringClass();
  JSInstructionFactory insts=(JSInstructionFactory)declaringClass.getClassLoader().getInstructionFactory();
  int nargs=4;
  JavaScriptSummary S=new JavaScriptSummary(ref,nargs);
  int numParamsToPass=10;
  int[] paramsToPassToInvoked=new int[numParamsToPass + 1];
  paramsToPassToInvoked[0]=3;
  int curValNum=passActualPropertyValsAsParams(insts,nargs,S,paramsToPassToInvoked);
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  int resultVal=curValNum++;
  int excVal=curValNum++;
  S.addStatement(insts.Invoke(S.getNextProgramCounter(),2,resultVal,paramsToPassToInvoked,excVal,cs));
  S.addStatement(insts.ReturnInstruction(S.getNextProgramCounter(),resultVal,false));
  JavaScriptSummarizedFunction t=new JavaScriptSummarizedFunction(ref,S,declaringClass);
  return t.makeIR(node.getContext(),null);
}

Fixed version (ground truth):
private IR makeIRForArgList(CGNode node){
  MethodReference ref=node.getMethod().getReference();
  IClass declaringClass=node.getMethod().getDeclaringClass();
  JSInstructionFactory insts=(JSInstructionFactory)declaringClass.getClassLoader().getInstructionFactory();
  int nargs=4;
  JavaScriptSummary S=new JavaScriptSummary(ref,nargs);
  int numParamsToPass=10;
  int[] paramsToPassToInvoked=new int[numParamsToPass + 1];
  paramsToPassToInvoked[0]=3;
  int curValNum=passActualPropertyValsAsParams(insts,nargs,S,paramsToPassToInvoked);
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  int resultVal=curValNum++;
  int excVal=curValNum++;
  S.addStatement(insts.Invoke(S.getNumberOfStatements(),2,resultVal,paramsToPassToInvoked,excVal,cs));
  S.getNextProgramCounter();
  S.addStatement(insts.ReturnInstruction(S.getNumberOfStatements(),resultVal,false));
  S.getNextProgramCounter();
  JavaScriptSummarizedFunction t=new JavaScriptSummarizedFunction(ref,S,declaringClass);
  return t.makeIR(node.getContext(),null);
}
Program: 99685
Project: 99685
Buggy source:
private IR makeIRForNoArgList(CGNode node){
  MethodReference ref=node.getMethod().getReference();
  IClass declaringClass=node.getMethod().getDeclaringClass();
  JSInstructionFactory insts=(JSInstructionFactory)declaringClass.getClassLoader().getInstructionFactory();
  int nargs=4;
  JavaScriptSummary S=new JavaScriptSummary(ref,nargs);
  int resultVal=nargs + 2;
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  int[] params=new int[1];
  params[0]=3;
  S.addStatement(insts.Invoke(S.getNextProgramCounter(),2,resultVal,params,resultVal + 1,cs));
  S.addStatement(insts.ReturnInstruction(S.getNextProgramCounter(),resultVal,false));
  JavaScriptSummarizedFunction t=new JavaScriptSummarizedFunction(ref,S,declaringClass);
  return t.makeIR(node.getContext(),null);
}

Fixed version (ground truth):
private IR makeIRForNoArgList(CGNode node){
  MethodReference ref=node.getMethod().getReference();
  IClass declaringClass=node.getMethod().getDeclaringClass();
  JSInstructionFactory insts=(JSInstructionFactory)declaringClass.getClassLoader().getInstructionFactory();
  int nargs=4;
  JavaScriptSummary S=new JavaScriptSummary(ref,nargs);
  int resultVal=nargs + 2;
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  int[] params=new int[1];
  params[0]=3;
  S.addStatement(insts.Invoke(S.getNumberOfStatements(),2,resultVal,params,resultVal + 1,cs));
  S.getNextProgramCounter();
  S.addStatement(insts.ReturnInstruction(S.getNumberOfStatements(),resultVal,false));
  S.getNextProgramCounter();
  JavaScriptSummarizedFunction t=new JavaScriptSummarizedFunction(ref,S,declaringClass);
  return t.makeIR(node.getContext(),null);
}
Program: 99686
Project: 99686
Buggy source:
@SuppressWarnings("String_Node_Str") private int passArbitraryPropertyValAsParams(JSInstructionFactory insts,int nargs,JavaScriptSummary S,int[] paramsToPassToInvoked){
  int curValNum=nargs + 2;
  int eachElementGetResult=curValNum++;
  S.addStatement(insts.EachElementGetInstruction(S.getNextProgramCounter(),eachElementGetResult,4));
  int propertyReadResult=curValNum++;
  S.addStatement(insts.PropertyRead(S.getNextProgramCounter(),propertyReadResult,4,eachElementGetResult));
  for (int i=1; i < paramsToPassToInvoked.length; i++) {
    paramsToPassToInvoked[i]=propertyReadResult;
  }
  return curValNum;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private int passArbitraryPropertyValAsParams(JSInstructionFactory insts,int nargs,JavaScriptSummary S,int[] paramsToPassToInvoked){
  int curValNum=nargs + 2;
  int eachElementGetResult=curValNum++;
  S.addStatement(insts.EachElementGetInstruction(S.getNumberOfStatements(),eachElementGetResult,4));
  S.getNextProgramCounter();
  int propertyReadResult=curValNum++;
  S.addStatement(insts.PropertyRead(S.getNumberOfStatements(),propertyReadResult,4,eachElementGetResult));
  S.getNextProgramCounter();
  for (int i=1; i < paramsToPassToInvoked.length; i++) {
    paramsToPassToInvoked[i]=propertyReadResult;
  }
  return curValNum;
}
Program: 99688
Project: 99688
Buggy source:
private IMethod makeUnaryNumberCall(IClass cls){
  JSInstructionFactory insts=(JSInstructionFactory)cls.getClassLoader().getInstructionFactory();
  MethodReference ref=AstMethodReference.fnReference(JavaScriptTypes.Number);
  JavaScriptSummary S=new JavaScriptSummary(ref,2);
  S.addStatement(insts.GetInstruction(S.getNumberOfStatements(),4,2,"String_Node_Str"));
  S.getNextProgramCounter();
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  S.addStatement(insts.Invoke(4,5,new int[]{2},6,cs));
  S.addStatement(insts.ReturnInstruction(S.getNumberOfStatements(),5,false));
  S.getNextProgramCounter();
  return new JavaScriptConstructor(ref,S,cls,cha.lookupClass(JavaScriptTypes.Number));
}

Fixed version (ground truth):
private IMethod makeUnaryNumberCall(IClass cls){
  JSInstructionFactory insts=(JSInstructionFactory)cls.getClassLoader().getInstructionFactory();
  MethodReference ref=AstMethodReference.fnReference(JavaScriptTypes.Number);
  JavaScriptSummary S=new JavaScriptSummary(ref,2);
  S.addStatement(insts.GetInstruction(S.getNumberOfStatements(),4,2,"String_Node_Str"));
  S.getNextProgramCounter();
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  S.addStatement(insts.Invoke(S.getNumberOfStatements(),4,5,new int[]{2},6,cs));
  S.addStatement(insts.ReturnInstruction(S.getNumberOfStatements(),5,false));
  S.getNextProgramCounter();
  return new JavaScriptConstructor(ref,S,cls,cha.lookupClass(JavaScriptTypes.Number));
}
Program: 99689
Project: 99689
Buggy source:
private IMethod makeUnaryStringCall(IClass cls){
  JSInstructionFactory insts=(JSInstructionFactory)cls.getClassLoader().getInstructionFactory();
  MethodReference ref=AstMethodReference.fnReference(JavaScriptTypes.String);
  JavaScriptSummary S=new JavaScriptSummary(ref,2);
  S.addStatement(insts.GetInstruction(S.getNumberOfStatements(),4,2,"String_Node_Str"));
  S.getNextProgramCounter();
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  S.addStatement(insts.Invoke(4,5,new int[]{2},6,cs));
  S.addStatement(insts.ReturnInstruction(S.getNumberOfStatements(),5,false));
  S.getNextProgramCounter();
  return new JavaScriptConstructor(ref,S,cls,cha.lookupClass(JavaScriptTypes.String));
}

Fixed version (ground truth):
private IMethod makeUnaryStringCall(IClass cls){
  JSInstructionFactory insts=(JSInstructionFactory)cls.getClassLoader().getInstructionFactory();
  MethodReference ref=AstMethodReference.fnReference(JavaScriptTypes.String);
  JavaScriptSummary S=new JavaScriptSummary(ref,2);
  S.addStatement(insts.GetInstruction(S.getNumberOfStatements(),4,2,"String_Node_Str"));
  S.getNextProgramCounter();
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  S.addStatement(insts.Invoke(S.getNumberOfStatements(),4,5,new int[]{2},6,cs));
  S.addStatement(insts.ReturnInstruction(S.getNumberOfStatements(),5,false));
  S.getNextProgramCounter();
  return new JavaScriptConstructor(ref,S,cls,cha.lookupClass(JavaScriptTypes.String));
}
Program: 99692
Project: 99692
Buggy source:
@Override public int getLastCol(){
  return e.getSource().getRowColumnVector(e.getEnd()).getColumn();
}

Fixed version (ground truth):
@Override public int getLastCol(){
  return -1;
}
Program: 99693
Project: 99693
Buggy source:
private Position getPosition(final Segment e){
  return new AbstractSourcePosition(){
    @Override public int getFirstLine(){
      return e.getSource().getRowColumnVector(e.getBegin()).getRow();
    }
    @Override public int getLastLine(){
      return e.getSource().getRowColumnVector(e.getEnd()).getRow();
    }
    @Override public int getFirstCol(){
      return e.getSource().getRowColumnVector(e.getBegin()).getColumn();
    }
    @Override public int getLastCol(){
      return e.getSource().getRowColumnVector(e.getEnd()).getColumn();
    }
    @Override public int getFirstOffset(){
      return e.getBegin();
    }
    @Override public int getLastOffset(){
      return e.getEnd();
    }
    @Override public URL getURL(){
      try {
        return new URL("String_Node_Str" + sourceFile);
      }
 catch (      MalformedURLException e) {
        return null;
      }
    }
    @Override public InputStream getInputStream() throws IOException {
      return new FileInputStream(sourceFile);
    }
  }
;
}

Fixed version (ground truth):
private Position getPosition(final Segment e){
  return new AbstractSourcePosition(){
    @Override public int getFirstLine(){
      return e.getSource().getRowColumnVector(e.getBegin()).getRow();
    }
    @Override public int getLastLine(){
      return e.getSource().getRowColumnVector(e.getEnd()).getRow();
    }
    @Override public int getFirstCol(){
      return -1;
    }
    @Override public int getLastCol(){
      return -1;
    }
    @Override public int getFirstOffset(){
      return e.getBegin();
    }
    @Override public int getLastOffset(){
      return e.getEnd();
    }
    @Override public URL getURL(){
      try {
        return new URL("String_Node_Str" + sourceFile);
      }
 catch (      MalformedURLException e) {
        return null;
      }
    }
    @Override public Reader getReader() throws IOException {
      return new FileReader(sourceFile);
    }
  }
;
}
Program: 99694
Project: 99694
Buggy source:
public Pair<Integer,String> getBodyText(){
  Segment content=innerElement.getContent();
  Integer lineNum=innerElement.getSource().getRow(content.getBegin());
  String body=content.toString();
  return Pair.make(lineNum,body);
}

Fixed version (ground truth):
public Pair<Integer,String> getBodyText(){
  Segment content=innerElement.getContent();
  Integer lineNum=innerElement.getSource().getRow(content.getBegin());
  String body=content.toString().replace(content.getSource().getNewLine(),"String_Node_Str");
  return Pair.make(lineNum,body);
}
Program: 99695
Project: 99695
Buggy source:
@Override public int getFirstCol(){
  return e.getSource().getRowColumnVector(e.getBegin()).getColumn();
}

Fixed version (ground truth):
@Override public int getFirstCol(){
  return -1;
}
Program: 99698
Project: 99698
Buggy source:
/** 
 * Add flows from the special primitive functions to the corresponding global variables.
 * @param flowgraph the flow graph under construction
 */
private void addPrimitives(FlowGraph flowgraph){
  VertexFactory factory=flowgraph.getVertexFactory();
  for (  String pf : primitiveFunctions) {
    TypeReference typeref=TypeReference.findOrCreate(JavaScriptTypes.jsLoader,"String_Node_Str" + pf);
    IClass klass=cha.lookupClass(typeref);
    flowgraph.addEdge(factory.makeFuncVertex(klass),factory.makePropVertex(pf));
  }
}

Fixed version (ground truth):
/** 
 * Add flows from the special primitive functions to the corresponding global variables.
 * @param flowgraph the flow graph under construction
 */
private void addPrimitives(FlowGraph flowgraph){
  VertexFactory factory=flowgraph.getVertexFactory();
  for (  String pf : primitiveFunctions) {
    TypeReference typeref=TypeReference.findOrCreate(JavaScriptTypes.jsLoader,"String_Node_Str" + pf);
    IClass klass=cha.lookupClass(typeref);
    String prop=pf.endsWith("String_Node_Str") ? pf.substring(0,pf.length() - 6) : pf;
    flowgraph.addEdge(factory.makeFuncVertex(klass),factory.makePropVertex(prop));
  }
}
Program: 99699
Project: 99699
Buggy source:
@Override public int getLastCol(){
  return e.getSource().getRowColumnVector(e.getEnd()).getColumn();
}

Fixed version (ground truth):
@Override public int getLastCol(){
  return -1;
}
Program: 99700
Project: 99700
Buggy source:
private Position getPosition(final Segment e){
  return new AbstractSourcePosition(){
    @Override public int getFirstLine(){
      return e.getSource().getRowColumnVector(e.getBegin()).getRow();
    }
    @Override public int getLastLine(){
      return e.getSource().getRowColumnVector(e.getEnd()).getRow();
    }
    @Override public int getFirstCol(){
      return e.getSource().getRowColumnVector(e.getBegin()).getColumn();
    }
    @Override public int getLastCol(){
      return e.getSource().getRowColumnVector(e.getEnd()).getColumn();
    }
    @Override public int getFirstOffset(){
      return e.getBegin();
    }
    @Override public int getLastOffset(){
      return e.getEnd();
    }
    @Override public URL getURL(){
      try {
        return new URL("String_Node_Str" + sourceFile);
      }
 catch (      MalformedURLException e) {
        return null;
      }
    }
    @Override public InputStream getInputStream() throws IOException {
      return new FileInputStream(sourceFile);
    }
  }
;
}

Fixed version (ground truth):
private Position getPosition(final Segment e){
  return new AbstractSourcePosition(){
    @Override public int getFirstLine(){
      return e.getSource().getRowColumnVector(e.getBegin()).getRow();
    }
    @Override public int getLastLine(){
      return e.getSource().getRowColumnVector(e.getEnd()).getRow();
    }
    @Override public int getFirstCol(){
      return -1;
    }
    @Override public int getLastCol(){
      return -1;
    }
    @Override public int getFirstOffset(){
      return e.getBegin();
    }
    @Override public int getLastOffset(){
      return e.getEnd();
    }
    @Override public URL getURL(){
      try {
        return new URL("String_Node_Str" + sourceFile);
      }
 catch (      MalformedURLException e) {
        return null;
      }
    }
    @Override public Reader getReader() throws IOException {
      return new FileReader(sourceFile);
    }
  }
;
}
Program: 99701
Project: 99701
Buggy source:
public Pair<Integer,String> getBodyText(){
  Segment content=innerElement.getContent();
  Integer lineNum=innerElement.getSource().getRow(content.getBegin());
  String body=content.toString();
  return Pair.make(lineNum,body);
}

Fixed version (ground truth):
public Pair<Integer,String> getBodyText(){
  Segment content=innerElement.getContent();
  Integer lineNum=innerElement.getSource().getRow(content.getBegin());
  String body=content.toString().replace(content.getSource().getNewLine(),"String_Node_Str");
  return Pair.make(lineNum,body);
}
Program: 99702
Project: 99702
Buggy source:
@Override public int getFirstCol(){
  return e.getSource().getRowColumnVector(e.getBegin()).getColumn();
}

Fixed version (ground truth):
@Override public int getFirstCol(){
  return -1;
}
Program: 99705
Project: 99705
Buggy source:
/** 
 * Add flows from the special primitive functions to the corresponding global variables.
 * @param flowgraph the flow graph under construction
 */
private void addPrimitives(FlowGraph flowgraph){
  VertexFactory factory=flowgraph.getVertexFactory();
  for (  String pf : primitiveFunctions) {
    TypeReference typeref=TypeReference.findOrCreate(JavaScriptTypes.jsLoader,"String_Node_Str" + pf);
    IClass klass=cha.lookupClass(typeref);
    flowgraph.addEdge(factory.makeFuncVertex(klass),factory.makePropVertex(pf));
  }
}

Fixed version (ground truth):
/** 
 * Add flows from the special primitive functions to the corresponding global variables.
 * @param flowgraph the flow graph under construction
 */
private void addPrimitives(FlowGraph flowgraph){
  VertexFactory factory=flowgraph.getVertexFactory();
  for (  String pf : primitiveFunctions) {
    TypeReference typeref=TypeReference.findOrCreate(JavaScriptTypes.jsLoader,"String_Node_Str" + pf);
    IClass klass=cha.lookupClass(typeref);
    String prop=pf.endsWith("String_Node_Str") ? pf.substring(0,pf.length() - 6) : pf;
    flowgraph.addEdge(factory.makeFuncVertex(klass),factory.makePropVertex(prop));
  }
}
Program: 99706
Project: 99706
Buggy source:
public final Set<TypeReference> getUnresolvedClasses(){
  return unresolved;
}

Fixed version (ground truth):
@Override public final Set<TypeReference> getUnresolvedClasses(){
  return unresolved;
}
Program: 99707
Project: 99707
Buggy source:
/** 
 * Find a class in this class hierarchy.
 * @return the {@link IClass} for a if found; null if can't find the class.
 * @throws IllegalArgumentException if A is null
 */
@Override public IClass lookupClass(TypeReference a){
  if (a == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ClassLoaderReference loader=a.getClassLoader();
  ClassLoaderReference parent=loader.getParent();
  if (parent != null) {
    TypeReference p=TypeReference.findOrCreate(parent,a.getName());
    IClass c=lookupClass(p);
    if (c != null) {
      return c;
    }
  }
  if (a.isArrayType()) {
    TypeReference elt=a.getInnermostElementType();
    if (elt.isPrimitiveType()) {
      return getRootClass().getClassLoader().lookupClass(a.getName());
    }
 else {
      IClass c=lookupClass(elt);
      if (c == null) {
        unresolved.add(elt);
        return null;
      }
 else {
        return c.getClassLoader().lookupClass(a.getName());
      }
    }
  }
 else {
    Node n=map.get(a);
    if (n != null) {
      return n.klass;
    }
 else {
      unresolved.add(a);
      return null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Find a class in this class hierarchy.
 * @return the {@link IClass} for a if found; null if can't find the class.
 * @throws IllegalArgumentException if A is null
 */
@Override public IClass lookupClass(TypeReference a){
  if (a == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final IClass cls=lookupClassRecursive(a);
  if (cls == null) {
    unresolved.add(a);
  }
  return cls;
}
Program: 99709
Project: 99709
Buggy source:
/** 
 * set up the methodMap mapping
 */
protected void computeMethodMapIfNeeded() throws InvalidClassFileException {
  if (methodMap == null) {
synchronized (this) {
      if (methodMap == null) {
        IMethod[] methods=computeDeclaredMethods();
        if (methods.length > 5) {
          methodMap=HashMapFactory.make(methods.length);
        }
 else {
          methodMap=new SmallMap<Selector,IMethod>();
        }
        for (int i=0; i < methods.length; i++) {
          IMethod m=methods[i];
          methodMap.put(m.getReference().getSelector(),m);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * set up the methodMap mapping
 */
protected void computeMethodMapIfNeeded() throws InvalidClassFileException {
  if (methodMap == null) {
synchronized (this) {
      if (methodMap == null) {
        IMethod[] methods=computeDeclaredMethods();
        final Map<Selector,IMethod> tmpMethodMap;
        if (methods.length > 5) {
          tmpMethodMap=HashMapFactory.make(methods.length);
        }
 else {
          tmpMethodMap=new SmallMap<Selector,IMethod>();
        }
        for (int i=0; i < methods.length; i++) {
          IMethod m=methods[i];
          tmpMethodMap.put(m.getReference().getSelector(),m);
        }
        methodMap=tmpMethodMap;
      }
    }
  }
}
Program: 99710
Project: 99710
Buggy source:
public void unary1(){
}

Fixed version (ground truth):
@Override public void unary1(){
}
Program: 99711
Project: 99711
Buggy source:
public void unary2(){
  unary1();
}

Fixed version (ground truth):
@Override public void unary2(){
  unary1();
}
Program: 99712
Project: 99712
Buggy source:
public void binary(Whatever arg){
  this.unary1();
  arg.unary2();
}

Fixed version (ground truth):
@Override public void binary(Whatever arg){
  this.unary1();
  arg.unary2();
}
Program: 99713
Project: 99713
Buggy source:
public static void main(String[] args){
  Whatever x=new This();
  Whatever y=new That();
  Whatever z=choice() ? x : y;
  if (z instanceof This)   x.binary(z);
 else   y.binary(z);
}

Fixed version (ground truth):
public static void main(String[] args){
  Whatever x=new This();
  Whatever y=new That();
  Whatever z=choice() ? x : y;
  if (z instanceof This)   x.binary(z);
 else   y.binary(z);
  localCast();
}
Program: 99714
Project: 99714
Buggy source:
private void checkCallAssertions(CallGraph cg,int desiredNumberOfTargets,int desiredNumberOfCalls){
}

Fixed version (ground truth):
private void checkCallAssertions(CallGraph cg,int desiredNumberOfTargets,int desiredNumberOfCalls,int numLocalCastCallees){
}
Program: 99715
Project: 99715
Buggy source:
@Test public void testNoPiNodes() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  checkCallAssertions(doGraph(false),2,2);
}

Fixed version (ground truth):
@Test public void testNoPiNodes() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  checkCallAssertions(doGraph(false),2,2,2);
}
Program: 99716
Project: 99716
Buggy source:
@Test public void testPiNodes() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  checkCallAssertions(doGraph(true),1,2);
}

Fixed version (ground truth):
@Test public void testPiNodes() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  checkCallAssertions(doGraph(true),1,2,1);
}
Program: 99717
Project: 99717
Buggy source:
public void defineFunction(CAstEntity n,IClass owner,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] catchTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
  ((JavaClass)owner).addMethod(n,owner,cfg,symtab,hasCatchBlock,catchTypes,hasMonitorOp,lexicalInfo,debugInfo);
}

Fixed version (ground truth):
public void defineFunction(CAstEntity n,IClass owner,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
  ((JavaClass)owner).addMethod(n,owner,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,lexicalInfo,debugInfo);
}
Program: 99718
Project: 99718
Buggy source:
public ConcreteJavaMethod(CAstEntity methodEntity,IClass owner,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] catchTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
  super(methodEntity,owner,cfg,symtab,hasCatchBlock,catchTypes,hasMonitorOp,lexicalInfo,debugInfo);
}

Fixed version (ground truth):
public ConcreteJavaMethod(CAstEntity methodEntity,IClass owner,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
  super(methodEntity,owner,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,lexicalInfo,debugInfo);
}
Program: 99719
Project: 99719
Buggy source:
protected void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
}

Fixed version (ground truth):
protected void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
}
Program: 99720
Project: 99720
Buggy source:
@Override protected void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] caughtTypes,boolean hasMonitorOp,AstLexicalInformation LI,DebuggingInformation debugInfo){
  if (N == codeBodyEntity) {
    specializedCode=myloader.makeCodeBodyCode(cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,LI,debugInfo,method.getDeclaringClass());
  }
 else {
    super.defineFunction(N,definingContext,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,LI,debugInfo);
  }
}

Fixed version (ground truth):
@Override protected void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> caughtTypes,boolean hasMonitorOp,AstLexicalInformation LI,DebuggingInformation debugInfo){
  if (N == codeBodyEntity) {
    specializedCode=myloader.makeCodeBodyCode(cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,LI,debugInfo,method.getDeclaringClass());
  }
 else {
    super.defineFunction(N,definingContext,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,LI,debugInfo);
  }
}
Program: 99722
Project: 99722
Buggy source:
@Override protected void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] caughtTypes,boolean hasMonitorOp,AstLexicalInformation LI,DebuggingInformation debugInfo){
  String fnName="String_Node_Str" + composeEntityName(definingContext,N);
  names.add(fnName);
  super.defineFunction(N,definingContext,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,LI,debugInfo);
}

Fixed version (ground truth):
@Override protected void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> caughtTypes,boolean hasMonitorOp,AstLexicalInformation LI,DebuggingInformation debugInfo){
  String fnName="String_Node_Str" + composeEntityName(definingContext,N);
  names.add(fnName);
  super.defineFunction(N,definingContext,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,LI,debugInfo);
}
Program: 99724
Project: 99724
Buggy source:
public JavaScriptMethodObject makeCodeBodyCode(AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo,IClass C){
  return new JavaScriptMethodObject(C,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,lexicalInfo,debugInfo);
}

Fixed version (ground truth):
public JavaScriptMethodObject makeCodeBodyCode(AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo,IClass C){
  return new JavaScriptMethodObject(C,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,lexicalInfo,debugInfo);
}
Program: 99725
Project: 99725
Buggy source:
public IMethod defineCodeBodyCode(String clsName,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
}

Fixed version (ground truth):
public IMethod defineCodeBodyCode(String clsName,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
}
Program: 99726
Project: 99726
Buggy source:
JavaScriptMethodObject(IClass cls,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
  super(cls,functionQualifiers,cfg,symtab,AstMethodReference.fnReference(cls.getReference()),hasCatchBlock,caughtTypes,hasMonitorOp,lexicalInfo,debugInfo,null);
  symtab.getNullConstant();
}

Fixed version (ground truth):
JavaScriptMethodObject(IClass cls,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo){
  super(cls,functionQualifiers,cfg,symtab,AstMethodReference.fnReference(cls.getReference()),hasCatchBlock,caughtTypes,hasMonitorOp,lexicalInfo,debugInfo,null);
  symtab.getNullConstant();
}
Program: 99727
Project: 99727
Buggy source:
protected void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] caughtTypes,boolean hasMonitorOp,AstLexicalInformation LI,DebuggingInformation debugInfo){
  if (DEBUG)   System.err.println(("String_Node_Str" + N));
  String fnName=composeEntityName(definingContext,N);
  if (DEBUG)   System.err.println(cfg);
  ((JavaScriptLoader)loader).defineCodeBodyCode("String_Node_Str" + fnName,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,LI,debugInfo);
}

Fixed version (ground truth):
protected void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> caughtTypes,boolean hasMonitorOp,AstLexicalInformation LI,DebuggingInformation debugInfo){
  if (DEBUG)   System.err.println(("String_Node_Str" + N));
  String fnName=composeEntityName(definingContext,N);
  if (DEBUG)   System.err.println(cfg);
  ((JavaScriptLoader)loader).defineCodeBodyCode("String_Node_Str" + fnName,cfg,symtab,hasCatchBlock,caughtTypes,hasMonitorOp,LI,debugInfo);
}
Program: 99728
Project: 99728
Buggy source:
private void setupCatchTypes(SSACFG cfg,TypeReference[][] catchTypes){
  for (int i=0; i < catchTypes.length; i++) {
    if (catchTypes[i] != null) {
      ExceptionHandlerBasicBlock bb=(ExceptionHandlerBasicBlock)cfg.getNode(i);
      for (int j=0; j < catchTypes[i].length; j++) {
        bb.addCaughtExceptionType(catchTypes[i][j]);
      }
    }
  }
}

Fixed version (ground truth):
private void setupCatchTypes(SSACFG cfg,Map<IBasicBlock,TypeReference[]> map){
  for (  Map.Entry<IBasicBlock,TypeReference[]> e : map.entrySet()) {
    if (e.getKey().getNumber() != -1) {
      ExceptionHandlerBasicBlock bb=(ExceptionHandlerBasicBlock)cfg.getNode(e.getKey().getNumber());
      for (int j=0; j < e.getValue().length; j++) {
        bb.addCaughtExceptionType(e.getValue()[j]);
      }
    }
  }
}
Program: 99730
Project: 99730
Buggy source:
/** 
 * fully define a function. invoked after all the code of the function has been processed
 */
protected abstract void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,TypeReference[][] caughtTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo);

Fixed version (ground truth):
/** 
 * fully define a function. invoked after all the code of the function has been processed
 */
protected abstract void defineFunction(CAstEntity N,WalkContext definingContext,AbstractCFG cfg,SymbolTable symtab,boolean hasCatchBlock,Map<IBasicBlock,TypeReference[]> catchTypes,boolean hasMonitorOp,AstLexicalInformation lexicalInfo,DebuggingInformation debugInfo);
Program: 99731
Project: 99731
Buggy source:
public TypeReference[][] getCatchTypes(){
  return null;
}

Fixed version (ground truth):
public Map<IBasicBlock,TypeReference[]> getCatchTypes(){
  return null;
}
Program: 99732
Project: 99732
Buggy source:
public void closeFunctionEntity(final CAstEntity n,WalkContext parentContext,WalkContext functionContext){
  functionContext.cfg().makeExitBlock(functionContext.cfg().newBlock(true));
  SymbolTable symtab=((AbstractScope)functionContext.currentScope()).getUnderlyingSymtab();
  TypeReference[][] catchTypes=functionContext.getCatchTypes();
  AstCFG cfg=new AstCFG(n,functionContext.cfg(),symtab);
  Position[] line=functionContext.cfg().getLinePositionMap();
  boolean katch=functionContext.cfg().hasCatchBlock();
  boolean monitor=functionContext.cfg().hasMonitorOp();
  String[] nms=makeNameMap(n,functionContext.entityScopes());
  patchLexicalAccesses(cfg.getInstructions(),functionContext.getAccesses(n));
  AstLexicalInformation LI=new AstLexicalInformation(functionContext.getEntityName(n),(AbstractScope)functionContext.currentScope(),cfg.getInstructions(),functionContext.exposeNameSet(n,false),functionContext.exposeNameSet(n,true),functionContext.getAccesses(n));
  DebuggingInformation DBG=new AstDebuggingInformation(n.getPosition(),line,nms);
  defineFunction(n,parentContext,cfg,symtab,katch,catchTypes,monitor,LI,DBG);
}

Fixed version (ground truth):
public void closeFunctionEntity(final CAstEntity n,WalkContext parentContext,WalkContext functionContext){
  functionContext.cfg().makeExitBlock(functionContext.cfg().newBlock(true));
  SymbolTable symtab=((AbstractScope)functionContext.currentScope()).getUnderlyingSymtab();
  Map<IBasicBlock,TypeReference[]> catchTypes=functionContext.getCatchTypes();
  AstCFG cfg=new AstCFG(n,functionContext.cfg(),symtab);
  Position[] line=functionContext.cfg().getLinePositionMap();
  boolean katch=functionContext.cfg().hasCatchBlock();
  boolean monitor=functionContext.cfg().hasMonitorOp();
  String[] nms=makeNameMap(n,functionContext.entityScopes());
  patchLexicalAccesses(cfg.getInstructions(),functionContext.getAccesses(n));
  AstLexicalInformation LI=new AstLexicalInformation(functionContext.getEntityName(n),(AbstractScope)functionContext.currentScope(),cfg.getInstructions(),functionContext.exposeNameSet(n,false),functionContext.exposeNameSet(n,true),functionContext.getAccesses(n));
  DebuggingInformation DBG=new AstDebuggingInformation(n.getPosition(),line,nms);
  defineFunction(n,parentContext,cfg,symtab,katch,catchTypes,monitor,LI,DBG);
}
Program: 99733
Project: 99733
Buggy source:
public void copyState(BitVectorVariable other){
  if (other == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (V == null) {
    if (other.V == null) {
      return;
    }
 else {
      V=new MutableSharedBitVectorIntSet(other.V);
      return;
    }
  }
  if (other.V != null) {
    V.copySet(other.V);
  }
}

Fixed version (ground truth):
public void copyState(BitVectorVariable other){
  if (other == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (V == null) {
    if (other.V == null) {
      return;
    }
 else {
      V=new MutableSharedBitVectorIntSet(other.V);
      return;
    }
  }
  if (other.V != null) {
    V.copySet(other.V);
  }
 else {
    V=null;
  }
}
Program: 99734
Project: 99734
Buggy source:
/** 
 * Properly creates the String file name of a   {@link URL}. This works around a bug in the Sun implementation of   {@link URL#getFile()}, which doesn't properly handle file paths with spaces (see <a href= "http://sourceforge.net/tracker/index.php?func=detail&aid=1565842&group_id=176742&atid=878458" >bug report</a>). For now, fails with an assertion if the url is malformed.
 * @param url
 * @return the path name for the url
 * @throws IllegalArgumentException if url is null
 */
public String filePathFromURL(URL url){
  if (url == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  URI uri=new File(url.getPath()).toURI();
  try {
    return URLDecoder.decode(uri.getPath(),"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    Assertions.UNREACHABLE();
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Properly creates the String file name of a   {@link URL}. This works around a bug in the Sun implementation of   {@link URL#getFile()}, which doesn't properly handle file paths with spaces (see <a href= "http://sourceforge.net/tracker/index.php?func=detail&aid=1565842&group_id=176742&atid=878458" >bug report</a>). For now, fails with an assertion if the url is malformed.
 * @param url
 * @return the path name for the url
 * @throws IllegalArgumentException if url is null
 */
public String filePathFromURL(URL url){
  if (url == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    URI uri=new File(URLDecoder.decode(url.getPath(),"String_Node_Str")).toURI();
    return uri.getPath();
  }
 catch (  UnsupportedEncodingException e) {
    Assertions.UNREACHABLE();
    return null;
  }
}
Program: 99735
Project: 99735
Buggy source:
@TestAnnotation(doSomething="String_Node_Str",count=1,date="String_Node_Str") public void mymethod(){
}

Fixed version (ground truth):
@TestAnnotation(doSomething="String_Node_Str",count=1,date="String_Node_Str",stuff={}) public int mymethod(){
  @AnotherTestAnnotation("String_Node_Str") int i=0;
  return i;
}
Program: 99736
Project: 99736
Buggy source:
@TestAnnotation(doSomething="String_Node_Str",count=0,date="String_Node_Str") public static void main(String[] args){
  (new Annotations()).mymethod();
}

Fixed version (ground truth):
@TestAnnotation(doSomething="String_Node_Str",count=0,date="String_Node_Str",stuff={1,2,3,4,5}) public static void main(String[] args){
  (new Annotations()).mymethod();
}
Program: 99737
Project: 99737
Buggy source:
public void check(CallGraph cg){
  classes:   for (  ClassAnnotation ca : classAnnotations) {
    IClass cls=cg.getClassHierarchy().lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application,ca.className));
    IClass at=cg.getClassHierarchy().lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application,ca.annotationTypeName));
    for (    Annotation a : cls.getAnnotations()) {
      if (a.getType().equals(at.getReference())) {
        continue classes;
      }
    }
    Assert.assertFalse("String_Node_Str" + at + "String_Node_Str"+ cls,false);
  }
  for (  MethodAnnotation ma : methodAnnotations) {
    IClass at=cg.getClassHierarchy().lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application,ma.annotationTypeName));
    annot:     for (    CGNode n : cg) {
      if (n.getMethod().getSignature().equals(ma.methodSig)) {
        for (        Annotation a : n.getMethod().getAnnotations()) {
          if (a.getType().equals(at.getReference())) {
            continue annot;
          }
        }
        Assert.assertFalse("String_Node_Str" + at,false);
      }
    }
  }
}

Fixed version (ground truth):
public void check(CallGraph cg){
  classes:   for (  ClassAnnotation ca : classAnnotations) {
    IClass cls=cg.getClassHierarchy().lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application,ca.className));
    IClass at=cg.getClassHierarchy().lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application,ca.annotationTypeName));
    for (    Annotation a : cls.getAnnotations()) {
      if (a.getType().equals(at.getReference())) {
        continue classes;
      }
    }
    Assert.assertFalse("String_Node_Str" + at + "String_Node_Str"+ cls,false);
  }
  annot:   for (  MethodAnnotation ma : methodAnnotations) {
    IClass at=cg.getClassHierarchy().lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application,ma.annotationTypeName));
    for (    CGNode n : cg) {
      if (n.getMethod().getSignature().equals(ma.methodSig)) {
        for (        Annotation a : n.getMethod().getAnnotations()) {
          if (a.getType().equals(at.getReference())) {
            continue annot;
          }
        }
        Assert.assertFalse("String_Node_Str" + at,false);
      }
    }
  }
}
Program: 99738
Project: 99738
Buggy source:
protected CAstEntity parseJS(CAstImpl ast,SourceModule module) throws IOException {
  RhinoToAstTranslator translator=new RhinoToAstTranslator(ast,module,module.getName(),false);
  CAstEntity entity=translator.translateToCAst();
  return entity;
}

Fixed version (ground truth):
protected CAstEntity parseJS(CAstImpl ast,SourceModule module) throws IOException {
}
Program: 99739
Project: 99739
Buggy source:
protected CAstEntity parseJS(CAstImpl ast,SourceModule module) throws IOException {
  RhinoToAstTranslator translator=new RhinoToAstTranslator(ast,module,module.getName(),false);
  CAstEntity entity=translator.translateToCAst();
  return entity;
}

Fixed version (ground truth):
protected CAstEntity parseJS(CAstImpl ast,SourceModule module) throws IOException {
}
Program: 99740
Project: 99740
Buggy source:
public static void main(String args[]) throws ClassHierarchyException, IllegalArgumentException, IOException, CancelException {
  if (args.length != 1) {
    System.out.println("String_Node_Str");
    System.exit(1);
  }
  boolean domless=false;
  URL url=new URL(args[0]);
  JSCallGraphBuilderUtil.setTranslatorFactory(new CAstRhinoTranslatorFactory());
  JavaScriptLoader.addBootstrapFile(WebUtil.preamble);
  SourceModule[] sources=getSources(domless,url);
  JSCFABuilder builder=makeCGBuilder(new WebPageLoaderFactory(translatorFactory),sources,CGBuilderType.ZERO_ONE_CFA,AstIRFactory.makeDefaultFactory());
  builder.setBaseURL(url);
  CallGraph cg=builder.makeCallGraph(builder.getOptions());
  PointerAnalysis pa=builder.getPointerAnalysis();
  new JsViewer(cg,pa);
}

Fixed version (ground truth):
public static void main(String args[]) throws ClassHierarchyException, IllegalArgumentException, IOException, CancelException, Error {
  if (args.length != 1) {
    System.out.println("String_Node_Str");
    System.exit(1);
  }
  boolean domless=false;
  URL url=new URL(args[0]);
  JSCallGraphBuilderUtil.setTranslatorFactory(new CAstRhinoTranslatorFactory());
  JavaScriptLoader.addBootstrapFile(WebUtil.preamble);
  SourceModule[] sources=getSources(domless,url);
  JSCFABuilder builder=makeCGBuilder(new WebPageLoaderFactory(translatorFactory),sources,CGBuilderType.ZERO_ONE_CFA,AstIRFactory.makeDefaultFactory());
  builder.setBaseURL(url);
  CallGraph cg=builder.makeCallGraph(builder.getOptions());
  PointerAnalysis pa=builder.getPointerAnalysis();
  new JsViewer(cg,pa);
}
Program: 99741
Project: 99741
Buggy source:
private static SourceModule[] getSources(boolean domless,URL url) throws IOException {
  JSSourceExtractor sourceExtractor;
  if (domless) {
    sourceExtractor=new DomLessSourceExtractor();
  }
 else {
    sourceExtractor=new DefaultSourceExtractor();
  }
  Set<MappedSourceModule> sourcesMap=sourceExtractor.extractSources(url,new JerichoHtmlParser(),new IdentityUrlResolver());
  SourceModule[] sources=new SourceFileModule[sourcesMap.size()];
  int i=0;
  for (  SourceModule m : sourcesMap) {
    sources[i++]=m;
  }
  return sources;
}

Fixed version (ground truth):
private static SourceModule[] getSources(boolean domless,URL url) throws IOException, Error {
  JSSourceExtractor sourceExtractor;
  if (domless) {
    sourceExtractor=new DomLessSourceExtractor();
  }
 else {
    sourceExtractor=new DefaultSourceExtractor();
  }
  Set<MappedSourceModule> sourcesMap=sourceExtractor.extractSources(url,new JerichoHtmlParser(),new IdentityUrlResolver());
  SourceModule[] sources=new SourceFileModule[sourcesMap.size()];
  int i=0;
  for (  SourceModule m : sourcesMap) {
    sources[i++]=m;
  }
  return sources;
}
Program: 99742
Project: 99742
Buggy source:
/** 
 * Properly creates the String file name of a   {@link URL}. This works around a bug in the Sun implementation of   {@link URL#getFile()}, which doesn't properly handle file paths with spaces (see <a href= "http://sourceforge.net/tracker/index.php?func=detail&aid=1565842&group_id=176742&atid=878458" >bug report</a>). For now, fails with an assertion if the url is malformed.
 * @param url
 * @return the path name for the url
 * @throws IllegalArgumentException if url is null
 */
public String filePathFromURL(URL url){
  if (url == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  URI uri=new File(url.getPath()).toURI();
  String filePath=uri.getPath();
  return filePath;
}

Fixed version (ground truth):
/** 
 * Properly creates the String file name of a   {@link URL}. This works around a bug in the Sun implementation of   {@link URL#getFile()}, which doesn't properly handle file paths with spaces (see <a href= "http://sourceforge.net/tracker/index.php?func=detail&aid=1565842&group_id=176742&atid=878458" >bug report</a>). For now, fails with an assertion if the url is malformed.
 * @param url
 * @return the path name for the url
 * @throws IllegalArgumentException if url is null
 */
public String filePathFromURL(URL url){
  if (url == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  URI uri=new File(url.getPath()).toURI();
  try {
    return URLDecoder.decode(uri.getPath(),"String_Node_Str");
  }
 catch (  UnsupportedEncodingException e) {
    Assertions.UNREACHABLE();
    return null;
  }
}