nus-yam/ex-repair huggingface dataset:
Program: 99743
Project: 99743
Buggy source:
@Override public byte evaluate(final BitVectorVariable lhs,final BitVectorVariable[] rhs){
  IntSet intersect=lhs.getValue();
  if (intersect == null || intersect.isEmpty()) {
    return NOT_CHANGED_AND_FIXED;
  }
  for (  final BitVectorVariable bv : rhs) {
    final IntSet vlhs=bv.getValue();
    intersect=intersect.intersection(vlhs);
  }
  if (intersect.sameValue(lhs.getValue())) {
    return NOT_CHANGED;
  }
 else {
    final BitVectorVariable bvv=new BitVectorVariable();
    intersect.foreach(new IntSetAction(){
      @Override public void act(      final int x){
        bvv.set(x);
      }
    }
);
    lhs.copyState(bvv);
    return CHANGED;
  }
}

Fixed version (ground truth):
@Override public byte evaluate(final BitVectorVariable lhs,final BitVectorVariable[] rhs){
  IntSet intersect=lhs.getValue();
  if (intersect == null || intersect.isEmpty()) {
    intersect=rhs[0].getValue();
  }
  for (  final BitVectorVariable bv : rhs) {
    final IntSet vlhs=bv.getValue();
    intersect=intersect.intersection(vlhs);
  }
  if (lhs.getValue() != null && intersect.sameValue(lhs.getValue())) {
    return NOT_CHANGED;
  }
 else {
    final BitVectorVariable bvv=new BitVectorVariable();
    intersect.foreach(new IntSetAction(){
      @Override public void act(      final int x){
        bvv.set(x);
      }
    }
);
    lhs.copyState(bvv);
    return CHANGED;
  }
}
Program: 99744
Project: 99744
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(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(propertyReadResult,4,constVN));
    S.getNextProgramCounter();
    paramsToPassToInvoked[i]=propertyReadResult;
  }
  return curValNum;
}
Program: 99745
Project: 99745
Buggy source:
@Override public void run(){
  try {
    boolean repeat=true;
    while (repeat) {
      try {
        Thread.sleep(SLEEP_MS);
      }
 catch (      InterruptedException e1) {
      }
      drain();
      try {
        p.exitValue();
        repeat=false;
        drain();
        if (logger != null) {
          logger.fine("String_Node_Str" + p.exitValue());
        }
      }
 catch (      IllegalThreadStateException e) {
        repeat=true;
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    boolean repeat=true;
    while (repeat) {
      try {
        Thread.sleep(SLEEP_MS);
      }
 catch (      InterruptedException e1) {
      }
      drain();
      try {
        p.exitValue();
        repeat=false;
        blockingDrain();
        if (logger != null) {
          logger.fine("String_Node_Str" + p.exitValue());
        }
      }
 catch (      IllegalThreadStateException e) {
        repeat=true;
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 99746
Project: 99746
Buggy source:
abstract void drain() throws IOException ;

Fixed version (ground truth):
/** 
 * Drain data from the stream, but don't block.
 */
abstract void drain() throws IOException ;
Program: 99747
Project: 99747
Buggy source:
protected Drainer captureStdErr(Process p){
  final BufferedInputStream out=new BufferedInputStream(p.getErrorStream(),BUFFER_SIZE);
  final ByteArrayOutputStream b=new ByteArrayOutputStream(BUFFER_SIZE);
  Drainer result=new Drainer(p){
    @Override void drain() throws IOException {
      drainAndCatch(out,b);
    }
  }
;
  result.setCapture(b);
  result.start();
  return result;
}

Fixed version (ground truth):
protected Drainer captureStdErr(Process p){
  final BufferedInputStream out=new BufferedInputStream(p.getErrorStream(),BUFFER_SIZE);
  final ByteArrayOutputStream b=new ByteArrayOutputStream(BUFFER_SIZE);
  Drainer result=new Drainer(p){
    @Override void drain() throws IOException {
      drainAndCatch(out,b);
    }
    @Override void blockingDrain() throws IOException {
      blockingDrainAndCatch(out,b);
    }
  }
;
  result.setCapture(b);
  result.start();
  return result;
}
Program: 99748
Project: 99748
Buggy source:
private void drainAndCatch(BufferedInputStream s,ByteArrayOutputStream b) throws IOException {
  try {
    while (s.available() > 0) {
      byte[] data=new byte[s.available()];
      int nRead=s.read(data);
      b.write(data,0,nRead);
    }
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
/** 
 * Drain some data from the input stream, and append said data to b.  Do not block.
 */
private void drainAndCatch(BufferedInputStream s,ByteArrayOutputStream b) throws IOException {
  try {
    while (s.available() > 0) {
      byte[] data=new byte[s.available()];
      int nRead=s.read(data);
      b.write(data,0,nRead);
    }
  }
 catch (  IOException e) {
  }
}
Program: 99749
Project: 99749
Buggy source:
protected Thread drainStdErr(Process p){
  final BufferedInputStream err=new BufferedInputStream(p.getErrorStream(),BUFFER_SIZE);
  Thread result=new Drainer(p){
    @Override void drain() throws IOException {
      drainAndPrint(err,System.err);
    }
  }
;
  result.start();
  return result;
}

Fixed version (ground truth):
protected Thread drainStdErr(Process p){
  final BufferedInputStream err=new BufferedInputStream(p.getErrorStream(),BUFFER_SIZE);
  Thread result=new Drainer(p){
    @Override void drain() throws IOException {
      drainAndPrint(err,System.err);
    }
    @Override void blockingDrain() throws IOException {
      blockingDrainAndPrint(err,System.err);
    }
  }
;
  result.start();
  return result;
}
Program: 99750
Project: 99750
Buggy source:
protected Thread drainStdOut(Process p){
  final BufferedInputStream out=new BufferedInputStream(p.getInputStream(),BUFFER_SIZE);
  Thread result=new Drainer(p){
    @Override void drain() throws IOException {
      drainAndPrint(out,System.out);
    }
  }
;
  result.start();
  return result;
}

Fixed version (ground truth):
protected Thread drainStdOut(Process p){
  final BufferedInputStream out=new BufferedInputStream(p.getInputStream(),BUFFER_SIZE);
  Thread result=new Drainer(p){
    @Override void drain() throws IOException {
      drainAndPrint(out,System.out);
    }
    @Override void blockingDrain() throws IOException {
      blockingDrainAndPrint(out,System.out);
    }
  }
;
  result.start();
  return result;
}
Program: 99751
Project: 99751
Buggy source:
protected Drainer captureStdOut(Process p){
  final BufferedInputStream out=new BufferedInputStream(p.getInputStream(),BUFFER_SIZE);
  final ByteArrayOutputStream b=new ByteArrayOutputStream(BUFFER_SIZE);
  Drainer result=new Drainer(p){
    @Override void drain() throws IOException {
      drainAndCatch(out,b);
    }
  }
;
  result.setCapture(b);
  result.start();
  return result;
}

Fixed version (ground truth):
protected Drainer captureStdOut(Process p){
  final BufferedInputStream out=new BufferedInputStream(p.getInputStream(),BUFFER_SIZE);
  final ByteArrayOutputStream b=new ByteArrayOutputStream(BUFFER_SIZE);
  Drainer result=new Drainer(p){
    @Override void drain() throws IOException {
      drainAndCatch(out,b);
    }
    @Override void blockingDrain() throws IOException {
      blockingDrainAndCatch(out,b);
    }
  }
;
  result.setCapture(b);
  result.start();
  return result;
}
Program: 99752
Project: 99752
Buggy source:
private void drainAndPrint(BufferedInputStream s,PrintStream p) throws IOException {
  try {
    while (s.available() > 0) {
      byte[] data=new byte[s.available()];
      s.read(data);
      p.print(new String(data));
    }
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
/** 
 * Drain some data from the input stream, and print said data to p.  Do not block.
 */
private void drainAndPrint(BufferedInputStream s,PrintStream p) throws IOException {
  try {
    while (s.available() > 0) {
      byte[] data=new byte[s.available()];
      s.read(data);
      p.print(new String(data));
    }
  }
 catch (  IOException e) {
  }
}
Program: 99753
Project: 99753
Buggy source:
/** 
 * Process an element indicating a new allocation site.
 * @param atts
 */
private void processAllocation(Attributes atts){
  Language lang=scope.getLanguage(governingLoader.getLanguage());
  SSAInstructionFactory insts=lang.instructionFactory();
  String classString=atts.getValue(A_CLASS);
  final TypeReference type=TypeReference.findOrCreate(governingLoader,TypeName.string2TypeName(classString));
  String defVar=atts.getValue(A_DEF);
  if (symbolTable.keySet().contains(defVar)) {
    Assertions.UNREACHABLE("String_Node_Str" + defVar + "String_Node_Str"+ governingMethod);
  }
  if (defVar == null) {
    defVar="String_Node_Str" + nextLocal;
  }
  int defNum=nextLocal;
  symbolTable.put(defVar,new Integer(nextLocal++));
  NewSiteReference ref=NewSiteReference.make(governingMethod.getNextProgramCounter(),type);
  SSANewInstruction a=null;
  if (type.isArrayType()) {
    String size=atts.getValue(A_SIZE);
    Assertions.productionAssertion(size != null);
    Integer sNumber=symbolTable.get(size);
    Assertions.productionAssertion(sNumber != null);
    Assertions.productionAssertion(type.getDerivedMask() == ArrayMask || type.getDerivedMask() == ((ArrayMask << 2) | PrimitiveMask));
    a=insts.NewInstruction(defNum,ref,new int[]{sNumber.intValue()});
  }
 else {
    a=insts.NewInstruction(defNum,ref);
  }
  governingMethod.addStatement(a);
}

Fixed version (ground truth):
/** 
 * Process an element indicating a new allocation site.
 * @param atts
 */
private void processAllocation(Attributes atts){
  Language lang=scope.getLanguage(governingLoader.getLanguage());
  SSAInstructionFactory insts=lang.instructionFactory();
  String classString=atts.getValue(A_CLASS);
  final TypeReference type=TypeReference.findOrCreate(governingLoader,TypeName.string2TypeName(classString));
  String defVar=atts.getValue(A_DEF);
  if (symbolTable.keySet().contains(defVar)) {
    Assertions.UNREACHABLE("String_Node_Str" + defVar + "String_Node_Str"+ governingMethod);
  }
  if (defVar == null) {
    defVar="String_Node_Str" + nextLocal;
  }
  int defNum=nextLocal;
  symbolTable.put(defVar,new Integer(nextLocal++));
  NewSiteReference ref=NewSiteReference.make(governingMethod.getNextProgramCounter(),type);
  SSANewInstruction a=null;
  if (type.isArrayType()) {
    String size=atts.getValue(A_SIZE);
    Assertions.productionAssertion(size != null);
    Integer sNumber=symbolTable.get(size);
    Assertions.productionAssertion(sNumber != null);
    Assertions.productionAssertion(type.getDerivedMask() == ArrayMask || type.getDerivedMask() == ((ArrayMask << ElementBits) | PrimitiveMask));
    a=insts.NewInstruction(defNum,ref,new int[]{sNumber.intValue()});
  }
 else {
    a=insts.NewInstruction(defNum,ref);
  }
  governingMethod.addStatement(a);
}
Program: 99756
Project: 99756
Buggy source:
protected Set<CGNode> getTargetsForCall(final CGNode caller,final CallSiteReference site,InstanceKey[][] invs){
  IntSet params=contextSelector.getRelevantParameters(caller,site);
  if (!site.isStatic() && !params.contains(0)) {
    params=IntSetUtil.makeMutableCopy(params);
    ((MutableIntSet)params).add(0);
  }
  final Set<CGNode> targets=HashSetFactory.make();
  VoidFunction<InstanceKey[]> f=new VoidFunction<InstanceKey[]>(){
    public void apply(    InstanceKey[] v){
      IClass recv=null;
      if (site.isDispatch()) {
        recv=v[0].getConcreteType();
      }
      CGNode target=getTargetForCall(caller,site,recv,v);
      if (target != null) {
        targets.add(target);
      }
    }
  }
;
  iterateCrossProduct(caller,site,params,invs,f);
  return targets;
}

Fixed version (ground truth):
protected Set<CGNode> getTargetsForCall(final CGNode caller,final SSAAbstractInvokeInstruction instruction,InstanceKey[][] invs){
  final CallSiteReference site=instruction.getCallSite();
  IntSet params=contextSelector.getRelevantParameters(caller,site);
  if (!site.isStatic() && !params.contains(0)) {
    params=IntSetUtil.makeMutableCopy(params);
    ((MutableIntSet)params).add(0);
  }
  final Set<CGNode> targets=HashSetFactory.make();
  VoidFunction<InstanceKey[]> f=new VoidFunction<InstanceKey[]>(){
    public void apply(    InstanceKey[] v){
      IClass recv=null;
      if (site.isDispatch()) {
        recv=v[0].getConcreteType();
      }
      CGNode target=getTargetForCall(caller,site,recv,v);
      if (target != null) {
        targets.add(target);
      }
    }
  }
;
  iterateCrossProduct(caller,instruction,params,invs,f);
  return targets;
}
Program: 99757
Project: 99757
Buggy source:
private boolean isNamedVar(CAstNode n,String name){
  if (n.getKind() == CAstNode.VAR) {
    String nm=(String)n.getChild(0).getValue();
    return nm.equals(name);
  }
  return false;
}

Fixed version (ground truth):
private boolean isNamedVar(CAstNode n,Pattern namePattern){
  if (n.getKind() == CAstNode.VAR) {
    String nm=(String)n.getChild(0).getValue();
    return namePattern.matcher(nm).matches();
  }
  return false;
}
Program: 99758
Project: 99758
Buggy source:
@Override protected String[] getArgumentNames(CAstEntity f){
  if (super.getArgumentCount(f) >= v.getValue()) {
    return super.getArgumentNames(f);
  }
 else {
    String[] argNames=new String[v.getValue()];
    System.arraycopy(super.getArgumentNames(f),0,argNames,0,super.getArgumentCount(f));
    for (int i=super.getArgumentCount(f); i < argNames.length; i++) {
      argNames[i]="String_Node_Str" + (i + 1);
    }
    return argNames;
  }
}

Fixed version (ground truth):
@Override protected String[] getArgumentNames(CAstEntity f){
  if (super.getArgumentCount(f) >= v.getValue()) {
    return super.getArgumentNames(f);
  }
 else {
    String[] argNames=new String[v.getValue()];
    System.arraycopy(super.getArgumentNames(f),0,argNames,0,super.getArgumentCount(f));
    for (int i=super.getArgumentCount(f); i < argNames.length; i++) {
      argNames[i]="String_Node_Str" + i;
    }
    return argNames;
  }
}
Program: 99760
Project: 99760
Buggy source:
private CAstNode handleArgumentRef(CAstNode n){
  Object x=getStaticArgumentIndex(n);
  if (x != null) {
    if (x instanceof Number && ((Number)x).intValue() < v.getValue() - 2) {
      int arg=((Number)x).intValue() + 3;
      if (arg < e.getArgumentCount()) {
        return Ast.makeNode(CAstNode.VAR,Ast.makeConstant(e.getArgumentNames()[arg]));
      }
 else {
        return Ast.makeNode(CAstNode.VAR,Ast.makeConstant("String_Node_Str" + arg));
      }
    }
 else     if (x instanceof String && "String_Node_Str".equals(x)) {
      return Ast.makeConstant(v.getValue());
    }
  }
  return null;
}

Fixed version (ground truth):
private CAstNode handleArgumentRef(CAstNode n){
  Object x=getStaticArgumentIndex(n);
  if (x != null) {
    if (x instanceof Number && ((Number)x).intValue() < v.getValue() - 2) {
      int arg=((Number)x).intValue() + 2;
      if (arg < e.getArgumentCount()) {
        return Ast.makeNode(CAstNode.VAR,Ast.makeConstant(e.getArgumentNames()[arg]));
      }
 else {
        return Ast.makeNode(CAstNode.VAR,Ast.makeConstant("String_Node_Str" + arg));
      }
    }
 else     if (x instanceof String && "String_Node_Str".equals(x)) {
      return Ast.makeConstant(v.getValue());
    }
  }
  return null;
}
Program: 99761
Project: 99761
Buggy source:
private Object getIndexFromBaseVar(CAstNode n){
  if (n.getKind() == CAstNode.BLOCK_EXPR) {
    if (n.getChildCount() == 2) {
      CAstNode c1=n.getChild(0);
      if (c1.getKind() == CAstNode.ASSIGN) {
        if (isNamedVar(c1.getChild(0),"String_Node_Str")) {
          if (isNamedVar(c1.getChild(1),"String_Node_Str")) {
            CAstNode c2=n.getChild(1);
            if (c2.getKind() == CAstNode.OBJECT_REF || c2.getKind() == CAstNode.ARRAY_REF) {
              if (isNamedVar(c2.getChild(0),"String_Node_Str")) {
                return c2.getChild(1).getValue();
              }
            }
          }
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private Object getIndexFromBaseVar(CAstNode n){
  if (n.getKind() == CAstNode.BLOCK_EXPR) {
    if (n.getChildCount() == 2) {
      CAstNode c1=n.getChild(0);
      if (c1.getKind() == CAstNode.ASSIGN) {
        if (isNamedVar(c1.getChild(0),baseNameRegex)) {
          if (isNamedVar(c1.getChild(1),"String_Node_Str")) {
            CAstNode c2=n.getChild(1);
            if (c2.getKind() == CAstNode.OBJECT_REF || c2.getKind() == CAstNode.ARRAY_REF) {
              if (isNamedVar(c2.getChild(0),baseNameRegex)) {
                return c2.getChild(1).getValue();
              }
            }
          }
        }
      }
    }
  }
  return null;
}
Program: 99762
Project: 99762
Buggy source:
public IField getField(Atom name){
  if (declaredFields.containsKey(name)) {
    return declaredFields.get(name);
  }
 else   if (getSuperclass() != null) {
    return getSuperclass().getField(name);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public IField getField(Atom name,TypeName type){
  return getField(name);
}
Program: 99763
Project: 99763
Buggy source:
public IField getField(Atom name){
  return loader.lookupClass(superReference.getName()).getField(name);
}

Fixed version (ground truth):
public IField getField(Atom name,TypeName type){
  return loader.lookupClass(superReference.getName()).getField(name);
}
Program: 99764
Project: 99764
Buggy source:
/** 
 * @throws FileNotFoundException
 */
public static File getFileFromClassLoader(String fileName,ClassLoader loader) throws FileNotFoundException {
  if (loader == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (fileName == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  URL url=loader.getResource(fileName);
  if (DEBUG_LEVEL > 0) {
    System.err.println(("String_Node_Str" + url + "String_Node_Str"+ fileName));
  }
  if (url == null) {
    File f=new File(fileName);
    if (f.exists()) {
      return f;
    }
    throw new FileNotFoundException(fileName);
  }
 else {
    return new File(filePathFromURL(url));
  }
}

Fixed version (ground truth):
/** 
 * @throws FileNotFoundException
 */
public static File getFileFromClassLoader(String fileName,ClassLoader loader) throws FileNotFoundException {
  if (loader == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (fileName == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  URL url=null;
  try {
    url=loader.getResource(fileName);
  }
 catch (  Exception e) {
  }
  if (DEBUG_LEVEL > 0) {
    System.err.println(("String_Node_Str" + url + "String_Node_Str"+ fileName));
  }
  if (url == null) {
    File f=new File(fileName);
    if (f.exists()) {
      return f;
    }
    throw new FileNotFoundException(fileName);
  }
 else {
    return new File(filePathFromURL(url));
  }
}
Program: 99765
Project: 99765
Buggy source:
public void translate(final CAstEntity N,final WalkContext context){
  walkEntities(N,context);
}

Fixed version (ground truth):
public void translate(final CAstEntity N,final WalkContext context){
  final ExposedNamesCollector exposedNamesCollector=new ExposedNamesCollector();
  exposedNamesCollector.run(N);
  entity2ExposedNames=exposedNamesCollector.getEntity2ExposedNames();
  walkEntities(N,context);
}
Program: 99766
Project: 99766
Buggy source:
@Before public void setUp(){
  com.ibm.wala.cast.js.ipa.callgraph.Util.setTranslatorFactory(new CAstRhinoTranslatorFactory());
}

Fixed version (ground truth):
@Before public void setUp(){
  JSCallGraphUtil.setTranslatorFactory(new CAstRhinoTranslatorFactory());
}
Program: 99767
Project: 99767
Buggy source:
@Before public void setUp(){
  com.ibm.wala.cast.js.ipa.callgraph.Util.setTranslatorFactory(new CAstRhinoTranslatorFactory());
}

Fixed version (ground truth):
@Before public void setUp(){
  JSCallGraphUtil.setTranslatorFactory(new CAstRhinoTranslatorFactory());
}
Program: 99768
Project: 99768
Buggy source:
@Test public void testTranslateToCAstCrash3() throws IllegalArgumentException, IOException, CancelException {
  Util.makeScriptCG("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testTranslateToCAstCrash3() throws IllegalArgumentException, IOException, CancelException {
  JSCallGraphBuilderUtil.makeScriptCG("String_Node_Str","String_Node_Str");
}
Program: 99769
Project: 99769
Buggy source:
@Test public void testArgs() throws IOException, IllegalArgumentException, CancelException, ClassHierarchyException {
  JavaScriptLoaderFactory loaders=Util.makeLoaders();
  AnalysisScope scope=Util.makeScriptScope("String_Node_Str","String_Node_Str",loaders);
  IClassHierarchy cha=Util.makeHierarchy(scope,loaders);
  com.ibm.wala.cast.js.util.Util.checkForFrontEndErrors(cha);
  Iterable<Entrypoint> roots=Util.makeScriptRoots(cha);
  JSAnalysisOptions options=Util.makeOptions(scope,cha,roots);
  AnalysisCache cache=Util.makeCache(new ArgumentSpecialization.ArgumentCountIRFactory(options.getSSAOptions()));
  JSCFABuilder builder=new JSZeroOrOneXCFABuilder(cha,options,cache,null,null,ZeroXInstanceKeys.ALLOCATIONS,false);
  builder.setContextSelector(new ArgumentSpecialization.ArgumentCountContextSelector(builder.getContextSelector()));
  builder.setContextInterpreter(new ArgumentSpecialization.ArgumentSpecializationContextIntepreter(options,cache));
  CallGraph CG=builder.makeCallGraph(options);
  Util.AVOID_DUMP=false;
  Util.dumpCG(builder.getPointerAnalysis(),CG);
  verifyGraphAssertions(CG,assertionsForArgs);
}

Fixed version (ground truth):
@Test public void testArgs() throws IOException, IllegalArgumentException, CancelException, ClassHierarchyException {
  JavaScriptLoaderFactory loaders=JSCallGraphBuilderUtil.makeLoaders();
  AnalysisScope scope=JSCallGraphBuilderUtil.makeScriptScope("String_Node_Str","String_Node_Str",loaders);
  IClassHierarchy cha=JSCallGraphBuilderUtil.makeHierarchy(scope,loaders);
  com.ibm.wala.cast.js.util.Util.checkForFrontEndErrors(cha);
  Iterable<Entrypoint> roots=JSCallGraphBuilderUtil.makeScriptRoots(cha);
  JSAnalysisOptions options=JSCallGraphBuilderUtil.makeOptions(scope,cha,roots);
  AnalysisCache cache=JSCallGraphBuilderUtil.makeCache(new ArgumentSpecialization.ArgumentCountIRFactory(options.getSSAOptions()));
  JSCFABuilder builder=new JSZeroOrOneXCFABuilder(cha,options,cache,null,null,ZeroXInstanceKeys.ALLOCATIONS,false);
  builder.setContextSelector(new ArgumentSpecialization.ArgumentCountContextSelector(builder.getContextSelector()));
  builder.setContextInterpreter(new ArgumentSpecialization.ArgumentSpecializationContextIntepreter(options,cache));
  CallGraph CG=builder.makeCallGraph(options);
  CAstCallGraphUtil.AVOID_DUMP=false;
  CAstCallGraphUtil.dumpCG(builder.getPointerAnalysis(),CG);
  verifyGraphAssertions(CG,assertionsForArgs);
}
Program: 99770
Project: 99770
Buggy source:
@Test public void testEx1() throws IOException, IllegalArgumentException, CancelException {
  URL url=getClass().getClassLoader().getResource("String_Node_Str");
  JSCFABuilder builder=Util.makeHTMLCGBuilder(url);
  CallGraph CG=builder.makeCallGraph(builder.getOptions());
  Util.dumpCG(builder.getPointerAnalysis(),CG);
}

Fixed version (ground truth):
@Test public void testEx1() throws IOException, IllegalArgumentException, CancelException {
  URL url=getClass().getClassLoader().getResource("String_Node_Str");
  JSCFABuilder builder=JSCallGraphBuilderUtil.makeHTMLCGBuilder(url);
  CallGraph CG=builder.makeCallGraph(builder.getOptions());
  CAstCallGraphUtil.dumpCG(builder.getPointerAnalysis(),CG);
}
Program: 99771
Project: 99771
Buggy source:
@Test public void testSwineFlu() throws IOException, IllegalArgumentException, CancelException {
  URL url=new URL("String_Node_Str");
  CallGraph CG=JSCallGraphBuilderUtil.makeHTMLCG(url);
  verifyGraphAssertions(CG,assertionsForSwineFlu);
}

Fixed version (ground truth):
@Ignore("String_Node_Str") @Test public void testSwineFlu() throws IOException, IllegalArgumentException, CancelException {
  URL url=new URL("String_Node_Str");
  CallGraph CG=JSCallGraphBuilderUtil.makeHTMLCG(url);
  verifyGraphAssertions(CG,assertionsForSwineFlu);
}
Program: 99772
Project: 99772
Buggy source:
@Test public void testArgs() throws IOException, IllegalArgumentException, CancelException {
  CallGraph CG=Util.makeScriptCG("String_Node_Str","String_Node_Str");
  verifyGraphAssertions(CG,assertionsForArgs);
}

Fixed version (ground truth):
@Test public void testArgs() throws IOException, IllegalArgumentException, CancelException {
  CallGraph CG=JSCallGraphBuilderUtil.makeScriptCG("String_Node_Str","String_Node_Str");
  verifyGraphAssertions(CG,assertionsForArgs);
}
Program: 99773
Project: 99773
Buggy source:
@Test public void testCrawlPage17() throws IOException, IllegalArgumentException, CancelException {
}

Fixed version (ground truth):
@Test public void testCrawlPage17() throws IOException, IllegalArgumentException, CancelException {
  URL url=getClass().getClassLoader().getResource("String_Node_Str");
  CallGraph CG=JSCallGraphBuilderUtil.makeHTMLCG(url);
  verifyGraphAssertions(CG,assertionsForPage17);
}
Program: 99774
Project: 99774
Buggy source:
@Test public void testCrawlPage12() throws IOException, IllegalArgumentException, CancelException {
}

Fixed version (ground truth):
@Test public void testCrawlPage12() throws IOException, IllegalArgumentException, CancelException {
  URL url=getClass().getClassLoader().getResource("String_Node_Str");
  CallGraph CG=JSCallGraphBuilderUtil.makeHTMLCG(url);
  verifyGraphAssertions(CG,assertionsForPage12);
}
Program: 99775
Project: 99775
Buggy source:
private boolean forInOnFirstArg(IMethod method){
  MethodReference mref=method.getReference();
  if (method.getNumberOfParameters() < index)   return false;
  Boolean b=forInOnFirstArg_cache.get(mref);
  if (b != null)   return b;
  DefUse du=getDefUse(method);
  for (  SSAInstruction use : Iterator2Iterable.make(du.getUses(3))) {
    if (use instanceof EachElementGetInstruction) {
      forInOnFirstArg_cache.put(mref,true);
      return true;
    }
  }
  forInOnFirstArg_cache.put(mref,false);
  return false;
}

Fixed version (ground truth):
private boolean forInOnFirstArg(IMethod method){
  MethodReference mref=method.getReference();
  if (method.getNumberOfParameters() < index)   return false;
  Boolean b=forInOnFirstArg_cache.get(mref);
  if (b != null)   return b;
  DefUse du=getDefUse(method);
  for (  SSAInstruction use : Iterator2Iterable.make(du.getUses(index + 1))) {
    if (use instanceof EachElementGetInstruction) {
      forInOnFirstArg_cache.put(mref,true);
      return true;
    }
  }
  forInOnFirstArg_cache.put(mref,false);
  return false;
}
Program: 99776
Project: 99776
Buggy source:
private Frequency usesFirstArgAsPropertyName(IMethod method){
  MethodReference mref=method.getReference();
  if (method.getNumberOfParameters() < index)   return Frequency.NEVER;
  Frequency f=usesFirstArgAsPropertyName_cache.get(mref);
  if (f != null)   return f;
  boolean usedAsPropertyName=false, usedAsSomethingElse=false;
  DefUse du=getDefUse(method);
  for (  SSAInstruction use : Iterator2Iterable.make(du.getUses(3))) {
    if (use instanceof ReflectiveMemberAccess) {
      ReflectiveMemberAccess rma=(ReflectiveMemberAccess)use;
      if (rma.getMemberRef() == 3) {
        usedAsPropertyName=true;
        continue;
      }
    }
 else     if (use instanceof AstIsDefinedInstruction) {
      AstIsDefinedInstruction aidi=(AstIsDefinedInstruction)use;
      if (aidi.getNumberOfUses() > 1 && aidi.getUse(1) == 3) {
        usedAsPropertyName=true;
        continue;
      }
    }
    usedAsSomethingElse=true;
  }
  if (!usedAsPropertyName)   f=Frequency.NEVER;
 else   if (usedAsSomethingElse)   f=Frequency.SOMETIMES;
 else   f=Frequency.ALWAYS;
  usesFirstArgAsPropertyName_cache.put(mref,f);
  return f;
}

Fixed version (ground truth):
private Frequency usesFirstArgAsPropertyName(IMethod method){
  MethodReference mref=method.getReference();
  if (method.getNumberOfParameters() < index)   return Frequency.NEVER;
  Frequency f=usesFirstArgAsPropertyName_cache.get(mref);
  if (f != null)   return f;
  boolean usedAsPropertyName=false, usedAsSomethingElse=false;
  DefUse du=getDefUse(method);
  for (  SSAInstruction use : Iterator2Iterable.make(du.getUses(index + 1))) {
    if (use instanceof ReflectiveMemberAccess) {
      ReflectiveMemberAccess rma=(ReflectiveMemberAccess)use;
      if (rma.getMemberRef() == index + 1) {
        usedAsPropertyName=true;
        continue;
      }
    }
 else     if (use instanceof AstIsDefinedInstruction) {
      AstIsDefinedInstruction aidi=(AstIsDefinedInstruction)use;
      if (aidi.getNumberOfUses() > 1 && aidi.getUse(1) == index + 1) {
        usedAsPropertyName=true;
        continue;
      }
    }
    usedAsSomethingElse=true;
  }
  if (!usedAsPropertyName)   f=Frequency.NEVER;
 else   if (usedAsSomethingElse)   f=Frequency.SOMETIMES;
 else   f=Frequency.ALWAYS;
  usesFirstArgAsPropertyName_cache.put(mref,f);
  return f;
}
Program: 99777
Project: 99777
Buggy source:
private Set<CGNode> getLexicalDefiners(final CGNode opNode,final Pair<String,String> definer){
  if (definer == null) {
    return Collections.singleton(getBuilder().getCallGraph().getFakeRootNode());
  }
 else {
    final Set<CGNode> result=HashSetFactory.make();
    PointerKey F=getBuilder().getPointerKeyForLocal(opNode,1);
    IR ir=getBuilder().getCFAContextInterpreter().getIR(opNode);
    SymbolTable symtab=ir.getSymbolTable();
    DefUse du=getAnalysisCache().getSSACache().findOrCreateDU(ir,opNode.getContext());
    if (contentsAreInvariant(symtab,du,1)) {
      system.recordImplicitPointsToSet(F);
      final InstanceKey[] functionKeys=getInvariantContents(symtab,du,opNode,1);
      for (int f=0; f < functionKeys.length; f++) {
        system.findOrCreateIndexForInstanceKey(functionKeys[f]);
        ScopeMappingInstanceKey K=(ScopeMappingInstanceKey)functionKeys[f];
        Iterator<CGNode> x=K.getFunargNodes(definer);
        while (x.hasNext()) {
          result.add(x.next());
        }
      }
    }
 else {
      PointsToSetVariable FV=system.findOrCreatePointsToSet(F);
      if (FV.getValue() != null) {
        FV.getValue().foreach(new IntSetAction(){
          public void act(          int ptr){
            InstanceKey iKey=system.getInstanceKey(ptr);
            if (iKey instanceof ScopeMappingInstanceKey) {
              ScopeMappingInstanceKey K=(ScopeMappingInstanceKey)iKey;
              Iterator<CGNode> x=K.getFunargNodes(definer);
              while (x.hasNext()) {
                result.add(x.next());
              }
            }
 else {
              Assertions.UNREACHABLE("String_Node_Str" + iKey);
            }
          }
        }
);
      }
    }
    return result;
  }
}

Fixed version (ground truth):
private Set<CGNode> getLexicalDefiners(final CGNode opNode,final Pair<String,String> definer){
}
Program: 99779
Project: 99779
Buggy source:
public Context getCalleeTarget(CGNode caller,CallSiteReference site,IMethod callee,InstanceKey[] receiver){
  IClass declaringClass=callee.getDeclaringClass();
  IMethod method=declaringClass.getMethod(AstMethodReference.fnSelector);
  Context baseCtxt=base.getCalleeTarget(caller,site,callee,receiver);
  if (method != null) {
    String s=method.getReference().getDeclaringClass().getName().toString();
    if (s.equals("String_Node_Str")) {
      boolean isNonNullArray=false;
      if (receiver.length >= 4) {
        InstanceKey argsList=receiver[3];
        if (argsList != null && argsList.getConcreteType().equals(caller.getClassHierarchy().lookupClass(JavaScriptTypes.Array))) {
          isNonNullArray=true;
        }
      }
      if (USE_ONE_LEVEL_CALLSTRING)       baseCtxt=new DelegatingContext(oneLevel.getCalleeTarget(caller,site,callee,receiver),baseCtxt);
      return new ApplyContext(baseCtxt,isNonNullArray);
    }
  }
  return baseCtxt;
}

Fixed version (ground truth):
public Context getCalleeTarget(CGNode caller,CallSiteReference site,IMethod callee,InstanceKey[] receiver){
  IClass declaringClass=callee.getDeclaringClass();
  IMethod method=declaringClass.getMethod(AstMethodReference.fnSelector);
  Context baseCtxt=base.getCalleeTarget(caller,site,callee,receiver);
  if (method != null) {
    String s=method.getReference().getDeclaringClass().getName().toString();
    if (s.equals("String_Node_Str")) {
      boolean isNonNullArray=false;
      if (receiver.length >= 4) {
        InstanceKey argsList=receiver[3];
        if (argsList != null && argsList.getConcreteType().equals(caller.getClassHierarchy().lookupClass(JavaScriptTypes.Array))) {
          isNonNullArray=true;
        }
      }
      if (USE_ONE_LEVEL)       baseCtxt=oneLevel.getCalleeTarget(caller,site,callee,receiver);
      return new ApplyContext(baseCtxt,isNonNullArray);
    }
  }
  return baseCtxt;
}
Program: 99780
Project: 99780
Buggy source:
@Override public IMethod getCalleeTarget(CGNode caller,CallSiteReference site,IClass receiver){
  IMethod method=receiver.getMethod(AstMethodReference.fnSelector);
  if (method != null) {
    String s=method.getReference().getDeclaringClass().getName().toString();
    if (s.equals("String_Node_Str")) {
      final MethodReference ref=genSyntheticMethodRef(receiver);
      JavaScriptSummary S=new JavaScriptSummary(ref,1);
      return new JavaScriptSummarizedFunction(ref,S,receiver);
    }
  }
  return base.getCalleeTarget(caller,site,receiver);
}

Fixed version (ground truth):
@Override public IMethod getCalleeTarget(CGNode caller,CallSiteReference site,IClass receiver){
  IMethod method=receiver.getMethod(AstMethodReference.fnSelector);
  if (method != null) {
    String s=method.getReference().getDeclaringClass().getName().toString();
    if (s.equals("String_Node_Str")) {
      if (applyMethod == null) {
        applyMethod=createApplyDummyMethod(receiver);
      }
      return applyMethod;
    }
  }
  return base.getCalleeTarget(caller,site,receiver);
}
Program: 99781
Project: 99781
Buggy source:
@SuppressWarnings("String_Node_Str") public static void dumpCG(PointerAnalysis PA,CallGraph CG){
  if (AVOID_DUMP)   return;
  for (Iterator x=CG.iterator(); x.hasNext(); ) {
    CGNode N=(CGNode)x.next();
    System.err.print("String_Node_Str" + getShortName(N) + "String_Node_Str");
    boolean fst=true;
    for (Iterator<? extends CGNode> ns=CG.getSuccNodes(N); ns.hasNext(); ) {
      if (fst)       fst=false;
 else       System.err.print("String_Node_Str");
      System.err.print(getShortName(ns.next()));
    }
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str" + N.getGraphNodeId());
    IR ir=N.getIR();
    if (ir != null) {
      System.err.println(ir);
    }
 else {
      System.err.println("String_Node_Str");
    }
  }
  System.err.println("String_Node_Str");
  for (Iterator x=PA.getPointerKeys().iterator(); x.hasNext(); ) {
    PointerKey n=(PointerKey)x.next();
    try {
      System.err.println((n + "String_Node_Str" + PA.getPointsToSet(n)));
    }
 catch (    Throwable e) {
      System.err.println(("String_Node_Str" + n));
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static void dumpCG(PointerAnalysis PA,CallGraph CG){
  if (AVOID_DUMP)   return;
  for (Iterator x=CG.iterator(); x.hasNext(); ) {
    CGNode N=(CGNode)x.next();
    System.err.print("String_Node_Str" + getShortName(N) + "String_Node_Str");
    boolean fst=true;
    for (Iterator<? extends CGNode> ns=CG.getSuccNodes(N); ns.hasNext(); ) {
      if (fst)       fst=false;
 else       System.err.print("String_Node_Str");
      System.err.print(getShortName(ns.next()));
    }
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str" + N.getGraphNodeId() + "String_Node_Str"+ N.getContext());
    IR ir=N.getIR();
    if (ir != null) {
      System.err.println(ir);
    }
 else {
      System.err.println("String_Node_Str");
    }
  }
  System.err.println("String_Node_Str");
  for (Iterator x=PA.getPointerKeys().iterator(); x.hasNext(); ) {
    PointerKey n=(PointerKey)x.next();
    try {
      System.err.println((n + "String_Node_Str" + PA.getPointsToSet(n)));
    }
 catch (    Throwable e) {
      System.err.println(("String_Node_Str" + n));
    }
  }
}
Program: 99782
Project: 99782
Buggy source:
protected boolean useLexicalAccessesForExposedVars(){
  return false;
}

Fixed version (ground truth):
protected boolean useLexicalAccessesForExposedVars(){
  return NEW_LEXICAL;
}
Program: 99783
Project: 99783
Buggy source:
protected boolean useLocalValuesForLexicalVars(){
  return true;
}

Fixed version (ground truth):
protected boolean useLocalValuesForLexicalVars(){
  return !NEW_LEXICAL;
}
Program: 99784
Project: 99784
Buggy source:
/** 
 * generate instructions for a write of a global
 */
protected void doGlobalWrite(WalkContext context,String name,int rval){
  Symbol S=context.currentScope().lookup(name);
  if (treatGlobalsAsLexicallyScoped()) {
    if (useLocalValuesForLexicalVars()) {
      int vn=S.valueNumber();
      Access A=new Access(name,null,vn);
      addExposedName(context.top(),null,name,vn,true,context);
      addAccess(context,context.top(),A);
      context.cfg().addInstruction(new AssignInstruction(vn,rval));
      context.cfg().addInstruction(new AstLexicalWrite(A));
    }
 else {
      Access A=new Access(name,null,rval);
      context.cfg().addInstruction(new AstLexicalWrite(A));
    }
  }
 else {
    FieldReference global=makeGlobalRef(name);
    context.cfg().addInstruction(new AstGlobalWrite(global,rval));
  }
}

Fixed version (ground truth):
/** 
 * generate instructions for a write of a global
 */
protected void doGlobalWrite(WalkContext context,String name,int rval){
  Symbol S=context.currentScope().lookup(name);
  if (treatGlobalsAsLexicallyScoped()) {
    if (useLocalValuesForLexicalVars()) {
      int vn=S.valueNumber();
      Access A=new Access(name,null,vn);
      addExposedName(context.top(),null,name,vn,true,context);
      addAccess(context,context.top(),A);
      context.cfg().addInstruction(new AssignInstruction(vn,rval));
      context.cfg().addInstruction(new AstLexicalWrite(A));
    }
 else {
      Access A=new Access(name,null,rval);
      context.cfg().addInstruction(new AstLexicalWrite(A));
      addAccess(context,context.top(),A);
    }
  }
 else {
    FieldReference global=makeGlobalRef(name);
    context.cfg().addInstruction(new AstGlobalWrite(global,rval));
  }
}
Program: 99785
Project: 99785
Buggy source:
/** 
 * Note that the caller is responsible for ensuring that name is defined in a lexical scope.
 */
protected void doLexicallyScopedWrite(WalkContext context,String name,int rval){
  Symbol S=context.currentScope().lookup(name);
  Scope definingScope=S.getDefiningScope();
  CAstEntity E=definingScope.getEntity();
  addExposedName(E,E,name,definingScope.lookup(name).valueNumber(),true,context);
  if (useLocalValuesForLexicalVars()) {
    markExposedInEnclosingEntities(context,name,definingScope,E,context.getEntityName(E),true);
    context.cfg().addInstruction(new AssignInstruction(S.valueNumber(),rval));
    Access A=new Access(name,context.getEntityName(E),rval);
    context.cfg().addInstruction(new AstLexicalWrite(A));
  }
 else {
    Access A=new Access(name,context.getEntityName(E),rval);
    context.cfg().addInstruction(new AstLexicalWrite(A));
  }
}

Fixed version (ground truth):
/** 
 * Note that the caller is responsible for ensuring that name is defined in a lexical scope.
 */
protected void doLexicallyScopedWrite(WalkContext context,String name,int rval){
  Symbol S=context.currentScope().lookup(name);
  Scope definingScope=S.getDefiningScope();
  CAstEntity E=definingScope.getEntity();
  addExposedName(E,E,name,definingScope.lookup(name).valueNumber(),true,context);
  if (useLocalValuesForLexicalVars()) {
    markExposedInEnclosingEntities(context,name,definingScope,E,context.getEntityName(E),true);
    context.cfg().addInstruction(new AssignInstruction(S.valueNumber(),rval));
    Access A=new Access(name,context.getEntityName(E),rval);
    context.cfg().addInstruction(new AstLexicalWrite(A));
  }
 else {
    Access A=new Access(name,context.getEntityName(E),rval);
    context.cfg().addInstruction(new AstLexicalWrite(A));
    addAccess(context,context.top(),A);
  }
}
Program: 99786
Project: 99786
Buggy source:
/** 
 * generate instructions for a read of a global
 */
protected int doGlobalRead(CAstNode node,WalkContext context,String name){
  Symbol S=context.currentScope().lookup(name);
  if (treatGlobalsAsLexicallyScoped()) {
    if (useLocalValuesForLexicalVars()) {
      int vn=S.valueNumber();
      Access A=new Access(name,null,vn);
      addExposedName(context.top(),null,name,vn,false,context);
      addAccess(context,context.top(),A);
      return vn;
    }
 else {
      int result=context.currentScope().allocateTempValue();
      Access A=new Access(name,null,result);
      context.cfg().addInstruction(new AstLexicalRead(A));
      return result;
    }
  }
 else {
    int result=context.currentScope().allocateTempValue();
    FieldReference global=makeGlobalRef(name);
    context.cfg().addInstruction(new AstGlobalRead(result,global));
    return result;
  }
}

Fixed version (ground truth):
/** 
 * generate instructions for a read of a global
 */
protected int doGlobalRead(CAstNode node,WalkContext context,String name){
  Symbol S=context.currentScope().lookup(name);
  if (treatGlobalsAsLexicallyScoped()) {
    if (useLocalValuesForLexicalVars()) {
      int vn=S.valueNumber();
      Access A=new Access(name,null,vn);
      addExposedName(context.top(),null,name,vn,false,context);
      addAccess(context,context.top(),A);
      return vn;
    }
 else {
      int result=context.currentScope().allocateTempValue();
      Access A=new Access(name,null,result);
      context.cfg().addInstruction(new AstLexicalRead(A));
      addAccess(context,context.top(),A);
      return result;
    }
  }
 else {
    int result=context.currentScope().allocateTempValue();
    FieldReference global=makeGlobalRef(name);
    context.cfg().addInstruction(new AstGlobalRead(result,global));
    return result;
  }
}
Program: 99787
Project: 99787
Buggy source:
/** 
 * we only have this method to avoid having to pass a node parameter at other call sites, as would be required for  {@link #doLexicallyScopedRead(CAstNode,WalkContext,String)}
 */
private int doLexReadHelper(WalkContext context,final String name){
  Symbol S=context.currentScope().lookup(name);
  Scope definingScope=S.getDefiningScope();
  CAstEntity E=definingScope.getEntity();
  addExposedName(E,E,name,definingScope.lookup(name).valueNumber(),false,context);
  final String entityName=context.getEntityName(E);
  if (useLocalValuesForLexicalVars()) {
    markExposedInEnclosingEntities(context,name,definingScope,E,entityName,false);
    return S.valueNumber();
  }
 else {
    int result=context.currentScope().allocateTempValue();
    Access A=new Access(name,entityName,result);
    context.cfg().addInstruction(new AstLexicalRead(A));
    return result;
  }
}

Fixed version (ground truth):
/** 
 * we only have this method to avoid having to pass a node parameter at other call sites, as would be required for  {@link #doLexicallyScopedRead(CAstNode,WalkContext,String)}
 */
private int doLexReadHelper(WalkContext context,final String name){
  Symbol S=context.currentScope().lookup(name);
  Scope definingScope=S.getDefiningScope();
  CAstEntity E=definingScope.getEntity();
  addExposedName(E,E,name,definingScope.lookup(name).valueNumber(),false,context);
  final String entityName=context.getEntityName(E);
  if (useLocalValuesForLexicalVars()) {
    markExposedInEnclosingEntities(context,name,definingScope,E,entityName,false);
    return S.valueNumber();
  }
 else {
    int result=context.currentScope().allocateTempValue();
    Access A=new Access(name,entityName,result);
    context.cfg().addInstruction(new AstLexicalRead(A));
    addAccess(context,context.top(),A);
    return result;
  }
}
Program: 99788
Project: 99788
Buggy source:
/** 
 * record that in entity e, the access is performed using a local variable. in  {@link #patchLexicalAccesses(SSAInstruction[],Set)}, this information is used to update an instruction that performs all the accesses at the beginning of the method and defines the locals.
 */
private void addAccess(WalkContext context,CAstEntity e,Access access){
}

Fixed version (ground truth):
/** 
 * record that in entity e, the access is performed. If   {@link #useLocalValuesForLexicalVars()} is true, the access is performedusing a local variable. in {@link #patchLexicalAccesses(SSAInstruction[],Set)}, this information is used to update an instruction that performs all the accesses at the beginning of the method and defines the locals.
 */
private void addAccess(WalkContext context,CAstEntity e,Access access){
  context.getAccesses(e).add(access);
}
Program: 99789
Project: 99789
Buggy source:
public Context getCalleeTarget(CGNode caller,CallSiteReference site,IMethod callee,final InstanceKey[] receiver){
  Context baseContext=base.getCalleeTarget(caller,site,callee,receiver);
  String calleeFullName=callee.getDeclaringClass().getName().toString();
  String calleeShortName=calleeFullName.substring(calleeFullName.lastIndexOf('/') + 1);
  if (USE_NAME_TO_SELECT_CONTEXT) {
    if (calleeShortName.contains(HACK_METHOD_STR) && receiver.length > index) {
      return new ForInContext(baseContext,simulateToString(caller.getClassHierarchy(),receiver[index]));
    }
  }
 else   if (receiver.length > index) {
    Frequency f=usesFirstArgAsPropertyName(callee);
    if (f == Frequency.ALWAYS) {
      return new ForInContext(baseContext,simulateToString(caller.getClassHierarchy(),receiver[index]));
    }
 else     if (receiver[index] != null && (f == Frequency.SOMETIMES || forInOnFirstArg(callee))) {
      return new ForInContext(baseContext,receiver[index]);
    }
  }
  if (USE_CPA_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    return new SelectiveCPAContext(baseContext,receiver);
  }
 else   if (USE_1LEVEL_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    if (!identifyDependentParameters(caller,site).isEmpty()) {
      return oneLevel.getCalleeTarget(caller,site,callee,receiver);
    }
 else {
      return baseContext;
    }
  }
  return baseContext;
}

Fixed version (ground truth):
public Context getCalleeTarget(CGNode caller,CallSiteReference site,IMethod callee,final InstanceKey[] receiver){
  Context baseContext=base.getCalleeTarget(caller,site,callee,receiver);
  String calleeFullName=callee.getDeclaringClass().getName().toString();
  String calleeShortName=calleeFullName.substring(calleeFullName.lastIndexOf('/') + 1);
  if (USE_NAME_TO_SELECT_CONTEXT) {
    if (calleeShortName.contains(HACK_METHOD_STR) && receiver.length > index) {
      return new ForInContext(baseContext,simulateToString(caller.getClassHierarchy(),receiver[index]));
    }
  }
 else   if (receiver.length > index) {
    Frequency f=usesFirstArgAsPropertyName(callee);
    if (f == Frequency.ALWAYS) {
      return new ForInContext(baseContext,simulateToString(caller.getClassHierarchy(),receiver[index]));
    }
 else     if (f == Frequency.SOMETIMES || forInOnFirstArg(callee)) {
      if (receiver[index] == null) {
        IClass undef=caller.getClassHierarchy().lookupClass(JavaScriptTypes.Undefined);
        return new ForInContext(baseContext,new ConcreteTypeKey(undef));
      }
 else {
        return new ForInContext(baseContext,receiver[index]);
      }
    }
  }
  if (USE_CPA_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    return new SelectiveCPAContext(baseContext,receiver);
  }
 else   if (USE_1LEVEL_IN_BODIES && FORIN_MARKER.equals(caller.getContext().get(FORIN_KEY))) {
    if (!identifyDependentParameters(caller,site).isEmpty()) {
      return oneLevel.getCalleeTarget(caller,site,callee,receiver);
    }
 else {
      return baseContext;
    }
  }
  return baseContext;
}