nus-yam/ex-repair huggingface dataset:
Program: 99996
Project: 99996
Buggy source:
/** 
 * Use the search engine to find all methods in a java element
 */
public static Collection<IMethod> findMethods(IJavaElement elt){
  if (elt instanceof ICompilationUnit) {
    Collection<IMethod> result=HashSetFactory.make();
    for (    IType type : getClasses((ICompilationUnit)elt)) {
      try {
        for (        IMethod m : type.getMethods()) {
          result.add(m);
        }
      }
 catch (      JavaModelException e) {
        e.printStackTrace();
      }
    }
    return result;
  }
 else {
    final Collection<IMethod> result=HashSetFactory.make();
    SearchPattern p=SearchPattern.createPattern("String_Node_Str",IJavaSearchConstants.METHOD,IJavaSearchConstants.DECLARATIONS,SearchPattern.R_PATTERN_MATCH);
    IJavaSearchScope scope=SearchEngine.createJavaSearchScope(new IJavaElement[]{elt},IJavaSearchScope.SOURCES);
    SearchEngine engine=new SearchEngine();
    SearchRequestor requestor=new SearchRequestor(){
      @Override public void acceptSearchMatch(      SearchMatch match) throws CoreException {
        result.add((IMethod)match.getElement());
      }
    }
;
    try {
      engine.search(p,new SearchParticipant[]{SearchEngine.getDefaultSearchParticipant()},scope,requestor,null);
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
    return result;
  }
}

Fixed version (ground truth):
/** 
 * Use the search engine to find all methods in a java element
 */
public static Collection<IMethod> findMethods(IJavaElement elt){
  if (elt instanceof ICompilationUnit) {
    Collection<IMethod> result=HashSetFactory.make();
    for (    IType type : getClasses((ICompilationUnit)elt)) {
      try {
        for (        IMethod m : type.getMethods()) {
          result.add(m);
        }
      }
 catch (      JavaModelException e) {
        e.printStackTrace();
      }
    }
    return result;
  }
 else {
    final Collection<IMethod> result=HashSetFactory.make();
    SearchPattern p=SearchPattern.createPattern("String_Node_Str",IJavaSearchConstants.METHOD,IJavaSearchConstants.DECLARATIONS,SearchPattern.R_PATTERN_MATCH);
    SearchPattern p2=SearchPattern.createPattern("String_Node_Str",IJavaSearchConstants.CONSTRUCTOR,IJavaSearchConstants.DECLARATIONS,SearchPattern.R_PATTERN_MATCH);
    IJavaSearchScope scope=SearchEngine.createJavaSearchScope(new IJavaElement[]{elt},IJavaSearchScope.SOURCES);
    SearchEngine engine=new SearchEngine();
    SearchRequestor requestor=new SearchRequestor(){
      @Override public void acceptSearchMatch(      SearchMatch match) throws CoreException {
        if (match.getElement() instanceof IMethod) {
          result.add((IMethod)match.getElement());
        }
      }
    }
;
    try {
      engine.search(p,new SearchParticipant[]{SearchEngine.getDefaultSearchParticipant()},scope,requestor,null);
      engine.search(p2,new SearchParticipant[]{SearchEngine.getDefaultSearchParticipant()},scope,requestor,null);
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
    return result;
  }
}
Program: 99997
Project: 99997
Buggy source:
public void testSlice2() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA,CallGraphTestUtil.REGRESSION_EXCLUSIONS);
  ClassHierarchy cha=ClassHierarchy.make(scope);
  Iterable<Entrypoint> entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.SLICE2_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  CallGraphBuilder builder=Util.makeZeroOneCFABuilder(options,new AnalysisCache(),cha,scope);
  CallGraph cg=builder.makeCallGraph(options,null);
  CGNode main=findMethod(cg,"String_Node_Str");
  Statement s=findCallTo(main,"String_Node_Str");
  System.err.println("String_Node_Str" + s);
  Collection<Statement> computeBackwardSlice=Slicer.computeBackwardSlice(s,cg,builder.getPointerAnalysis(),DataDependenceOptions.FULL,ControlDependenceOptions.NONE);
  Collection<Statement> slice=computeBackwardSlice;
  dumpSlice(slice);
  assertEquals(22,slice.size());
}

Fixed version (ground truth):
public void testSlice2() throws ClassHierarchyException, IllegalArgumentException, CancelException, IOException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA,CallGraphTestUtil.REGRESSION_EXCLUSIONS);
  ClassHierarchy cha=ClassHierarchy.make(scope);
  Iterable<Entrypoint> entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.SLICE2_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  CallGraphBuilder builder=Util.makeZeroOneCFABuilder(options,new AnalysisCache(),cha,scope);
  CallGraph cg=builder.makeCallGraph(options,null);
  CGNode main=findMethod(cg,"String_Node_Str");
  Statement s=findCallTo(main,"String_Node_Str");
  System.err.println("String_Node_Str" + s);
  Collection<Statement> computeBackwardSlice=Slicer.computeBackwardSlice(s,cg,builder.getPointerAnalysis(),DataDependenceOptions.FULL,ControlDependenceOptions.NONE);
  Collection<Statement> slice=computeBackwardSlice;
  dumpSlice(slice);
  assertEquals(30,slice.size());
}
Program: 99998
Project: 99998
Buggy source:
protected TabulationCancelException(CancelException cause,Result r){
  super(cause);
  this.result=r;
}

Fixed version (ground truth):
protected TabulationCancelException(Exception cause,Result r){
  super(cause);
  this.result=r;
}
Program: 99999
Project: 99999
Buggy source:
/** 
 * Solve the dataflow problem.
 * @return a representation of the result
 */
public TabulationResult<T,P> solve() throws CancelException {
  try {
    initialize();
    forwardTabulateSLRPs();
    Result r=new Result();
    return r;
  }
 catch (  CancelException e) {
    Result r=new Result();
    throw new TabulationCancelException(e,r);
  }
}

Fixed version (ground truth):
/** 
 * Solve the dataflow problem.
 * @return a representation of the result
 */
public TabulationResult<T,P> solve() throws CancelException {
  try {
    initialize();
    forwardTabulateSLRPs();
    Result r=new Result();
    return r;
  }
 catch (  CancelException e) {
    Result r=new Result();
    throw new TabulationCancelException(e,r);
  }
catch (  CancelRuntimeException e) {
    Result r=new Result();
    throw new TabulationCancelException(e,r);
  }
}
Program: 100000
Project: 100000
Buggy source:
/** 
 * Return the entry basic block for the CFG.
 * @return the entry basic block for the CFG.
 */
public T entry(){
  return getNode(0);
}

Fixed version (ground truth):
/** 
 * Return the entry basic block for the CFG.
 */
public T entry(){
  return getNode(0);
}
Program: 100001
Project: 100001
Buggy source:
/** 
 * Return the exit basic block for the CFG.
 * @return the exit basic block for the CFG.
 */
