nus-yam/ex-repair huggingface dataset:
Program: 100319
Project: 100319
Buggy source:
/** 
 * TODO: refactor this to avoid excessive code bloat.
 */
public static void doCallGraphs(AnalysisOptions options,AnalysisCache cache,ClassHierarchy cha,AnalysisScope scope,String dcgFile,boolean stopAfterZeroCFA,boolean stopAfterZeroContainerCFA){
  CallGraph cg=CallGraphTestUtil.buildRTA(options,cache,cha,scope);
  try {
    GraphIntegrity.check(cg);
  }
 catch (  UnsoundGraphException e1) {
    e1.printStackTrace();
    assertTrue(e1.getMessage(),false);
  }
  Set<MethodReference> rtaMethods=CallGraphStats.collectMethods(cg);
  Trace.println("String_Node_Str" + rtaMethods.size());
  Trace.println(CallGraphStats.getStats(cg));
  Trace.println("String_Node_Str");
  cg=CallGraphTestUtil.buildZeroCFA(options,cache,cha,scope);
  Graph<MethodReference> squashZero=checkCallGraph(cg,null,rtaMethods,"String_Node_Str");
  if (stopAfterZeroCFA) {
    return;
  }
  cg=CallGraphTestUtil.buildZeroOneCFA(options,cache,cha,scope);
  Graph<MethodReference> squashZeroOne=checkCallGraph(cg,squashZero,null,"String_Node_Str");
  cg=CallGraphTestUtil.buildZeroContainerCFA(options,cache,cha,scope);
  Graph<MethodReference> squashZeroContainer=checkCallGraph(cg,squashZero,null,"String_Node_Str");
  if (stopAfterZeroContainerCFA)   return;
  cg=CallGraphTestUtil.buildZeroOneContainerCFA(options,cache,cha,scope);
  checkCallGraph(cg,squashZeroContainer,null,"String_Node_Str");
  checkCallGraph(cg,squashZeroOne,null,"String_Node_Str");
  if (dcgFile != null) {
    checkAgainstDCG(cg,dcgFile);
  }
  checkICFG(cg);
  return;
}

Fixed version (ground truth):
/** 
 * TODO: refactor this to avoid excessive code bloat.
 */
public static void doCallGraphs(AnalysisOptions options,AnalysisCache cache,ClassHierarchy cha,AnalysisScope scope,String dcgFile,boolean stopAfterZeroCFA,boolean stopAfterZeroContainerCFA,boolean testPAToString){
  CallGraph cg=CallGraphTestUtil.buildRTA(options,cache,cha,scope);
  try {
    GraphIntegrity.check(cg);
  }
 catch (  UnsoundGraphException e1) {
    e1.printStackTrace();
    assertTrue(e1.getMessage(),false);
  }
  Set<MethodReference> rtaMethods=CallGraphStats.collectMethods(cg);
  Trace.println("String_Node_Str" + rtaMethods.size());
  Trace.println(CallGraphStats.getStats(cg));
  Trace.println("String_Node_Str");
  cg=CallGraphTestUtil.buildZeroCFA(options,cache,cha,scope,testPAToString);
  Graph<MethodReference> squashZero=checkCallGraph(cg,null,rtaMethods,"String_Node_Str");
  if (stopAfterZeroCFA) {
    return;
  }
  cg=CallGraphTestUtil.buildZeroOneCFA(options,cache,cha,scope,testPAToString);
  Graph<MethodReference> squashZeroOne=checkCallGraph(cg,squashZero,null,"String_Node_Str");
  cg=CallGraphTestUtil.buildZeroContainerCFA(options,cache,cha,scope);
  Graph<MethodReference> squashZeroContainer=checkCallGraph(cg,squashZero,null,"String_Node_Str");
  if (stopAfterZeroContainerCFA)   return;
  cg=CallGraphTestUtil.buildZeroOneContainerCFA(options,cache,cha,scope);
  checkCallGraph(cg,squashZeroContainer,null,"String_Node_Str");
  checkCallGraph(cg,squashZeroOne,null,"String_Node_Str");
  if (dcgFile != null) {
    checkAgainstDCG(cg,dcgFile);
  }
  checkICFG(cg);
  return;
}
Program: 100320
Project: 100320
Buggy source:
public static CallGraph buildZeroCFA(AnalysisOptions options,AnalysisCache cache,ClassHierarchy cha,AnalysisScope scope){
  Stopwatch S=new Stopwatch("String_Node_Str");
  S.start();
  CallGraphBuilder builder=Util.makeZeroCFABuilder(options,cache,cha,scope);
  CallGraph cg=builder.makeCallGraph(options);
  S.stop();
  Trace.println(S.report());
  return cg;
}

Fixed version (ground truth):
public static CallGraph buildZeroCFA(AnalysisOptions options,AnalysisCache cache,ClassHierarchy cha,AnalysisScope scope,boolean testPAtoString){
  Stopwatch S=new Stopwatch("String_Node_Str");
  S.start();
  CallGraphBuilder builder=Util.makeZeroCFABuilder(options,cache,cha,scope);
  CallGraph cg=builder.makeCallGraph(options);
  if (testPAtoString) {
    builder.getPointerAnalysis().toString();
  }
  S.stop();
  Trace.println(S.report());
  return cg;
}
Program: 100321
Project: 100321
Buggy source:
public static CallGraph buildZeroOneCFA(AnalysisOptions options,AnalysisCache cache,ClassHierarchy cha,AnalysisScope scope){
  Stopwatch S=new Stopwatch("String_Node_Str");
  S.start();
  CallGraphBuilder builder=Util.makeZeroOneCFABuilder(options,cache,cha,scope);
  CallGraph cg=builder.makeCallGraph(options);
  S.stop();
  Trace.println(S.report());
  return cg;
}

Fixed version (ground truth):
public static CallGraph buildZeroOneCFA(AnalysisOptions options,AnalysisCache cache,ClassHierarchy cha,AnalysisScope scope,boolean testPAtoString){
  Stopwatch S=new Stopwatch("String_Node_Str");
  S.start();
  CallGraphBuilder builder=Util.makeZeroOneCFABuilder(options,cache,cha,scope);
  CallGraph cg=builder.makeCallGraph(options);
  if (testPAtoString) {
    builder.getPointerAnalysis().toString();
  }
  S.stop();
  Trace.println(S.report());
  return cg;
}
Program: 100322
Project: 100322
Buggy source:
public void testClassConstants() throws ClassHierarchyException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA);
  ClassHierarchy cha=ClassHierarchy.make(scope);
  TypeReference mainClassRef=TypeReference.findOrCreate(ClassLoaderReference.Application,TestConstants.CLASSCONSTANT_MAIN);
  Assert.assertTrue(cha.lookupClass(mainClassRef) != null);
  Iterable<Entrypoint> entrypoints=Util.makeMainEntrypoints(scope,cha,TestConstants.CLASSCONSTANT_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  CallGraph cg=CallGraphTestUtil.buildZeroCFA(options,new AnalysisCache(),cha,scope);
  Trace.println("String_Node_Str");
  Trace.println(cg);
  MethodReference mainMethodRef=MethodReference.findOrCreate(mainClassRef,"String_Node_Str","String_Node_Str");
  Set<CGNode> mainMethodNodes=cg.getNodes(mainMethodRef);
  Assert.assertFalse(mainMethodNodes.isEmpty());
  CGNode mainMethodNode=(CGNode)mainMethodNodes.iterator().next();
  Trace.println("String_Node_Str");
  Trace.println(mainMethodNode.getIR());
  TypeReference classRef=TypeReference.findOrCreate(ClassLoaderReference.Primordial,"String_Node_Str");
  MethodReference hashCodeRef=MethodReference.findOrCreate(classRef,"String_Node_Str","String_Node_Str");
  Set<CGNode> hashCodeNodes=cg.getNodes(hashCodeRef);
  Assert.assertFalse(hashCodeNodes.isEmpty());
  Assert.assertTrue(cg.hasEdge(mainMethodNode,hashCodeNodes.iterator().next()));
}

Fixed version (ground truth):
public void testClassConstants() throws ClassHierarchyException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA);
  ClassHierarchy cha=ClassHierarchy.make(scope);
  TypeReference mainClassRef=TypeReference.findOrCreate(ClassLoaderReference.Application,TestConstants.CLASSCONSTANT_MAIN);
  Assert.assertTrue(cha.lookupClass(mainClassRef) != null);
  Iterable<Entrypoint> entrypoints=Util.makeMainEntrypoints(scope,cha,TestConstants.CLASSCONSTANT_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  CallGraph cg=CallGraphTestUtil.buildZeroCFA(options,new AnalysisCache(),cha,scope,false);
  Trace.println("String_Node_Str");
  Trace.println(cg);
  MethodReference mainMethodRef=MethodReference.findOrCreate(mainClassRef,"String_Node_Str","String_Node_Str");
  Set<CGNode> mainMethodNodes=cg.getNodes(mainMethodRef);
  Assert.assertFalse(mainMethodNodes.isEmpty());
  CGNode mainMethodNode=(CGNode)mainMethodNodes.iterator().next();
  Trace.println("String_Node_Str");
  Trace.println(mainMethodNode.getIR());
  TypeReference classRef=TypeReference.findOrCreate(ClassLoaderReference.Primordial,"String_Node_Str");
  MethodReference hashCodeRef=MethodReference.findOrCreate(classRef,"String_Node_Str","String_Node_Str");
  Set<CGNode> hashCodeNodes=cg.getNodes(hashCodeRef);
  Assert.assertFalse(hashCodeNodes.isEmpty());
  Assert.assertTrue(cg.hasEdge(mainMethodNode,hashCodeNodes.iterator().next()));
}
Program: 100323
Project: 100323
Buggy source:
public void testJavaCup() throws ClassHierarchyException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.JAVA_CUP);
  ClassHierarchy cha=ClassHierarchy.make(scope);
  Iterable<Entrypoint> entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.JAVA_CUP_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  run(CallGraphTestUtil.buildZeroCFA(options,new AnalysisCache(),cha,scope));
}

Fixed version (ground truth):
public void testJavaCup() throws ClassHierarchyException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.JAVA_CUP);
  ClassHierarchy cha=ClassHierarchy.make(scope);
  Iterable<Entrypoint> entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.JAVA_CUP_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  run(CallGraphTestUtil.buildZeroCFA(options,new AnalysisCache(),cha,scope,false));
}
Program: 100324
Project: 100324
Buggy source:
public void testJLex() throws ClassHierarchyException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.JLEX);
  ClassHierarchy cha=ClassHierarchy.make(scope);
  Iterable<Entrypoint> entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.JLEX_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  run(CallGraphTestUtil.buildZeroCFA(options,new AnalysisCache(),cha,scope));
}

Fixed version (ground truth):
public void testJLex() throws ClassHierarchyException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.JLEX);
  ClassHierarchy cha=ClassHierarchy.make(scope);
  Iterable<Entrypoint> entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.JLEX_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  run(CallGraphTestUtil.buildZeroCFA(options,new AnalysisCache(),cha,scope,false));
}
Program: 100325
Project: 100325
Buggy source:
public void testBcelVerifier() throws ClassHierarchyException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.BCEL);
  ClassHierarchy cha=ClassHierarchy.make(scope);
  Iterable<Entrypoint> entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.BCEL_VERIFIER_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  run(CallGraphTestUtil.buildZeroCFA(options,new AnalysisCache(),cha,scope));
}

Fixed version (ground truth):
public void testBcelVerifier() throws ClassHierarchyException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.BCEL);
  ClassHierarchy cha=ClassHierarchy.make(scope);
  Iterable<Entrypoint> entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.BCEL_VERIFIER_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  run(CallGraphTestUtil.buildZeroCFA(options,new AnalysisCache(),cha,scope,false));
}
Program: 100326
Project: 100326
Buggy source:
private CallGraph doGraph(boolean usePiNodes) throws ClassHierarchyException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA);
  ClassHierarchy cha=ClassHierarchy.make(scope);
  Iterable<Entrypoint> entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.PI_TEST_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  options.getSSAOptions().setUsePiNodes(usePiNodes);
  return CallGraphTestUtil.buildZeroCFA(options,new AnalysisCache(),cha,scope);
}

Fixed version (ground truth):
private CallGraph doGraph(boolean usePiNodes) throws ClassHierarchyException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA);
  ClassHierarchy cha=ClassHierarchy.make(scope);
  Iterable<Entrypoint> entrypoints=com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(scope,cha,TestConstants.PI_TEST_MAIN);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  options.getSSAOptions().setUsePiNodes(usePiNodes);
  return CallGraphTestUtil.buildZeroCFA(options,new AnalysisCache(),cha,scope,false);
}
Program: 100327
Project: 100327
Buggy source:
/** 
 * Constructor for SpecJTest.
 * @param arg0
 */