public T exit(){
  return exit;
}

Fixed version (ground truth):
/** 
 * Return the exit basic block for the CFG.
 */
public T exit(){
  return exit;
}
Program: 100002
Project: 100002
Buggy source:
/** 
 * @param method
 */
protected AbstractCFG(IMethod method){
  this.method=method;
  this.catchBlocks=new BitVector(10);
}

Fixed version (ground truth):
protected AbstractCFG(IMethod method){
  this.method=method;
  this.catchBlocks=new BitVector(10);
}
Program: 100003
Project: 100003
Buggy source:
public static ExplodedInterproceduralCFG make(CallGraph CG){
  return new ExplodedInterproceduralCFG(CG);
}

Fixed version (ground truth):
public static ExplodedInterproceduralCFG make(CallGraph cg){
  return new ExplodedInterproceduralCFG(cg);
}
Program: 100004
Project: 100004
Buggy source:
public boolean isEntryBlock(){
  return original.isEntryBlock();
}

Fixed version (ground truth):
public boolean isEntryBlock(){
  return instructionIndex == ENTRY_INDEX;
}
Program: 100005
Project: 100005
Buggy source:
public int getPredNodeCount(ExplodedBasicBlock b) throws IllegalArgumentException {
  if (b == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (b.isEntryBlock()) {
    return 0;
  }
  if (b.equals(exit) || b.instructionIndex == b.original.getFirstInstructionIndex()) {
    return ir.getControlFlowGraph().getPredNodeCount(b.original);
  }
 else {
    return 1;
  }
}

Fixed version (ground truth):
public int getPredNodeCount(ExplodedBasicBlock b) throws IllegalArgumentException {
  if (b == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (b.isEntryBlock()) {
    return 0;
  }
  if (b.isExitBlock()) {
    return ir.getControlFlowGraph().getPredNodeCount(ir.getControlFlowGraph().exit());
  }
  if (b.instructionIndex == b.original.getFirstInstructionIndex()) {
    if (b.original.isEntryBlock()) {
      return 1;
    }
 else {
      return ir.getControlFlowGraph().getPredNodeCount(b.original);
    }
  }
 else {
    return 1;
  }
}
Program: 100006
Project: 100006
Buggy source:
public boolean isCatchBlock(){
  return (original.isCatchBlock() && instructionIndex == original.getFirstInstructionIndex());
}

Fixed version (ground truth):
public boolean isCatchBlock(){
  if (original == null) {
    return false;
  }
  return (original.isCatchBlock() && instructionIndex == original.getFirstInstructionIndex());
}
Program: 100007
Project: 100007
Buggy source:
public ExplodedBasicBlock(int instructionIndex,ISSABasicBlock original){
}

Fixed version (ground truth):
public ExplodedBasicBlock(int instructionIndex,ISSABasicBlock original){
  this.instructionIndex=instructionIndex;
  this.original=original;
}
Program: 100008
Project: 100008
Buggy source:
public boolean isExitBlock(){
  return original.isExitBlock();
}

Fixed version (ground truth):
public boolean isExitBlock(){
  return instructionIndex == EXIT_INDEX;
}
Program: 100009
Project: 100009
Buggy source:
private T getDominator(T node){
  return getInfo(node).dominator;
}

Fixed version (ground truth):
private T getDominator(T node){
}
Program: 100010
Project: 100010
Buggy source:
/** 
 * The goal of this step is to perform a DFS numbering on the CFG, starting at the root. The exit node is not included.
 */
private void step1(){
  reachableNodeCount=0;
  DFSDiscoverTimeIterator<T> dfs=new SlowDFSDiscoverTimeIterator<T>(G,root){
    public static final long serialVersionUID=88831771771711L;
    @Override protected void visitEdge(    T from,    T to){
      if (DEBUG)       System.out.println("String_Node_Str" + from + "String_Node_Str"+ to);
      setParent(to,from);
    }
  }
;
  while (dfs.hasNext()) {
    T node=dfs.next();
    vertex[++reachableNodeCount]=node;
    setSemi(node,reachableNodeCount);
    if (DEBUG)     System.out.println(node + "String_Node_Str" + reachableNodeCount);
  }
}

Fixed version (ground truth):
/** 
 * The goal of this step is to perform a DFS numbering on the CFG, starting at the root. The exit node is not included.
 */
private void step1(){
}
Program: 100011
Project: 100011
Buggy source:
@Override protected final DominatorInfo getInfo(T node){
  return (DominatorInfo)infoMap[getGraph().getNumber(node)];
}

Fixed version (ground truth):
@Override protected final DominatorInfo getInfo(T node){
}
Program: 100012
Project: 100012
Buggy source:
/** 
 * @param catchClasses Set of TypeReference
 * @param klass an Exception Class
 * @return true iff klass is a subclass of some element of the Set
 * @throws IllegalArgumentException if catchClasses is null
 */
public static boolean catches(Set<IClass> catchClasses,IClass klass,IClassHierarchy cha){
  if (catchClasses == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (catchClasses.size() == 1) {
    IClass c=catchClasses.iterator().next();
    if (c.getReference().equals(TypeReference.JavaLangThread)) {
      return true;
    }
  }
  for (  IClass c : catchClasses) {
    if (cha.isAssignableFrom(c,klass)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param catchClasses Set of TypeReference
 * @param klass an Exception Class
 * @return true iff klass is a subclass of some element of the Set
 * @throws IllegalArgumentException if catchClasses is null
 */
public static boolean catches(Set<IClass> catchClasses,IClass klass,IClassHierarchy cha){
  if (catchClasses == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (catchClasses.size() == 1) {
    IClass c=catchClasses.iterator().next();
    if (c != null && c.getReference().equals(TypeReference.JavaLangThread)) {
      return true;
    }
  }
  for (  IClass c : catchClasses) {
    if (c != null && cha.isAssignableFrom(c,klass)) {
      return true;
    }
  }
  return false;
}
Program: 100013
Project: 100013
Buggy source:
/** 
 * Compute an analysis scope for the current selection
 * @throws IOException 
 * @throws JavaModelException 
 */
public static AnalysisScope computeScope(IStructuredSelection selection) throws JavaModelException, IOException {
  Collection<EclipseProjectPath> projectPaths=HashSetFactory.make();
  for (Iterator it=selection.iterator(); it.hasNext(); ) {
    Object object=it.next();
    if (object instanceof IJavaElement) {
      IJavaElement e=(IJavaElement)object;
      IJavaProject jp=e.getJavaProject();
      projectPaths.add(EclipseProjectPath.make(ResourcesPlugin.getWorkspace().getRoot().getLocation(),jp));
    }
 else {
      Assertions.UNREACHABLE(object.getClass());
    }
  }
  AnalysisScope scope=mergeProjectPaths(projectPaths);
  return scope;
}

Fixed version (ground truth):
/** 
 * Compute an analysis scope for the current selection
 * @throws IOException 
 * @throws JavaModelException 
 */
public static AnalysisScope computeScope(IStructuredSelection selection) throws JavaModelException, IOException {
  Collection<EclipseProjectPath> projectPaths=HashSetFactory.make();
  for (Iterator it=selection.iterator(); it.hasNext(); ) {
    Object object=it.next();
    if (object instanceof IJavaElement) {
      IJavaElement e=(IJavaElement)object;
      IJavaProject jp=e.getJavaProject();
      projectPaths.add(EclipseProjectPath.make(jp));
    }
 else {
      Assertions.UNREACHABLE(object.getClass());
    }
  }
  AnalysisScope scope=mergeProjectPaths(projectPaths);
  return scope;
}
Program: 100014
Project: 100014
Buggy source:
protected EclipseProjectPath(IPath workspaceRootPath,IJavaProject project) throws JavaModelException, IOException {
}

Fixed version (ground truth):
protected EclipseProjectPath(IJavaProject project) throws JavaModelException, IOException {
}
Program: 100015
Project: 100015
Buggy source:
public static EclipseProjectPath make(IPath workspaceRootPath,IJavaProject project) throws JavaModelException, IOException {
  if (workspaceRootPath == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return new EclipseProjectPath(workspaceRootPath,project);
}

Fixed version (ground truth):
public static EclipseProjectPath make(IJavaProject project) throws JavaModelException, IOException {
  return new EclipseProjectPath(project);
}
Program: 100016
Project: 100016
Buggy source:
protected IPath makeAbsolute(IPath p){
  if (p.toFile().exists()) {
    return p;
  }
  return workspaceRootPath.append(p);
}

Fixed version (ground truth):
protected IPath makeAbsolute(IPath p){
  if (p.toFile().exists()) {
    return p;
  }
  String projectName=p.segment(0);
  IJavaProject jp=JdtUtil.getJavaProject(projectName);
  if (jp != null) {
    if (jp.getProject().getRawLocation() != null) {
      return jp.getProject().getRawLocation().append(p.removeFirstSegments(1));
    }
 else {
      IWorkspaceRoot workspaceRoot=ResourcesPlugin.getWorkspace().getRoot();
      return workspaceRoot.getLocation().append(p);
    }
  }
 else {
    Assertions.UNREACHABLE("String_Node_Str" + p);
    return null;
  }
}
Program: 100017
Project: 100017
Buggy source:
/** 
 * compute the analysis scope for a project in the current workspace
 * @throws IOException 
 * @throws JavaModelException 
 */
public static AnalysisScope computeScope(String projectName) throws JavaModelException, IOException {
  IJavaProject jp=getProjectFromWorkspace(projectName);
  IWorkspaceRoot workspaceRoot=ResourcesPlugin.getWorkspace().getRoot();
  EclipseProjectPath path=EclipseProjectPath.make(workspaceRoot.getLocation(),jp);
  return path.toAnalysisScope(null);
}

Fixed version (ground truth):
/** 
 * compute the analysis scope for a project in the current workspace
 * @throws IOException 
 * @throws JavaModelException 
 */
public static AnalysisScope computeScope(String projectName) throws JavaModelException, IOException {
  IJavaProject jp=getProjectFromWorkspace(projectName);
  EclipseProjectPath path=EclipseProjectPath.make(jp);
  return path.toAnalysisScope(null);
}
Program: 100020
Project: 100020
Buggy source:
private boolean addAllToP2Set(Map<PointerKeyAndState,MutableIntSet> p2setMap,PointerKeyAndState pkAndState,IntSet vals,IFlowLabel label){
  final PointerKey pk=pkAndState.getPointerKey();
  if (pk instanceof FilteredPointerKey) {
    if (DEBUG) {
      System.err.println("String_Node_Str" + pk);
    }
    final TypeFilter typeFilter=((FilteredPointerKey)pk).getTypeFilter();
    vals=updateValsForFilter(vals,typeFilter);
  }
  if (label instanceof IFlowLabelWithFilter) {
    TypeFilter typeFilter=((IFlowLabelWithFilter)label).getFilter();
    if (typeFilter != null) {
      vals=updateValsForFilter(vals,typeFilter);
    }
  }
  boolean added=findOrCreate(p2setMap,pkAndState).addAll(vals);
  if (DEBUG && added) {
  }
  return added;
}

Fixed version (ground truth):
private boolean addAllToP2Set(Map<PointerKeyAndState,MutableIntSet> p2setMap,PointerKeyAndState pkAndState,IntSet vals,IFlowLabel label){
  final PointerKey pk=pkAndState.getPointerKey();
  if (pk instanceof FilteredPointerKey) {
    if (DEBUG) {
      System.err.println("String_Node_Str" + pk);
    }
    final TypeFilter typeFilter=((FilteredPointerKey)pk).getTypeFilter();
    vals=updateValsForFilter(vals,typeFilter);
  }
  if (label instanceof IFlowLabelWithFilter) {
    TypeFilter typeFilter=((IFlowLabelWithFilter)label).getFilter();
    if (typeFilter != null) {
      vals=updateValsForFilter(vals,typeFilter);
    }
  }
  boolean added=findOrCreate(p2setMap,pkAndState).addAll(vals);
  if (DEBUG && added) {
    System.err.println("String_Node_Str" + pkAndState + "String_Node_Str");
    for (    InstanceKeyAndState ikAndState : makeOrdinalSet(vals)) {
      System.err.println(ikAndState);
    }
    System.err.println("String_Node_Str");
  }
  return added;
}
Program: 100022
Project: 100022
Buggy source:
Iterator<PointerKey> getArrayWrites(PointerKey arrayRef){
  arrayRef=convertToHeapModel(arrayRef,mam.getHeapModel());
  Collection<MemoryAccess> arrayWrites=mam.getArrayWrites(arrayRef);
  for (  MemoryAccess a : arrayWrites) {
    addSubgraphForNode(a.getNode());
  }
  ArrayList<PointerKey> written=new ArrayList<PointerKey>();
  for (  MemoryAccess a : arrayWrites) {
    final CGNode node=a.getNode();
    IR ir=node.getIR();
    SSAInstruction instruction=ir.getInstructions()[a.getInstructionIndex()];
    if (instruction == null) {
      continue;
    }
    if (instruction instanceof SSAArrayStoreInstruction) {
      SSAArrayStoreInstruction s=(SSAArrayStoreInstruction)instruction;
      PointerKey r=heapModel.getPointerKeyForLocal(node,s.getValue());
      written.add(r);
    }
 else     if (instruction instanceof SSANewInstruction) {
      SSANewInstruction n=(SSANewInstruction)instruction;
      InstanceKey iKey=heapModel.getInstanceKeyForAllocation(node,n.getNewSite());
      if (iKey == null) {
        continue;
      }
      IClass klass=iKey.getConcreteType();
      if (Assertions.verifyAssertions) {
        Assertions._assert(klass.isArrayClass() && ((ArrayClass)klass).getElementClass().isArrayClass());
      }
      int dim=0;
      InstanceKey lastInstance=iKey;
      while (klass != null && klass.isArrayClass()) {
        klass=((ArrayClass)klass).getElementClass();
        if (klass != null && klass.isArrayClass()) {
          InstanceKey ik=heapModel.getInstanceKeyForMultiNewArray(node,n.getNewSite(),dim);
          PointerKey pk=heapModel.getPointerKeyForArrayContents(lastInstance);
          written.add(pk);
          lastInstance=ik;
          dim++;
        }
      }
    }
 else {
      Assertions.UNREACHABLE();
    }
  }
  return written.iterator();
}

Fixed version (ground truth):
Iterator<PointerKey> getArrayWrites(PointerKey arrayRef){
  arrayRef=convertToHeapModel(arrayRef,mam.getHeapModel());
  Collection<MemoryAccess> arrayWrites=mam.getArrayWrites(arrayRef);
  for (  MemoryAccess a : arrayWrites) {
    addSubgraphForNode(a.getNode());
  }
  ArrayList<PointerKey> written=new ArrayList<PointerKey>();
  for (  MemoryAccess a : arrayWrites) {
    final CGNode node=a.getNode();
    IR ir=node.getIR();
    SSAInstruction instruction=ir.getInstructions()[a.getInstructionIndex()];
    if (instruction == null) {
      continue;
    }
    if (instruction instanceof SSAArrayStoreInstruction) {
      SSAArrayStoreInstruction s=(SSAArrayStoreInstruction)instruction;
      PointerKey r=heapModel.getPointerKeyForLocal(node,s.getValue());
      written.add(r);
    }
 else     if (instruction instanceof SSANewInstruction) {
      NewMultiDimInfo multiDimInfo=DemandPointerFlowGraph.getInfoForNewMultiDim((SSANewInstruction)instruction,heapModel,node);
      for (      Pair<PointerKey,PointerKey> arrStoreInstr : multiDimInfo.arrStoreInstrs) {
        written.add(arrStoreInstr.snd);
      }
    }
 else {
      Assertions.UNREACHABLE();
    }
  }
  return written.iterator();
}
Program: 100023
Project: 100023
Buggy source:
/** 
 * Add constraints to represent the flow of exceptions to the exceptional return value for this node
 */
protected void addNodePassthruExceptionConstraints(CGNode node,IR ir){
  List<ProgramCounter> peis=SSAPropagationCallGraphBuilder.getIncomingPEIs(ir,ir.getExitBlock());
  PointerKey exception=heapModel.getPointerKeyForExceptionalReturnValue(node);
  addExceptionDefConstraints(ir,node,peis,exception,PropagationCallGraphBuilder.THROWABLE_SET);
}

Fixed version (ground truth):
/** 
 * Add constraints to represent the flow of exceptions to the exceptional return value for this node
 */
protected void addNodePassthruExceptionConstraints(CGNode node,IR ir){
  List<ProgramCounter> peis=SSAPropagationCallGraphBuilder.getIncomingPEIs(ir,ir.getExitBlock());
  PointerKey exception=heapModel.getPointerKeyForExceptionalReturnValue(node);
  IClass c=node.getClassHierarchy().lookupClass(TypeReference.JavaLangThrowable);
  addExceptionDefConstraints(ir,node,peis,exception,Collections.singleton(c));
}
Program: 100025
Project: 100025
Buggy source:
@Override public void visitGetCaughtException(SSAGetCaughtExceptionInstruction instruction){
  List<ProgramCounter> peis=SSAPropagationCallGraphBuilder.getIncomingPEIs(ir,getBasicBlock());
  PointerKey def=heapModel.getPointerKeyForLocal(node,instruction.getDef());
  Set<TypeReference> types=SSAPropagationCallGraphBuilder.getCaughtExceptionTypes(instruction,ir);
  addExceptionDefConstraints(ir,node,peis,def,types);
}

Fixed version (ground truth):
@Override public void visitGetCaughtException(SSAGetCaughtExceptionInstruction instruction){
  List<ProgramCounter> peis=SSAPropagationCallGraphBuilder.getIncomingPEIs(ir,getBasicBlock());
  PointerKey def=heapModel.getPointerKeyForLocal(node,instruction.getDef());
  Set<IClass> types=SSAPropagationCallGraphBuilder.getCaughtExceptionTypes(instruction,ir);
  addExceptionDefConstraints(ir,node,peis,def,types);
}
Program: 100027
Project: 100027
Buggy source:
public int[] computeColumnWidths(){
  int[] result=new int[getNumberOfColumns()];
  for (int i=0; i < getNumberOfColumns(); i++) {
    result[i]=columnHeadings.get(i).toString().length() + 1;
  }
  for (int j=0; j < getNumberOfRows(); j++) {
    for (int i=0; i < getNumberOfColumns(); i++) {
      result[i]=Math.max(result[i],getElement(j,i).toString().length() + 1);
    }
  }
  return result;
}

Fixed version (ground truth):
public int[] computeColumnWidths(){
  int[] result=new int[getNumberOfColumns()];
  for (int i=0; i < getNumberOfColumns(); i++) {
    result[i]=columnHeadings.get(i).toString().length() + 1;
  }
  for (int j=0; j < getNumberOfRows(); j++) {
    for (int i=0; i < getNumberOfColumns(); i++) {
      T element=getElement(j,i);
      result[i]=element == null ? result[i] : Math.max(result[i],element.toString().length() + 1);
    }
  }
  return result;
}
Program: 100028
Project: 100028
Buggy source:
private IMethod makeUnaryNumberCall(IClass cls){
  MethodReference ref=AstMethodReference.fnReference(JavaScriptTypes.Number);
  JavaScriptSummary S=new JavaScriptSummary(ref,2);
  S.addStatement(new JavaScriptStaticPropertyRead(4,2,"String_Node_Str"));
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  S.addStatement(new JavaScriptInvoke(4,5,new int[]{2},6,cs));
  S.addStatement(SSAInstructionFactory.ReturnInstruction(5,false));
  return new JavaScriptConstructor(ref,S,cls);
}

Fixed version (ground truth):
private IMethod makeUnaryNumberCall(IClass cls){
  MethodReference ref=AstMethodReference.fnReference(JavaScriptTypes.Number);
  JavaScriptSummary S=new JavaScriptSummary(ref,2);
  S.addStatement(new JavaScriptStaticPropertyRead(4,2,"String_Node_Str"));
  S.getNextProgramCounter();
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  S.addStatement(new JavaScriptInvoke(4,5,new int[]{2},6,cs));
  S.addStatement(SSAInstructionFactory.ReturnInstruction(5,false));
  S.getNextProgramCounter();
  return new JavaScriptConstructor(ref,S,cls);
}
Program: 100029
Project: 100029
Buggy source:
private IMethod makeNullaryStringCall(IClass cls){
  MethodReference ref=AstMethodReference.fnReference(JavaScriptTypes.String);
  JavaScriptSummary S=new JavaScriptSummary(ref,1);
  S.addConstant(new Integer(2),new ConstantValue("String_Node_Str"));
  S.addStatement(SSAInstructionFactory.ReturnInstruction(2,false));
  return new JavaScriptConstructor(ref,S,cls);
}

Fixed version (ground truth):
private IMethod makeNullaryStringCall(IClass cls){
  MethodReference ref=AstMethodReference.fnReference(JavaScriptTypes.String);
  JavaScriptSummary S=new JavaScriptSummary(ref,1);
  S.addConstant(new Integer(2),new ConstantValue("String_Node_Str"));
  S.addStatement(SSAInstructionFactory.ReturnInstruction(2,false));
  S.getNextProgramCounter();
  return new JavaScriptConstructor(ref,S,cls);
}
Program: 100030
Project: 100030
Buggy source:
private IMethod makeUnaryObjectConstructor(IClass cls){
  MethodReference ref=JavaScriptMethods.makeCtorReference(JavaScriptTypes.Object);
  JavaScriptSummary S=new JavaScriptSummary(ref,2);
  S.addStatement(SSAInstructionFactory.ReturnInstruction(2,false));
  return new JavaScriptConstructor(ref,S,cls);
}

Fixed version (ground truth):
private IMethod makeUnaryObjectConstructor(IClass cls){
  MethodReference ref=JavaScriptMethods.makeCtorReference(JavaScriptTypes.Object);
  JavaScriptSummary S=new JavaScriptSummary(ref,2);
  S.addStatement(SSAInstructionFactory.ReturnInstruction(2,false));
  S.getNextProgramCounter();
  return new JavaScriptConstructor(ref,S,cls);
}
Program: 100031
Project: 100031
Buggy source:
private IMethod makeArrayLengthConstructor(IClass cls){
  MethodReference ref=JavaScriptMethods.makeCtorReference(JavaScriptTypes.Array);
  JavaScriptSummary S=new JavaScriptSummary(ref,2);
  S.addStatement(new JavaScriptStaticPropertyRead(5,1,"String_Node_Str"));
  S.addStatement(new JavaScriptNewInstruction(6,NewSiteReference.make(S.getNextProgramCounter(),JavaScriptTypes.Array)));
  S.addStatement(new JavaScriptStaticPropertyWrite(6,"String_Node_Str",5));
  S.addStatement(new JavaScriptStaticPropertyWrite(6,"String_Node_Str",2));
  S.addStatement(SSAInstructionFactory.ReturnInstruction(6,false));
  return new JavaScriptConstructor(ref,S,cls);
}

Fixed version (ground truth):
private IMethod makeArrayLengthConstructor(IClass cls){
  MethodReference ref=JavaScriptMethods.makeCtorReference(JavaScriptTypes.Array);
  JavaScriptSummary S=new JavaScriptSummary(ref,2);
  S.addStatement(new JavaScriptStaticPropertyRead(5,1,"String_Node_Str"));
  S.getNextProgramCounter();
  S.addStatement(new JavaScriptNewInstruction(6,NewSiteReference.make(S.getNextProgramCounter(),JavaScriptTypes.Array)));
  S.addStatement(new JavaScriptStaticPropertyWrite(6,"String_Node_Str",5));
  S.getNextProgramCounter();
  S.addStatement(new JavaScriptStaticPropertyWrite(6,"String_Node_Str",2));
  S.getNextProgramCounter();
  S.addStatement(SSAInstructionFactory.ReturnInstruction(6,false));
  S.getNextProgramCounter();
  return new JavaScriptConstructor(ref,S,cls);
}
Program: 100032
Project: 100032
Buggy source:
private IMethod makeNullaryNumberCall(IClass cls){
  MethodReference ref=AstMethodReference.fnReference(JavaScriptTypes.Number);
  JavaScriptSummary S=new JavaScriptSummary(ref,1);
  S.addConstant(new Integer(2),new ConstantValue(0.0));
  S.addStatement(SSAInstructionFactory.ReturnInstruction(2,false));
  return new JavaScriptConstructor(ref,S,cls);
}

Fixed version (ground truth):
private IMethod makeNullaryNumberCall(IClass cls){
  MethodReference ref=AstMethodReference.fnReference(JavaScriptTypes.Number);
  JavaScriptSummary S=new JavaScriptSummary(ref,1);
  S.addConstant(new Integer(2),new ConstantValue(0.0));
  S.addStatement(SSAInstructionFactory.ReturnInstruction(2,false));
  S.getNextProgramCounter();
  return new JavaScriptConstructor(ref,S,cls);
}
Program: 100033
Project: 100033
Buggy source:
private IMethod makeNullaryObjectConstructor(IClass cls){
  MethodReference ref=JavaScriptMethods.makeCtorReference(JavaScriptTypes.Object);
  JavaScriptSummary S=new JavaScriptSummary(ref,1);
  S.addStatement(new JavaScriptStaticPropertyRead(4,1,"String_Node_Str"));
  S.addStatement(new JavaScriptNewInstruction(5,NewSiteReference.make(S.getNextProgramCounter(),JavaScriptTypes.Object)));
  S.addStatement(new JavaScriptStaticPropertyWrite(5,"String_Node_Str",4));
  S.addStatement(SSAInstructionFactory.ReturnInstruction(5,false));
  return new JavaScriptConstructor(ref,S,cls);
}

Fixed version (ground truth):
private IMethod makeNullaryObjectConstructor(IClass cls){
  MethodReference ref=JavaScriptMethods.makeCtorReference(JavaScriptTypes.Object);
  JavaScriptSummary S=new JavaScriptSummary(ref,1);
  S.addStatement(new JavaScriptStaticPropertyRead(4,1,"String_Node_Str"));
  S.getNextProgramCounter();
  S.addStatement(new JavaScriptNewInstruction(5,NewSiteReference.make(S.getNextProgramCounter(),JavaScriptTypes.Object)));
  S.addStatement(new JavaScriptStaticPropertyWrite(5,"String_Node_Str",4));
  S.getNextProgramCounter();
  S.addStatement(SSAInstructionFactory.ReturnInstruction(5,false));
  S.getNextProgramCounter();
  return new JavaScriptConstructor(ref,S,cls);
}
Program: 100034
Project: 100034
Buggy source:
private IMethod makeNullaryValueConstructor(IClass cls,Object value){
  MethodReference ref=JavaScriptMethods.makeCtorReference(cls.getReference());
  JavaScriptSummary S=new JavaScriptSummary(ref,1);
  S.addStatement(new JavaScriptStaticPropertyRead(4,1,"String_Node_Str"));
  S.addStatement(new JavaScriptNewInstruction(5,NewSiteReference.make(S.getNextProgramCounter(),cls.getReference())));
  S.addStatement(new JavaScriptStaticPropertyWrite(5,"String_Node_Str",4));
  S.addConstant(new Integer(8),new ConstantValue(value));
  S.addStatement(new JavaScriptStaticPropertyWrite(5,"String_Node_Str",8));
  S.addStatement(SSAInstructionFactory.ReturnInstruction(5,false));
  return new JavaScriptConstructor(ref,S,cls);
}

Fixed version (ground truth):
private IMethod makeNullaryValueConstructor(IClass cls,Object value){
  MethodReference ref=JavaScriptMethods.makeCtorReference(cls.getReference());
  JavaScriptSummary S=new JavaScriptSummary(ref,1);
  S.addStatement(new JavaScriptStaticPropertyRead(4,1,"String_Node_Str"));
  S.getNextProgramCounter();
  S.addStatement(new JavaScriptNewInstruction(5,NewSiteReference.make(S.getNextProgramCounter(),cls.getReference())));
  S.addStatement(new JavaScriptStaticPropertyWrite(5,"String_Node_Str",4));
  S.getNextProgramCounter();
  S.addConstant(new Integer(8),new ConstantValue(value));
  S.addStatement(new JavaScriptStaticPropertyWrite(5,"String_Node_Str",8));
  S.getNextProgramCounter();
  S.addStatement(SSAInstructionFactory.ReturnInstruction(5,false));
  S.getNextProgramCounter();
  return new JavaScriptConstructor(ref,S,cls);
}
Program: 100035
Project: 100035
Buggy source:
private IMethod makeUnaryStringCall(IClass cls){
  MethodReference ref=AstMethodReference.fnReference(JavaScriptTypes.String);
  JavaScriptSummary S=new JavaScriptSummary(ref,2);
  S.addStatement(new JavaScriptStaticPropertyRead(4,2,"String_Node_Str"));
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  S.addStatement(new JavaScriptInvoke(4,5,new int[]{2},6,cs));
  S.addStatement(SSAInstructionFactory.ReturnInstruction(5,false));
  return new JavaScriptConstructor(ref,S,cls);
}

Fixed version (ground truth):
private IMethod makeUnaryStringCall(IClass cls){
  MethodReference ref=AstMethodReference.fnReference(JavaScriptTypes.String);
  JavaScriptSummary S=new JavaScriptSummary(ref,2);
  S.addStatement(new JavaScriptStaticPropertyRead(4,2,"String_Node_Str"));
  S.getNextProgramCounter();
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  S.addStatement(new JavaScriptInvoke(4,5,new int[]{2},6,cs));
  S.addStatement(SSAInstructionFactory.ReturnInstruction(5,false));
  S.getNextProgramCounter();
  return new JavaScriptConstructor(ref,S,cls);
}
Program: 100036
Project: 100036
Buggy source:
private IMethod makeUnaryValueConstructor(IClass cls){
  MethodReference ref=JavaScriptMethods.makeCtorReference(cls.getReference());
  JavaScriptSummary S=new JavaScriptSummary(ref,2);
  S.addStatement(new JavaScriptStaticPropertyRead(5,1,"String_Node_Str"));
  S.addStatement(new JavaScriptNewInstruction(6,NewSiteReference.make(S.getNextProgramCounter(),cls.getReference())));
  S.addStatement(new JavaScriptStaticPropertyWrite(6,"String_Node_Str",5));
  S.addStatement(new JavaScriptStaticPropertyWrite(6,"String_Node_Str",2));
  S.addStatement(SSAInstructionFactory.ReturnInstruction(6,false));
  return new JavaScriptConstructor(ref,S,cls);
}

Fixed version (ground truth):
private IMethod makeUnaryValueConstructor(IClass cls){
  MethodReference ref=JavaScriptMethods.makeCtorReference(cls.getReference());
  JavaScriptSummary S=new JavaScriptSummary(ref,2);
  S.addStatement(new JavaScriptStaticPropertyRead(5,1,"String_Node_Str"));
  S.getNextProgramCounter();
  S.addStatement(new JavaScriptNewInstruction(6,NewSiteReference.make(S.getNextProgramCounter(),cls.getReference())));
  S.addStatement(new JavaScriptStaticPropertyWrite(6,"String_Node_Str",5));
  S.getNextProgramCounter();
  S.addStatement(new JavaScriptStaticPropertyWrite(6,"String_Node_Str",2));
  S.getNextProgramCounter();
  S.addStatement(SSAInstructionFactory.ReturnInstruction(6,false));
  S.getNextProgramCounter();
  return new JavaScriptConstructor(ref,S,cls);
}
Program: 100037
Project: 100037
Buggy source:
private IMethod makeFunctionObjectConstructor(IClass cls,int nargs){
  Object key=Pair.make(cls,new Integer(nargs));
  if (constructors.containsKey(key))   return constructors.get(key);
  MethodReference ref=JavaScriptMethods.makeCtorReference(cls.getReference());
  JavaScriptSummary S=new JavaScriptSummary(ref,nargs + 1);
  S.addStatement(new JavaScriptStaticPropertyRead(nargs + 4,1,"String_Node_Str"));
  S.addStatement(new JavaScriptNewInstruction(nargs + 5,NewSiteReference.make(S.getNextProgramCounter(),JavaScriptTypes.Object)));
  S.addStatement(new JavaScriptStaticPropertyWrite(nargs + 5,"String_Node_Str",nargs + 4));
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  int[] args=new int[nargs + 1];
  args[0]=nargs + 5;
  for (int i=0; i < nargs; i++)   args[i + 1]=i + 2;
  S.addStatement(new JavaScriptInvoke(1,nargs + 7,args,nargs + 8,cs));
  S.addStatement(SSAInstructionFactory.ReturnInstruction(nargs + 7,false));
  S.addStatement(SSAInstructionFactory.ReturnInstruction(nargs + 5,false));
  return record(key,new JavaScriptConstructor(ref,S,cls));
}

Fixed version (ground truth):
private IMethod makeFunctionObjectConstructor(IClass cls,int nargs){
  Object key=Pair.make(cls,new Integer(nargs));
  if (constructors.containsKey(key))   return constructors.get(key);
  MethodReference ref=JavaScriptMethods.makeCtorReference(cls.getReference());
  JavaScriptSummary S=new JavaScriptSummary(ref,nargs + 1);
  S.addStatement(new JavaScriptStaticPropertyRead(nargs + 4,1,"String_Node_Str"));
  S.getNextProgramCounter();
  S.addStatement(new JavaScriptNewInstruction(nargs + 5,NewSiteReference.make(S.getNextProgramCounter(),JavaScriptTypes.Object)));
  S.addStatement(new JavaScriptStaticPropertyWrite(nargs + 5,"String_Node_Str",nargs + 4));
  S.getNextProgramCounter();
  CallSiteReference cs=new JSCallSiteReference(S.getNextProgramCounter());
  int[] args=new int[nargs + 1];
  args[0]=nargs + 5;
  for (int i=0; i < nargs; i++)   args[i + 1]=i + 2;
  S.addStatement(new JavaScriptInvoke(1,nargs + 7,args,nargs + 8,cs));
  S.addStatement(SSAInstructionFactory.ReturnInstruction(nargs + 7,false));
  S.getNextProgramCounter();
  S.addStatement(SSAInstructionFactory.ReturnInstruction(nargs + 5,false));
  S.getNextProgramCounter();
  return record(key,new JavaScriptConstructor(ref,S,cls));
}
Program: 100038
Project: 100038
Buggy source:
private IMethod makeArrayContentsConstructor(IClass cls,int nargs){
  MethodReference ref=JavaScriptMethods.makeCtorReference(JavaScriptTypes.Array);
  JavaScriptSummary S=new JavaScriptSummary(ref,nargs + 1);
  S.addConstant(new Integer(nargs + 3),new ConstantValue("String_Node_Str"));
  S.addStatement(new JavaScriptPropertyRead(nargs + 4,1,nargs + 3));
  S.addStatement(new JavaScriptNewInstruction(nargs + 5,NewSiteReference.make(S.getNextProgramCounter(),JavaScriptTypes.Array)));
  S.addStatement(new JavaScriptStaticPropertyWrite(nargs + 5,"String_Node_Str",nargs + 4));
  S.addConstant(new Integer(nargs + 7),new ConstantValue(nargs));
  S.addStatement(new JavaScriptStaticPropertyWrite(nargs + 5,"String_Node_Str",nargs + 7));
  int vn=nargs + 9;
  for (int i=0; i < nargs; i++, vn+=2) {
    S.addConstant(new Integer(vn),new ConstantValue(i));
    S.addStatement(new JavaScriptPropertyWrite(nargs + 5,vn,i + 1));
  }
  S.addStatement(SSAInstructionFactory.ReturnInstruction(5,false));
  return new JavaScriptConstructor(ref,S,cls);
}

Fixed version (ground truth):
private IMethod makeArrayContentsConstructor(IClass cls,int nargs){
  MethodReference ref=JavaScriptMethods.makeCtorReference(JavaScriptTypes.Array);
  JavaScriptSummary S=new JavaScriptSummary(ref,nargs + 1);
  S.addConstant(new Integer(nargs + 3),new ConstantValue("String_Node_Str"));
  S.addStatement(new JavaScriptPropertyRead(nargs + 4,1,nargs + 3));
  S.getNextProgramCounter();
  S.addStatement(new JavaScriptNewInstruction(nargs + 5,NewSiteReference.make(S.getNextProgramCounter(),JavaScriptTypes.Array)));
  S.addStatement(new JavaScriptStaticPropertyWrite(nargs + 5,"String_Node_Str",nargs + 4));
  S.getNextProgramCounter();
  S.addConstant(new Integer(nargs + 7),new ConstantValue(nargs));
  S.addStatement(new JavaScriptStaticPropertyWrite(nargs + 5,"String_Node_Str",nargs + 7));
  S.getNextProgramCounter();
  int vn=nargs + 9;
  for (int i=0; i < nargs; i++, vn+=2) {
    S.addConstant(new Integer(vn),new ConstantValue(i));
    S.addStatement(new JavaScriptPropertyWrite(nargs + 5,vn,i + 1));
    S.getNextProgramCounter();
  }
  S.addStatement(SSAInstructionFactory.ReturnInstruction(5,false));
  S.getNextProgramCounter();
  return new JavaScriptConstructor(ref,S,cls);
}
Program: 100039
Project: 100039
Buggy source:
@Override public void visitAssignGlobal(AssignGlobalLabel label,Object dst){
  for (Iterator<? extends Object> readIter=g.getReadsOfStaticField((StaticFieldKey)dst); readIter.hasNext(); ) {
    final PointerKey predPk=(PointerKey)readIter.next();
    doTransition(curState,AssignGlobalBarLabel.v(),new Function<State,Object>(){
      public Object apply(      State predPkState){
        PointerKeyAndState predPkAndState=new PointerKeyAndState(predPk,predPkState);
        if (findOrCreate(pkToTrackedSet,predPkAndState).addAll(trackedSet)) {
          addToTrackedPToWorklist(predPkAndState);
        }
        return null;
      }
    }
);
  }
}

Fixed version (ground truth):
@Override public void visitAssignGlobal(AssignGlobalLabel label,Object dst){
  for (Iterator<? extends Object> writesToStaticField=g.getWritesToStaticField((StaticFieldKey)dst); writesToStaticField.hasNext(); ) {
    final PointerKey writtenPk=(PointerKey)writesToStaticField.next();
    doTransition(curState,label,new Function<State,Object>(){
      public Object apply(      State nextState){
        h.propagate(new PointerKeyAndState(writtenPk,nextState));
        return null;
      }
    }
);
  }
}
Program: 100040
Project: 100040
Buggy source:
@Override public void visitNew(NewLabel label,Object dst){
  final InstanceKey ik=(InstanceKey)dst;
  if (DEBUG) {
    System.err.println("String_Node_Str" + ik + "String_Node_Str"+ curPk);
  }
  doTransition(curState,label,new Function<State,Object>(){
    public Object apply(    State newState){
      InstanceKeyAndState ikAndState=new InstanceKeyAndState(ik,newState);
      int n=ikAndStates.add(ikAndState);
      findOrCreate(pkToP2Set,curPkAndState).add(n);
      addToPToWorklist(curPkAndState);
      return null;
    }
  }
);
}

Fixed version (ground truth):
@Override public void visitNew(NewLabel label,Object dst){
  final InstanceKey ik=(InstanceKey)dst;
  if (DEBUG_TOPLEVEL) {
    System.err.println("String_Node_Str" + ik + "String_Node_Str"+ curPk);
  }
  doTransition(curState,label,new Function<State,Object>(){
    public Object apply(    State newState){
      if (!pred.test(ik)) {
        foundBadInstanceKey=true;
      }
      return null;
    }
  }
);
}
Program: 100041
Project: 100041
Buggy source:
private Collection<IMethod> getOTFTargets(CallSiteAndCGNode callSiteAndCGNode,SSAAbstractInvokeInstruction[] callInstrs,State callerState){
  final CallSiteReference call=callSiteAndCGNode.getCallSiteReference();
  final CGNode caller=callSiteAndCGNode.getCGNode();
  Collection<IMethod> result=HashSetFactory.make();
  for (  SSAAbstractInvokeInstruction callInstr : callInstrs) {
    PointerKey thisArg=heapModel.getPointerKeyForLocal(caller,callInstr.getUse(0));
    PointerKeyAndState thisArgAndState=new PointerKeyAndState(thisArg,callerState);
    OrdinalSet<InstanceKeyAndState> thisPToSet=getPToSetFromComputer(ptoComputer,thisArgAndState);
    for (    InstanceKeyAndState ikAndState : thisPToSet) {
      InstanceKey ik=ikAndState.getInstanceKey();
      IMethod targetMethod=options.getMethodTargetSelector().getCalleeTarget(caller,call,ik.getConcreteType());
      if (targetMethod == null) {
        continue;
      }
      result.add(targetMethod);
    }
  }
  return result;
}

Fixed version (ground truth):
private Collection<IMethod> getOTFTargets(CallSiteAndCGNode callSiteAndCGNode,SSAAbstractInvokeInstruction[] callInstrs,State callerState){
  if (DEBUG_TOPLEVEL) {
    System.err.println("String_Node_Str" + callSiteAndCGNode);
  }
  final CallSiteReference call=callSiteAndCGNode.getCallSiteReference();
  final CGNode caller=callSiteAndCGNode.getCGNode();
  Collection<IMethod> result=HashSetFactory.make();
  for (  SSAAbstractInvokeInstruction callInstr : callInstrs) {
    PointerKey thisArg=heapModel.getPointerKeyForLocal(caller,callInstr.getUse(0));
    PointerKeyAndState thisArgAndState=new PointerKeyAndState(thisArg,callerState);
    OrdinalSet<InstanceKeyAndState> thisPToSet=getPToSetFromComputer(ptoComputer,thisArgAndState);
    for (    InstanceKeyAndState ikAndState : thisPToSet) {
      InstanceKey ik=ikAndState.getInstanceKey();
      IMethod targetMethod=options.getMethodTargetSelector().getCalleeTarget(caller,call,ik.getConcreteType());
      if (targetMethod == null) {
        continue;
      }
      result.add(targetMethod);
    }
  }
  return result;
}
Program: 100042
Project: 100042
Buggy source:
/** 
 * track a field of some instance key, as we are interested in statements that read or write to the field
 * @param ikAndState
 * @param field
 * @param ikToFields either {@link #forwInstKeyToFields} or {@link #backInstKeyToFields}
 */
private void trackInstanceField(InstanceKeyAndState ikAndState,IField field,MultiMap<InstanceKeyAndState,IField> ikToFields){
  State state=ikAndState.getState();
  if (Assertions.verifyAssertions) {
  }
  ikToFields.put(ikAndState,field);
  for (Iterator<? extends Object> iter=g.getPredNodes(ikAndState.getInstanceKey(),NewLabel.v()); iter.hasNext(); ) {
    PointerKey ikPred=(PointerKey)iter.next();
    PointerKeyAndState ikPredAndState=new PointerKeyAndState(ikPred,state);
    int mappedIndex=ikAndStates.getMappedIndex(ikAndState);
    if (Assertions.verifyAssertions) {
      Assertions._assert(mappedIndex != -1);
    }
    if (findOrCreate(pkToTrackedSet,ikPredAndState).add(mappedIndex)) {
      addToTrackedPToWorklist(ikPredAndState);
    }
  }
}

Fixed version (ground truth):
/** 
 * track a field of some instance key, as we are interested in statements that read or write to the field
 * @param ikAndState
 * @param field
 * @param ikToFields either {@link #forwInstKeyToFields} or {@link #backInstKeyToFields}
 */
private void trackInstanceField(InstanceKeyAndState ikAndState,IField field,MultiMap<InstanceKeyAndState,IField> ikToFields){
  if (Assertions.verifyAssertions) {
  }
  ikToFields.put(ikAndState,field);
  addPredsOfIKeyAndStateToTrackedPointsTo(ikAndState);
}
Program: 100043
Project: 100043
Buggy source:
@Override public void visitGetField(GetFieldLabel label,Object dst){
  IField field=label.getField();
  PointerKey dstPtrKey=(PointerKey)dst;
  if (refineFieldAccesses(field,curPk,dstPtrKey,label.bar(),curState)) {
    for (    InstanceKeyAndState ikAndState : makeOrdinalSet(trackedSet)) {
      boolean needField=backInstKeyToFields.get(ikAndState).contains(field);
      PointerKeyAndState loadedVal=new PointerKeyAndState(dstPtrKey,curState);
      addEncounteredLoad(new LoadEdge(curPkAndState,field,loadedVal));
      if (needField) {
        InstanceFieldKeyAndState ifk=getInstFieldKey(ikAndState,field);
        if (findOrCreate(pkToTrackedSet,loadedVal).addAll(find(instFieldKeyToTrackedSet,ifk))) {
          addToTrackedPToWorklist(loadedVal);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void visitGetField(GetFieldLabel label,Object dst){
  IField field=(label).getField();
  PointerKey loadBase=(PointerKey)dst;
  if (refineFieldAccesses(field,loadBase,curPk,label,curState)) {
    if (DEBUG_TOPLEVEL) {
      System.err.println("String_Node_Str" + field);
    }
    OrdinalSet<InstanceKeyAndState> basePToSet=h.getPToSetFromComputer(ptoComputer,new PointerKeyAndState(loadBase,curState));
    if (DEBUG_TOPLEVEL) {
      System.err.println("String_Node_Str" + basePToSet);
    }
    h.computeFlowsTo(ptoComputer,basePToSet);
    if (DEBUG_TOPLEVEL) {
      System.err.println("String_Node_Str");
    }
    for (    MemoryAccess fieldWrite : mam.getFieldWrites(convertToHeapModel(loadBase,mam.getHeapModel()),field)) {
      IR ir=fieldWrite.getNode().getIR();
      SSAPutInstruction s=(SSAPutInstruction)ir.getInstructions()[fieldWrite.getInstructionIndex()];
      if (s == null) {
        continue;
      }
      PointerKey putfieldBase=heapModel.getPointerKeyForLocal(fieldWrite.getNode(),s.getRef());
      PointerKey writtenPk=heapModel.getPointerKeyForLocal(fieldWrite.getNode(),s.getVal());
      Collection<State> reachedFlowStates=h.getFlowedToStates(ptoComputer,basePToSet,putfieldBase);
      for (      State nextState : reachedFlowStates) {
        System.err.println("String_Node_Str" + s);
        h.propagate(new PointerKeyAndState(writtenPk,nextState));
      }
    }
  }
 else {
    for (Iterator<PointerKey> writesToInstanceField=g.getWritesToInstanceField(loadBase,field); writesToInstanceField.hasNext(); ) {
      final PointerKey writtenPk=writesToInstanceField.next();
      doTransition(curState,MatchLabel.v(),new Function<State,Object>(){
        public Object apply(        State nextState){
          h.propagate(new PointerKeyAndState(writtenPk,nextState));
          return null;
        }
      }
);
    }
  }
}
Program: 100044
Project: 100044
Buggy source:
public Object apply(State nextState){
  propagate(new PointerKeyAndState(retVal,nextState));
  return null;
}

Fixed version (ground truth):
public Object apply(State nextState){
  h.propagate(new PointerKeyAndState(succPk,nextState));
  return null;
}