public MultiDimArrayTest(String arg0){
  super(arg0);
}

Fixed version (ground truth):
/** 
 * @param arg0
 */
public MultiDimArrayTest(String arg0){
  super(arg0);
}
Program: 100328
Project: 100328
Buggy source:
@SuppressWarnings("String_Node_Str") public Collection<InstanceKey> getPointsTo(PointerKey pk){
  Assertions._assert(pk instanceof LocalPointerKey,"String_Node_Str");
  LocalPointerKey lpk=(LocalPointerKey)pk;
  SimpleDemandPointerFlowGraph g=new SimpleDemandPointerFlowGraph(cg,heapModel,fam,cha);
  CGNode node=lpk.getNode();
  g.addSubgraphForNode(node);
  if (!g.containsNode(pk)) {
    return Collections.emptySet();
  }
  if (VERBOSE) {
    Trace.println(g.toString());
  }
  Filter iKeyFilter=new Filter(){
    public boolean accepts(    Object o){
      return o instanceof InstanceKey;
    }
  }
;
  SlowDFSDiscoverTimeIterator<Object> dfs=new SlowDFSDiscoverTimeIterator<Object>(g,pk);
  return Iterator2Collection.toCollection((Iterator<? extends InstanceKey>)new FilterIterator<Object>(dfs,iKeyFilter));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Collection<InstanceKey> getPointsTo(PointerKey pk){
  Assertions._assert(pk instanceof LocalPointerKey,"String_Node_Str");
  LocalPointerKey lpk=(LocalPointerKey)pk;
  SimpleDemandPointerFlowGraph g=new SimpleDemandPointerFlowGraph(cg,heapModel,fam,cha);
  CGNode node=lpk.getNode();
  g.addSubgraphForNode(node);
  if (!g.containsNode(pk)) {
    return Collections.emptySet();
  }
  if (VERBOSE) {
    Trace.println(g.toString());
  }
  Filter iKeyFilter=new Filter(){
    public boolean accepts(    Object o){
      return o instanceof InstanceKey;
    }
  }
;
  SlowDFSDiscoverTimeIterator<Object> dfs=new SlowDFSDiscoverTimeIterator<Object>(g,pk);
  return Iterator2Collection.toCollection((Iterator<? extends InstanceKey>)(Iterator)new FilterIterator<Object>(dfs,iKeyFilter));
}
Program: 100329
Project: 100329
Buggy source:
@Override public TypeAbstraction meet(TypeAbstraction rhs){
  if (rhs == TOP) {
    return this;
  }
 else   if (rhs == this) {
    return this;
  }
 else   if (rhs instanceof PrimitiveType) {
    if (size() > ((PrimitiveType)rhs).size()) {
      return this;
    }
 else {
      return rhs;
    }
  }
 else {
    return TOP;
  }
}

Fixed version (ground truth):
@Override public TypeAbstraction meet(TypeAbstraction rhs){
  if (rhs == TOP) {
    return this;
  }
 else   if (rhs == this) {
    return this;
  }
 else   if (rhs instanceof PrimitiveType) {
    TypeReference other=((PrimitiveType)rhs).reference;
    if (reference == TypeReference.Double) {
      return this;
    }
 else     if (other == TypeReference.Double) {
      return rhs;
    }
 else     if (reference == TypeReference.Float) {
      return this;
    }
 else     if (other == TypeReference.Float) {
      return rhs;
    }
 else {
      if (size() > ((PrimitiveType)rhs).size()) {
        return this;
      }
 else {
        return rhs;
      }
    }
  }
 else {
    return TOP;
  }
}
Program: 100330
Project: 100330
Buggy source:
private FunctionTerm(IFunction f,List<ITerm> parameters) throws IllegalArgumentException {
  this.f=f;
  this.parameters=parameters;
  if (f == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
private FunctionTerm(IFunction f,List<ITerm> parameters) throws IllegalArgumentException {
  this.f=f;
  this.parameters=parameters;
  if (f == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (parameters == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  for (  ITerm t : parameters) {
    if (t == null) {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
}
Program: 100331
Project: 100331
Buggy source:
/** 
 * Does the term t1 match the pattern t2? Note that this deals with wildcards.
 */
private static boolean termsMatch(ITerm t1,ITerm t2){
  if (t1.equals(t2)) {
    return true;
  }
switch (t1.getKind()) {
case CONSTANT:
case VARIABLE:
    return Wildcard.STAR.equals(t2);
case FUNCTION:
  if (Wildcard.STAR.equals(t2)) {
    return true;
  }
 else {
    if (t2 instanceof FunctionTerm) {
      FunctionTerm f1=(FunctionTerm)t1;
      FunctionTerm f2=(FunctionTerm)t2;
      if (f1.getFunction().equals(f2.getFunction())) {
        for (int i=0; i < f1.getParameters().size(); i++) {
          ITerm x=f1.getParameters().get(i);
          ITerm y=f2.getParameters().get(i);
          if (!termsMatch(x,y)) {
            return false;
          }
        }
        return true;
      }
    }
    return false;
  }
default :
Assertions.UNREACHABLE();
return false;
}
}

Fixed version (ground truth):
/** 
 * Does the term t1 match the pattern t2? Note that this deals with wildcards. Records bindings from Wildcards to Terms in the binding map ... modified as a side effect.
 */
private static boolean termsMatch(ITerm t1,ITerm t2,Map<Wildcard,ITerm> binding){
  if (t1.equals(t2)) {
    return true;
  }
  if (t2 instanceof Wildcard) {
    Wildcard w=(Wildcard)t2;
    ITerm b=binding.get(w);
    if (b != null) {
      return b.equals(t1);
    }
 else {
      binding.put(w,t1);
      return true;
    }
  }
switch (t1.getKind()) {
case CONSTANT:
case VARIABLE:
    return false;
case FUNCTION:
  if (t2 instanceof FunctionTerm) {
    FunctionTerm f1=(FunctionTerm)t1;
    FunctionTerm f2=(FunctionTerm)t2;
    if (f1.getFunction().equals(f2.getFunction())) {
      for (int i=0; i < f1.getParameters().size(); i++) {
        ITerm x=f1.getParameters().get(i);
        ITerm y=f2.getParameters().get(i);
        if (!termsMatch(x,y,binding)) {
          return false;
        }
      }
      return true;
    }
  }
return false;
default :
Assertions.UNREACHABLE();
return false;
}
}
Program: 100332
Project: 100332
Buggy source:
/** 
 * does the structure of some formula f suggest an immediate substitution to simplify the system, based on theory of equality?
 * @return a pair (p1, p2) meaning "substitute p2 for p1"
 */
private static Pair<ITerm,ITerm> getNextEqualitySubstitution(Collection<IFormula> s,Collection<? extends IFormula> theory,Collection<IFormula> alreadyUsed){
  Collection<IFormula> candidates=HashSetFactory.make();
  candidates.addAll(s);
  candidates.addAll(theory);
  for (  IFormula f : candidates) {
    if (!alreadyUsed.contains(f)) {
      Pair<ITerm,ITerm> substitution=equalitySuggestsSubsitution(f);
      if (substitution != null) {
        alreadyUsed.add(f);
        return substitution;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * does the structure of some formula f suggest an immediate substitution to simplify the system, based on theory of equality?
 * @return a pair (p1, p2) meaning "substitute p2 for p1"
 */
private static Pair<ITerm,ITerm> getNextEqualitySubstitution(Collection<IFormula> s,Collection<? extends IFormula> theory,Collection<IFormula> alreadyUsed){
  Collection<IFormula> candidates=HashSetFactory.make();
  candidates.addAll(s);
  candidates.addAll(theory);
  for (  IFormula f : candidates) {
    if (!alreadyUsed.contains(f)) {
      Pair<ITerm,ITerm> substitution=equalitySuggestsSubstitution(f);
      if (substitution != null) {
        alreadyUsed.add(f);
        return substitution;
      }
    }
  }
  return null;
}
Program: 100333
Project: 100333
Buggy source:
/** 
 * in term t, substitute t2 for free occurrences of t1
 */
private static ITerm substitute(ITerm t,ITerm t1,ITerm t2){
  if (termsMatch(t,t1)) {
    return t2;
  }
switch (t.getKind()) {
case CONSTANT:
    return t;
case FUNCTION:
  FunctionTerm f=(FunctionTerm)t;
List<ITerm> terms=new LinkedList<ITerm>();
for (ITerm p : f.getParameters()) {
terms.add(substitute(p,t1,t2));
}
return FunctionTerm.make(f.getFunction(),terms);
case VARIABLE:
if (t1.equals(t)) {
return t2;
}
 else {
return t;
}
default :
Assertions.UNREACHABLE();
return null;
}
}

Fixed version (ground truth):
/** 
 * in term t, substitute t2 for free occurrences of t1
 */
private static ITerm substitute(ITerm t,ITerm t1,ITerm t2,Map<Wildcard,ITerm> binding){
}
Program: 100334
Project: 100334
Buggy source:
private Wildcard(){
}

Fixed version (ground truth):
private Wildcard(int number){
  this.number=number;
}
Program: 100335
Project: 100335
Buggy source:
@Override public int hashCode(){
  return 151;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + number;
  return result;
}
Program: 100336
Project: 100336
Buggy source:
@Override public boolean equals(Object obj){
  return this == obj;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  final Wildcard other=(Wildcard)obj;
  if (number != other.number)   return false;
  return true;
}
Program: 100337
Project: 100337
Buggy source:
@Override public String toString(){
  return "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return number == 0 ? "String_Node_Str" : "String_Node_Str" + number + "String_Node_Str";
}
Program: 100338
Project: 100338
Buggy source:
@SuppressWarnings("String_Node_Str") public Collection<? extends IFunction> getFunctions(){
  Set<? extends IFunction> s=HashSetFactory.make();
  s.addAll(a.getFunctions());
  s.addAll(b.getFunctions());
  return s;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Collection<? extends IFunction> getFunctions(){
  Collection<? extends IFunction> s=HashSetFactory.make();
  s.addAll(a.getFunctions());
  s.addAll(b.getFunctions());
  return s;
}
Program: 100339
Project: 100339
Buggy source:
@SuppressWarnings("String_Node_Str") public Collection<? extends IRelation> getRelations(){
  Set<? extends IRelation> s=HashSetFactory.make();
  s.addAll(a.getRelations());
  s.addAll(b.getRelations());
  return s;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Collection<? extends IRelation> getRelations(){
  Collection<? extends IRelation> s=HashSetFactory.make();
  s.addAll(a.getRelations());
  s.addAll(b.getRelations());
  return s;
}
Program: 100340
Project: 100340
Buggy source:
public int getMaxNumber(){
  Assertions.UNREACHABLE();
  return 0;
}

Fixed version (ground truth):
public int getMaxNumber(){
  return getNumberOfNodes() - 1;
}
Program: 100341
Project: 100341
Buggy source:
public int getNumber(){
  if (isEntryBlock()) {
    return 0;
  }
 else   if (isExitBlock()) {
    return getNumberOfNodes() - 1;
  }
 else {
    return instructionIndex;
  }
}

Fixed version (ground truth):
public int getNumber(){
  if (isEntryBlock()) {
    return 0;
  }
 else   if (isExitBlock()) {
    return getNumberOfNodes() - 1;
  }
 else {
    return instructionIndex + 1;
  }
}
Program: 100342
Project: 100342
Buggy source:
public IBasicBlock getNode(int number){
  if (number == 0) {
    return entry();
  }
 else   if (number == getNumberOfNodes() - 1) {
    return exit();
  }
 else {
    return normalNodes.get(number);
  }
}

Fixed version (ground truth):
public IBasicBlock getNode(int number){
  if (number == 0) {
    return entry();
  }
 else   if (number == getNumberOfNodes() - 1) {
    return exit();
  }
 else {
    return normalNodes.get(number - 1);
  }
}
Program: 100343
Project: 100343
Buggy source:
/** 
 * Evaluate a meet of the stacks of machine states at the entry of a basic block. TODO: add some efficiency shortcuts. TODO: clean up and refactor.
 * @param bb the basic block at whose entry the meet occurs
 * @return true if the lhs value changes. false otherwise.
 */
private boolean meetStacks(IVariable lhs,IVariable[] rhs,BasicBlock bb,Meeter meeter){
  boolean changed=false;
  MachineState L=(MachineState)lhs;
  int height=computeMeetStackHeight(rhs);
  if (height > -1 && L.stack == null) {
    L.allocateStack();
    L.stackHeight=height;
    changed=true;
  }
  for (int i=0; i < height; i++) {
    int[] R=new int[rhs.length];
    for (int j=0; j < R.length; j++) {
      MachineState m=(MachineState)rhs[j];
      if (m.stack == null) {
        R[j]=TOP;
      }
 else {
        R[j]=m.stack[i];
      }
    }
    int meet=meeter.meetStack(i,R,bb);
    if (L.stack[i] == TOP) {
      if (meet != TOP) {
        changed=true;
        L.stack[i]=meet;
      }
    }
 else     if (meet != L.stack[i]) {
      changed=true;
      L.stack[i]=meet;
    }
  }
  return changed;
}

Fixed version (ground truth):
/** 
 * Evaluate a meet of the stacks of machine states at the entry of a basic block. TODO: add some efficiency shortcuts. TODO: clean up and refactor.
 * @param bb the basic block at whose entry the meet occurs
 * @return true if the lhs value changes. false otherwise.
 */
private boolean meetStacks(IVariable lhs,IVariable[] rhs,BasicBlock bb,Meeter meeter){
  boolean changed=false;
  MachineState L=(MachineState)lhs;
  int height=computeMeetStackHeight(rhs);
  if (height > -1 && L.stack == null) {
    L.allocateStack();
    L.stackHeight=height;
    changed=true;
  }
  for (int i=0; i < height; i++) {
    int[] R=new int[rhs.length];
    for (int j=0; j < R.length; j++) {
      MachineState m=(MachineState)rhs[j];
      if (m.stack == null) {
        R[j]=TOP;
      }
 else {
        R[j]=m.stack[i];
        if (R[j] == 0) {
          R[j]=TOP;
        }
      }
    }
    int meet=meeter.meetStack(i,R,bb);
    if (L.stack[i] == TOP) {
      if (meet != TOP) {
        changed=true;
        L.stack[i]=meet;
      }
    }
 else     if (meet != L.stack[i]) {
      changed=true;
      L.stack[i]=meet;
    }
  }
  return changed;
}
Program: 100344
Project: 100344
Buggy source:
@Override public String toString(){
  if (isTOP()) {
    return "String_Node_Str" + System.identityHashCode(this);
  }
  StringBuffer result=new StringBuffer("String_Node_Str");
  result.append("String_Node_Str");
  if (stackHeight == 0) {
    result.append("String_Node_Str");
  }
 else {
    result.append(array2StringBuffer(stack,stackHeight));
  }
  result.append("String_Node_Str");
  result.append(array2StringBuffer(locals,maxLocals));
  result.append("String_Node_Str");
  result.append(System.identityHashCode(this));
  return result.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  if (isTOP()) {
    return "String_Node_Str" + System.identityHashCode(this);
  }
  StringBuffer result=new StringBuffer("String_Node_Str");
  result.append("String_Node_Str");
  if (stackHeight == 0) {
    result.append("String_Node_Str");
  }
 else {
    result.append(array2StringBuffer(stack,stackHeight));
  }
  result.append("String_Node_Str");
  result.append(array2StringBuffer(locals,maxLocals));
  result.append("String_Node_Str");
  return result.toString();
}
Program: 100345
Project: 100345
Buggy source:
public Iterator<SSAPhiInstruction> iteratePhis(){
  compressPhis();
  if (stackSlotPhis == null) {
    if (localPhis == null) {
      return EmptyIterator.instance();
    }
 else {
      return Arrays.asList(localPhis).iterator();
    }
  }
 else {
    if (localPhis == null) {
      return Arrays.asList(stackSlotPhis).iterator();
    }
 else {
      return new CompoundIterator<SSAPhiInstruction>(Arrays.asList(stackSlotPhis).iterator(),Arrays.asList(localPhis).iterator());
    }
  }
}

Fixed version (ground truth):
public Iterator<SSAPhiInstruction> iteratePhis(){
  compressPhis();
  if (stackSlotPhis == null) {
    if (localPhis == null) {
      return EmptyIterator.instance();
    }
 else {
      LinkedList<SSAPhiInstruction> result=new LinkedList<SSAPhiInstruction>();
      for (      SSAPhiInstruction phi : localPhis) {
        if (phi != null) {
          result.add(phi);
        }
      }
      return result.iterator();
    }
  }
 else {
    if (localPhis == null) {
      LinkedList<SSAPhiInstruction> result=new LinkedList<SSAPhiInstruction>();
      for (      SSAPhiInstruction phi : stackSlotPhis) {
        if (phi != null) {
          result.add(phi);
        }
      }
      return result.iterator();
    }
 else {
      LinkedList<SSAPhiInstruction> result=new LinkedList<SSAPhiInstruction>();
      for (      SSAPhiInstruction phi : localPhis) {
        if (phi != null) {
          result.add(phi);
        }
      }
      return result.iterator();
    }
  }
}
Program: 100346
Project: 100346
Buggy source:
/** 
 * Process the given array reference node. Factored out so that derived languages can reuse this code for specially-marked types of array references (as in X10, for which different instruction types get generated, but whose structure is essentially the same as an ordinary array reference).
 */
protected boolean doVisitArrayRefNode(CAstNode n,CAstNode v,CAstNode a,boolean assign,boolean preOp,Context context,CAstVisitor visitor){
  if (assign ? visitor.visitArrayRefAssign(n,v,a,context,visitor) : visitor.visitArrayRefAssignOp(n,v,a,preOp,context,visitor))   return true;
  visitor.visit(n.getChild(0),context,visitor);
  visitor.visitChildren(n,2,context,visitor);
  if (assign)   visitor.leaveArrayRefAssign(n,v,a,context,visitor);
 else   visitor.leaveArrayRefAssignOp(n,v,a,preOp,context,visitor);
  return true;
}

Fixed version (ground truth):
/** 
 * Process the given array reference node. Factored out so that derived languages can reuse this code for specially-marked types of array references (as in X10, for which different instruction types get generated, but whose structure is essentially the same as an ordinary array reference).
 */
protected boolean doVisitArrayRefNode(CAstNode n,CAstNode v,CAstNode a,boolean assign,boolean preOp,Context context,CAstVisitor visitor){
  if (assign ? visitor.visitArrayRefAssign(n,v,a,context,visitor) : visitor.visitArrayRefAssignOp(n,v,a,preOp,context,visitor))   return true;
  visitor.visit(n.getChild(0),context,visitor);
  visitor.visitChildren(n,2,context,visitor);
  if (assign)   visitor.leaveArrayRefAssign(n,v,a,context,visitor);
 else   visitor.leaveArrayRefAssignOp(n,v,a,preOp,context,visitor);
  return false;
}
Program: 100348
Project: 100348
Buggy source:
@SuppressWarnings("String_Node_Str") public Iterator<T> iterator(){
  return (Iterator<T>)Arrays.asList(store).iterator();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Iterator<T> iterator(){
  ArrayList<T> result=new ArrayList<T>();
  for (int i=0; i <= maxIndex; i++) {
    result.add((T)store[i]);
  }
  return result.iterator();
}
Program: 100349
Project: 100349
Buggy source:
/** 
 * @param index an instruction index from the original SSA IR
 * @return the basic block which contains this instruction.
 */
public IBasicBlock getBlockForInstruction(int index){
  SSAInstruction s=ir.getInstructions()[index];
  return instructionToBlock.get(s);
}

Fixed version (ground truth):
/** 
 * @param index an instruction index from the original SSA IR
 * @return the basic block which contains this instruction.
 */
public IBasicBlock getBlockForInstruction(int index){
  SSAInstruction s=null;
  do {
    s=ir.getInstructions()[index++];
  }
 while (s == null);
  return instructionToBlock.get(s);
}
Program: 100350
Project: 100350
Buggy source:
/** 
 * return the Instruction-Block for the given instruction.
 * @param inst -instruction
 * @return SingleInstructionBasicBlock containing the given instruction
 */
public SingleInstructionBasicBlock getInstructionBlock(SSAInstruction inst){
  return instructionToBlock.get(inst);
}

Fixed version (ground truth):
/** 
 * return the Instruction-Block for the given instruction. DEPRECATED: use getBlockForInstruction instead.
 * @param inst -instruction
 * @return SingleInstructionBasicBlock containing the given instruction
 */
@Deprecated public SingleInstructionBasicBlock getInstructionBlock(SSAInstruction inst){
  return instructionToBlock.get(inst);
}
Program: 100351
Project: 100351
Buggy source:
@Override public IFormula getF2(){
  Collection<? extends IFormula> c=HashSetFactory.make(clauses);
  c.remove(getF1());
  return make(c);
}

Fixed version (ground truth):
@Override public IFormula getF2(){
  Collection<? extends IFormula> c=HashSetFactory.make(clauses);
  c.remove(getF1());
  if (c.size() == 1) {
    return c.iterator().next();
  }
 else {
    return make(c);
  }
}
Program: 100352
Project: 100352
Buggy source:
public void testSlice2() throws ClassHierarchyException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA);
  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,cha,scope);
  CallGraph cg=builder.makeCallGraph(options);
  CGNode main=findMethod(cg,"String_Node_Str");
  Statement s=findCallTo(main,"String_Node_Str");
  System.err.println("String_Node_Str" + s);
  Collection<Statement> slice=Slicer.computeBackwardSlice(s,cg,builder.getPointerAnalysis(),DataDependenceOptions.FULL,ControlDependenceOptions.NONE);
  dumpSlice(slice);
  assertEquals(30,slice.size());
}

Fixed version (ground truth):
public void testSlice2() throws ClassHierarchyException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope(TestConstants.WALA_TESTDATA);
  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,cha,scope);
  CallGraph cg=builder.makeCallGraph(options);
  CGNode main=findMethod(cg,"String_Node_Str");
  Statement s=findCallTo(main,"String_Node_Str");
  System.err.println("String_Node_Str" + s);
  Collection<Statement> slice=Slicer.computeBackwardSlice(s,cg,builder.getPointerAnalysis(),DataDependenceOptions.FULL,ControlDependenceOptions.NONE);
  dumpSlice(slice);
  assertEquals(22,slice.size());
}
Program: 100353
Project: 100353
Buggy source:
private static Collection<IMaxTerm> collectMaxTerms(IFormula f){
switch (f.getKind()) {
case CONSTANT:
case QUANTIFIED:
case RELATION:
    return Collections.singleton((IMaxTerm)f);
case BINARY:
  AbstractBinaryFormula b=(AbstractBinaryFormula)f;
Collection<IMaxTerm> result=HashSetFactory.make();
result.addAll(collectMaxTerms(b.getF1()));
result.addAll(collectMaxTerms(b.getF2()));
return result;
case NEGATION:
default :
Assertions.UNREACHABLE(f);
return null;
}
}

Fixed version (ground truth):
private static Collection<IMaxTerm> collectMaxTerms(IFormula f){
switch (f.getKind()) {
case CONSTANT:
case QUANTIFIED:
case RELATION:
    return Collections.singleton((IMaxTerm)f);
case BINARY:
  AbstractBinaryFormula b=(AbstractBinaryFormula)f;
if (b.getConnective().equals(BinaryConnective.AND)) {
  Collection<IMaxTerm> result=HashSetFactory.make();
  result.addAll(collectMaxTerms(b.getF1()));
  result.addAll(collectMaxTerms(b.getF2()));
  return result;
}
 else if (b.getConnective().equals(BinaryConnective.OR)) {
  return Collections.singleton(orToMaxTerm(b));
}
 else {
  Assertions.UNREACHABLE();
  return null;
}
case NEGATION:
default :
Assertions.UNREACHABLE(f);
return null;
}
}
Program: 100354
Project: 100354
Buggy source:
private static Collection<Disjunction> collectClauses(AbstractBinaryFormula b){
  assert(b.getConnective().equals(BinaryConnective.AND));
  Collection<Disjunction> result=HashSetFactory.make();
  IFormula f1=b.getF1();
  if (f1 instanceof AbstractBinaryFormula) {
    AbstractBinaryFormula b1=(AbstractBinaryFormula)f1;
    if (b1.getConnective().equals(BinaryConnective.AND)) {
      result.addAll(collectClauses(b1));
    }
 else {
      result.add(toDisjunction(b1));
    }
  }
 else {
    result.add(toDisjunction(f1));
  }
  IFormula f2=b.getF2();
  if (f2 instanceof AbstractBinaryFormula) {
    AbstractBinaryFormula b2=(AbstractBinaryFormula)f2;
    if (b2.getConnective().equals(BinaryConnective.AND)) {
      result.addAll(collectClauses(b2));
    }
 else {
      result.add(toDisjunction(b2));
    }
  }
 else {
    result.add(toDisjunction(f2));
  }
  return result;
}

Fixed version (ground truth):
private static Collection<Disjunction> collectClauses(AbstractBinaryFormula b){
  if (b.getConnective().equals(BinaryConnective.AND)) {
    Collection<Disjunction> result=HashSetFactory.make();
    IFormula f1=b.getF1();
    if (f1 instanceof AbstractBinaryFormula) {
      AbstractBinaryFormula b1=(AbstractBinaryFormula)f1;
      if (b1.getConnective().equals(BinaryConnective.AND)) {
        result.addAll(collectClauses(b1));
      }
 else {
        result.add(toDisjunction(b1));
      }
    }
 else {
      result.add(toDisjunction(f1));
    }
    IFormula f2=b.getF2();
    if (f2 instanceof AbstractBinaryFormula) {
      AbstractBinaryFormula b2=(AbstractBinaryFormula)f2;
      if (b2.getConnective().equals(BinaryConnective.AND)) {
        result.addAll(collectClauses(b2));
      }
 else {
        result.add(toDisjunction(b2));
      }
    }
 else {
      result.add(toDisjunction(f2));
    }
    return result;
  }
 else {
    return Collections.singleton(toDisjunction(b));
  }
}
Program: 100355
Project: 100355
Buggy source:
private static Disjunction toDisjunction(IFormula f){
switch (f.getKind()) {
case BINARY:
    AbstractBinaryFormula b=(AbstractBinaryFormula)f;
  if (b.getConnective().equals(BinaryConnective.OR)) {
    IFormula f1=b.getF1();
    Disjunction d2=toDisjunction(b.getF2());
    Collection<IFormula> c=HashSetFactory.make();
    c.add(f1);
    c.addAll(d2.getClauses());
    return Disjunction.make(c);
  }
 else {
    Assertions.UNREACHABLE(b.getConnective());
    return null;
  }
case CONSTANT:
case QUANTIFIED:
case RELATION:
return Disjunction.make(Collections.singleton(simplify(f)));
case NEGATION:
default :
Assertions.UNREACHABLE(f.getKind());
return null;
}
}

Fixed version (ground truth):
private static Disjunction toDisjunction(IFormula f){
switch (f.getKind()) {
case BINARY:
    AbstractBinaryFormula b=(AbstractBinaryFormula)f;
  if (b.getConnective().equals(BinaryConnective.OR)) {
    IFormula f1=b.getF1();
    Disjunction d2=toDisjunction(b.getF2());
    Collection<IFormula> c=HashSetFactory.make();
    c.add(f1);
    c.addAll(d2.getClauses());
    return Disjunction.make(c);
  }
 else {
    Assertions.UNREACHABLE(b.getConnective());
    return null;
  }
case CONSTANT:
case QUANTIFIED:
case RELATION:
case NEGATION:
return Disjunction.make(Collections.singleton(simplify(f)));
default :
Assertions.UNREACHABLE(f.getKind());
return null;
}
}
Program: 100356
Project: 100356
Buggy source:
public static IFormula make(IFormula f){
  if (f instanceof RelationFormula) {
    RelationFormula r=(RelationFormula)f;
    if (r.getRelation().equals(BinaryRelation.EQUALS)) {
      return RelationFormula.make(BinaryRelation.NE,r.getTerms());
    }
    if (r.getRelation().equals(BinaryRelation.NE)) {
      return RelationFormula.make(BinaryRelation.EQUALS,r.getTerms());
    }
    if (r.getRelation().equals(BinaryRelation.GE)) {
      return RelationFormula.make(BinaryRelation.LT,r.getTerms());
    }
    if (r.getRelation().equals(BinaryRelation.GT)) {
      return RelationFormula.make(BinaryRelation.LE,r.getTerms());
    }
    if (r.getRelation().equals(BinaryRelation.LE)) {
      return RelationFormula.make(BinaryRelation.GT,r.getTerms());
    }
    if (r.getRelation().equals(BinaryRelation.LT)) {
      return RelationFormula.make(BinaryRelation.GE,r.getTerms());
    }
  }
  return new NotFormula(f);
}

Fixed version (ground truth):
public static IFormula make(IFormula f){
switch (f.getKind()) {
case RELATION:
    RelationFormula r=(RelationFormula)f;
  if (r.getRelation().equals(BinaryRelation.EQUALS)) {
    return RelationFormula.make(BinaryRelation.NE,r.getTerms());
  }
if (r.getRelation().equals(BinaryRelation.NE)) {
  return RelationFormula.make(BinaryRelation.EQUALS,r.getTerms());
}
if (r.getRelation().equals(BinaryRelation.GE)) {
return RelationFormula.make(BinaryRelation.LT,r.getTerms());
}
if (r.getRelation().equals(BinaryRelation.GT)) {
return RelationFormula.make(BinaryRelation.LE,r.getTerms());
}
if (r.getRelation().equals(BinaryRelation.LE)) {
return RelationFormula.make(BinaryRelation.GT,r.getTerms());
}
if (r.getRelation().equals(BinaryRelation.LT)) {
return RelationFormula.make(BinaryRelation.GE,r.getTerms());
}
return new NotFormula(f);
case CONSTANT:
case BINARY:
case NEGATION:
case QUANTIFIED:
default :
return new NotFormula(f);
}
}
Program: 100357
Project: 100357
Buggy source:
public String prettyPrint(ILogicDecorator d){
  StringBuffer result=new StringBuffer();
  result.append("String_Node_Str");
  result.append(f1.prettyPrint(d));
  result.append("String_Node_Str");
  result.append(d.prettyPrint(b));
  result.append("String_Node_Str");
  result.append(f2.prettyPrint(d));
  result.append("String_Node_Str");
  return result.toString();
}

Fixed version (ground truth):
public String prettyPrint(ILogicDecorator d){
  return d.prettyPrint(this);
}
Program: 100358
Project: 100358
Buggy source:
public String prettyPrint(IRelation r){
  return r.getSymbol();
}

Fixed version (ground truth):
public String prettyPrint(BinaryFormula f){
  StringBuffer result=new StringBuffer();
  result.append("String_Node_Str");
  result.append(f.getF1().prettyPrint(this));
  result.append("String_Node_Str");
  result.append(prettyPrint(f.getConnective()));
  result.append("String_Node_Str");
  result.append(f.getF2().prettyPrint(this));
  result.append("String_Node_Str");
  return result.toString();
}
Program: 100359
Project: 100359
Buggy source:
String prettyPrint(IRelation r);

Fixed version (ground truth):
String prettyPrint(BinaryFormula binaryFormula);
Program: 100361
Project: 100361
Buggy source:
/** 
 * map each SSAInstruction index to the NormalStatement which represents it.
 */
private static Map<Integer,NormalStatement> mapInstructionsToStatements(OrdinalSetMapping<Statement> domain){
  Map<Integer,NormalStatement> result=HashMapFactory.make();
  for (  Statement s : domain) {
    if (s.getKind().equals(Kind.NORMAL)) {
      NormalStatement n=(NormalStatement)s;
      System.err.println("String_Node_Str" + n.getInstructionIndex() + "String_Node_Str"+ n);
      result.put(n.getInstructionIndex(),n);
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * map each SSAInstruction index to the NormalStatement which represents it.
 */
private static Map<Integer,NormalStatement> mapInstructionsToStatements(OrdinalSetMapping<Statement> domain){
  Map<Integer,NormalStatement> result=HashMapFactory.make();
  for (  Statement s : domain) {
    if (s.getKind().equals(Kind.NORMAL)) {
      NormalStatement n=(NormalStatement)s;
      result.put(n.getInstructionIndex(),n);
    }
  }
  return result;
}
Program: 100362
Project: 100362
Buggy source:
/** 
 * Create nodes in the graph corresponding to "normal" (bytecode) instructions
 * @param options
 */
private Collection<SSAInstruction> createNormalStatements(IR ir,Map<CGNode,OrdinalSet<PointerKey>> ref){
  Collection<SSAInstruction> visited=HashSetFactory.make();
  SSAInstruction[] instructions=ir.getInstructions();
  for (int i=0; i < instructions.length; i++) {
    SSAInstruction s=instructions[i];
    if (s instanceof SSAGetCaughtExceptionInstruction) {
      continue;
    }
    if (s != null) {
      addNode(new NormalStatement(node,i));
      visited.add(s);
    }
    if (s instanceof SSAAbstractInvokeInstruction) {
      addParamPassingStatements(i,ref);
    }
  }
  return visited;
}

Fixed version (ground truth):
/** 
 * Create nodes in the graph corresponding to "normal" (bytecode) instructions
 */
private Collection<SSAInstruction> createNormalStatements(IR ir,Map<CGNode,OrdinalSet<PointerKey>> ref){
  Collection<SSAInstruction> visited=HashSetFactory.make();
  SSAInstruction[] instructions=ir.getInstructions();
  for (int i=0; i < instructions.length; i++) {
    SSAInstruction s=instructions[i];
    if (s instanceof SSAGetCaughtExceptionInstruction) {
      continue;
    }
    if (s != null) {
      addNode(new NormalStatement(node,i));
      visited.add(s);
    }
    if (s instanceof SSAAbstractInvokeInstruction) {
      addParamPassingStatements(i,ref);
    }
  }
  return visited;
}
Program: 100363
Project: 100363
Buggy source:
/** 
 * some code is required here in order to "hop-over" dead blocks that only contain null-instructions.
 * @param bb -basic block
 * @param instbb -an instruction basic-block (SingleInstructionBasicBlock)
 */
private void handleLastInstruction(BasicBlock bb,SingleInstructionBasicBlock instbb){
  Set<BBEdge> edgeWorkSet=HashSetFactory.make();
  if (!instbb.isPiBlock()) {
    for (Iterator sit=cfg.getSuccNodes(bb); sit.hasNext(); ) {
      BasicBlock succNode=(BasicBlock)sit.next();
      boolean fallThrough=isFallThroughEdge(bb,succNode);
      edgeWorkSet.add(new BBEdge(bb,succNode,fallThrough));
    }
  }
 else {
    SSAPiInstruction pi=(SSAPiInstruction)instbb.getInstruction();
    int succNum=pi.getSuccessor();
    BasicBlock succNode=(BasicBlock)cfg.getNode(succNum);
    boolean fallThrough=isFallThroughEdge(bb,succNode);
    edgeWorkSet.add(new BBEdge(bb,succNode,fallThrough));
  }
  if (bb.isExitBlock()) {
    addEdge(instbb,exitBlock);
  }
  while (!edgeWorkSet.isEmpty()) {
    Iterator workIt=edgeWorkSet.iterator();
    BBEdge edge=(BBEdge)workIt.next();
    boolean fallThru=false;
    if (isFallThroughEdge(edge.src,edge.dest)) {
      fallThru=true;
    }
    workIt.remove();
    if (edge.dest.isEntryBlock()) {
      addEdge(instbb,entryBlock);
      if (fallThru) {
        fallThroughTargets.put(instbb,entryBlock);
      }
    }
 else     if (edge.dest.isExitBlock()) {
      if (basicBlockHasNonNullInstruction(edge.dest)) {
        SSAInstruction succInst=getBasicBlockEntry(edge.dest);
        SingleInstructionBasicBlock succBlock=getInstructionBlock(succInst);
        addEdge(instbb,succBlock);
        if (fallThru) {
          fallThroughTargets.put(instbb,succBlock);
        }
      }
 else {
        addEdge(instbb,exitBlock);
        if (fallThru) {
          fallThroughTargets.put(instbb,exitBlock);
        }
      }
    }
 else     if (basicBlockHasNonNullInstruction(edge.dest)) {
      SSAInstruction succInst=getBasicBlockEntry(edge.dest);
      SingleInstructionBasicBlock succBlock=getInstructionBlock(succInst);
      addEdge(instbb,succBlock);
      if (fallThru) {
        fallThroughTargets.put(instbb,succBlock);
      }
    }
 else {
      for (Iterator sit=cfg.getSuccNodes(edge.dest); sit.hasNext(); ) {
        BasicBlock succNode=(BasicBlock)sit.next();
        edgeWorkSet.add(new BBEdge(bb,succNode,edge.isFallThrough));
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * some code is required here in order to "hop-over" dead blocks that only contain null-instructions.
 * @param bb -basic block
 * @param instbb -an instruction basic-block (SingleInstructionBasicBlock)
 */
private void handleLastInstruction(BasicBlock bb,SingleInstructionBasicBlock instbb){
}