nus-yam/ex-repair huggingface dataset:
Program: 40748
Project: 40748
Buggy source:
private String makeClasspath(){
  String cp="String_Node_Str" + System.getProperty("String_Node_Str");
  if (getXtraClassPath() == null || getXtraClassPath().isEmpty()) {
    return cp;
  }
 else {
    for (Iterator it=getXtraClassPath().iterator(); it.hasNext(); ) {
      cp+=(String)it.next();
      if (it.hasNext()) {
        cp+="String_Node_Str";
      }
    }
    cp+="String_Node_Str";
    return cp;
  }
}

Fixed version (ground truth):
private String makeClasspath(){
  String cp="String_Node_Str" + System.getProperty("String_Node_Str");
  if (getXtraClassPath() == null || getXtraClassPath().isEmpty()) {
    return cp;
  }
 else {
    cp+="String_Node_Str";
    for (Iterator it=getXtraClassPath().iterator(); it.hasNext(); ) {
      cp+=(String)it.next();
      if (it.hasNext()) {
        cp+="String_Node_Str";
      }
    }
    cp+="String_Node_Str";
    return cp;
  }
}
Program: 40749
Project: 40749
Buggy source:
public String prettyPrint(ILogicDecorator d){
  if (clauses.size() == 1) {
    return getF1().prettyPrint(d);
  }
 else {
    StringBuffer result=new StringBuffer();
    result.append("String_Node_Str");
    result.append(getF1().prettyPrint(d));
    result.append("String_Node_Str");
    result.append(d.prettyPrint(getConnective()));
    result.append("String_Node_Str");
    result.append(getF2().prettyPrint(d));
    result.append("String_Node_Str");
    return result.toString();
  }
}

Fixed version (ground truth):
public String prettyPrint(ILogicDecorator d){
  if (d == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return d.prettyPrint(this);
}
Program: 40750
Project: 40750
Buggy source:
private static IMaxTerm simplifyDisjunction(Disjunction d,Collection<IMaxTerm> otherFacts,ISemiDecisionProcedure dec){
  Collection<IFormula> result=HashSetFactory.make();
  for (  IFormula f : d.getClauses()) {
    if (dec.isContradiction(f,otherFacts)) {
      result.add(BooleanConstantFormula.FALSE);
    }
 else     if (dec.isTautology(f,otherFacts)) {
      result.add(BooleanConstantFormula.TRUE);
    }
 else {
      result.add(f);
    }
  }
  return Disjunction.make(result);
}

Fixed version (ground truth):
private static IMaxTerm simplifyDisjunction(Disjunction d,Collection<IMaxTerm> otherFacts,ISemiDecisionProcedure dec){
}
Program: 40752
Project: 40752
Buggy source:
/** 
 * @return int set representing the heap def statements that are gen'ed bythe basic block. null if none.
 */
IntSet gen(ExplodedBasicBlock b){
  if (b.isEntryBlock()) {
    return heapEntryStatements();
  }
 else {
    SSAInstruction s=b.getInstruction();
    if (s == null) {
      return null;
    }
 else {
      if (s instanceof SSAInvokeInstruction) {
        Statement st=ssaInstructionIndex2Statement.get(b.getLastInstructionIndex());
        if (st == null) {
          System.err.println(ssaInstructionIndex2Statement);
          Assertions.UNREACHABLE("String_Node_Str" + b + "String_Node_Str"+ b.getLastInstructionIndex()+ "String_Node_Str"+ s);
        }
        int domainIndex=domain.getMappedIndex(st);
        assert(domainIndex != -1);
        return heapReturnCaller.getRelated(domainIndex);
      }
 else {
        Collection<PointerKey> gen=modRef.getMod(node,h,pa,s,exclusions);
        if (gen.isEmpty()) {
          return null;
        }
 else {
          NormalStatement n=ssaInstructionIndex2Statement.get(b.getLastInstructionIndex());
          return SparseIntSet.singleton(domain.getMappedIndex(n));
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * @return int set representing the heap def statements that are gen'ed bythe basic block. null if none.
 */
IntSet gen(ExplodedBasicBlock b){
  if (b.isEntryBlock()) {
    return heapEntryStatements();
  }
 else {
    SSAInstruction s=b.getInstruction();
    if (s == null) {
      return null;
    }
 else {
      if (s instanceof SSAAbstractInvokeInstruction) {
        Statement st=ssaInstructionIndex2Statement.get(b.getLastInstructionIndex());
        if (st == null) {
          System.err.println(ssaInstructionIndex2Statement);
          Assertions.UNREACHABLE("String_Node_Str" + b + "String_Node_Str"+ b.getLastInstructionIndex()+ "String_Node_Str"+ s);
        }
        int domainIndex=domain.getMappedIndex(st);
        assert(domainIndex != -1);
        return heapReturnCaller.getRelated(domainIndex);
      }
 else {
        Collection<PointerKey> gen=modRef.getMod(node,h,pa,s,exclusions);
        if (gen.isEmpty()) {
          return null;
        }
 else {
          NormalStatement n=ssaInstructionIndex2Statement.get(b.getLastInstructionIndex());
          return SparseIntSet.singleton(domain.getMappedIndex(n));
        }
      }
    }
  }
}
Program: 40753
Project: 40753
Buggy source:
public UnaryOperator getEdgeTransferFunction(IBasicBlock src,IBasicBlock dst){
  ExplodedBasicBlock s=(ExplodedBasicBlock)src;
  if (s.getInstruction() != null && !(s.getInstruction() instanceof SSAInvokeInstruction) && !cfg.getNormalSuccessors(src).contains(dst)) {
    return BitVectorIdentity.instance();
  }
 else {
    BitVector kill=kill(s);
    IntSet gen=gen(s);
    if (kill == null) {
      if (gen == null) {
        return BitVectorIdentity.instance();
      }
 else {
        return new BitVectorUnionVector(new BitVectorIntSet(gen).getBitVector());
      }
    }
 else {
      if (gen == null) {
        return new BitVectorMinusVector(kill);
      }
 else {
        return new BitVectorKillGen(kill,new BitVectorIntSet(gen).getBitVector());
      }
    }
  }
}

Fixed version (ground truth):
public UnaryOperator getEdgeTransferFunction(IBasicBlock src,IBasicBlock dst){
  ExplodedBasicBlock s=(ExplodedBasicBlock)src;
  if (s.getInstruction() != null && !(s.getInstruction() instanceof SSAAbstractInvokeInstruction) && !cfg.getNormalSuccessors(src).contains(dst)) {
    return BitVectorIdentity.instance();
  }
 else {
    BitVector kill=kill(s);
    IntSet gen=gen(s);
    if (kill == null) {
      if (gen == null) {
        return BitVectorIdentity.instance();
      }
 else {
        return new BitVectorUnionVector(new BitVectorIntSet(gen).getBitVector());
      }
    }
 else {
      if (gen == null) {
        return new BitVectorMinusVector(kill);
      }
 else {
        return new BitVectorKillGen(kill,new BitVectorIntSet(gen).getBitVector());
      }
    }
  }
}
Program: 40754
Project: 40754
Buggy source:
public boolean isImplicit(PointerKey p){
  int i=findOrCreateIndex(p);
  return pointsToSets.get(i) == IMPLICIT;
}

Fixed version (ground truth):
public boolean isImplicit(PointerKey p){
  int i=getIndex(p);
  return i != -1 && pointsToSets.get(i) == IMPLICIT;
}
Program: 40755
Project: 40755
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: 40756
Project: 40756
Buggy source:
public void testPrimordial() throws ClassHierarchyException {
  if (useShortProfile()) {
    return;
  }
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope("String_Node_Str","String_Node_Str");
  ClassHierarchy cha=ClassHierarchy.make(scope);
  Iterable<Entrypoint> entrypoints=makePrimordialMainEntrypoints(scope,cha);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  CallGraphTestUtil.buildZeroCFA(options,new AnalysisCache(),cha,scope);
}

Fixed version (ground truth):
public void testPrimordial() throws ClassHierarchyException {
  if (useShortProfile()) {
    return;
  }
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope("String_Node_Str","String_Node_Str");
  ClassHierarchy cha=ClassHierarchy.make(scope);
  Iterable<Entrypoint> entrypoints=makePrimordialMainEntrypoints(scope,cha);
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  CallGraphTestUtil.buildZeroCFA(options,new AnalysisCache(),cha,scope,false);
}
Program: 40757
Project: 40757
Buggy source:
/** 
 * Constructor for SpecJTest.
 * @param arg0
 */
public CallGraphTest(String arg0){
  super(arg0);
}

Fixed version (ground truth):
public CallGraphTest(String arg0){
  super(arg0);
}
Program: 40758
Project: 40758
Buggy source:
public void testIO() throws ClassHierarchyException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope("String_Node_Str","String_Node_Str");
  ClassHierarchy cha=ClassHierarchy.make(scope);
  Iterable<Entrypoint> entrypoints=makePrimordialPublicEntrypoints(scope,cha,"String_Node_Str");
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  CallGraphTestUtil.buildZeroCFA(options,new AnalysisCache(),cha,scope);
}

Fixed version (ground truth):
public void testIO() throws ClassHierarchyException {
  AnalysisScope scope=CallGraphTestUtil.makeJ2SEAnalysisScope("String_Node_Str","String_Node_Str");
  ClassHierarchy cha=ClassHierarchy.make(scope);
  Iterable<Entrypoint> entrypoints=makePrimordialPublicEntrypoints(scope,cha,"String_Node_Str");
  AnalysisOptions options=CallGraphTestUtil.makeAnalysisOptions(scope,entrypoints);
  CallGraphTestUtil.buildZeroCFA(options,new AnalysisCache(),cha,scope,false);
}
Program: 40759
Project: 40759
Buggy source:
public void testJava_cup() 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);
  doCallGraphs(options,new AnalysisCache(),cha,scope,null,useShortProfile(),false);
}

Fixed version (ground truth):
public void testJava_cup() 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);
  doCallGraphs(options,new AnalysisCache(),cha,scope,null,useShortProfile(),false,true);
}
Program: 40760
Project: 40760
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: 40761
Project: 40761
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: 40762
Project: 40762
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: 40763
Project: 40763
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: 40764
Project: 40764
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: 40765
Project: 40765
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: 40766
Project: 40766
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: 40767
Project: 40767
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: 40768
Project: 40768
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: 40769
Project: 40769
Buggy source:
public int getMaxNumber(){
  Assertions.UNREACHABLE();
  return 0;
}

Fixed version (ground truth):
public int getMaxNumber(){
  return getNumberOfNodes() - 1;
}
Program: 40770
Project: 40770
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: 40771
Project: 40771
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: 40772
Project: 40772
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: 40773
Project: 40773
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: 40774
Project: 40774
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: 40775
Project: 40775
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: 40776
Project: 40776
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: 40777
Project: 40777
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: 40778
Project: 40778
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: 40779
Project: 40779
Buggy source:
private Wildcard(){
}

Fixed version (ground truth):
private Wildcard(int number){
  this.number=number;
}
Program: 40780
Project: 40780
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: 40781
Project: 40781
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: 40782
Project: 40782
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: 40783
Project: 40783
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: 40784
Project: 40784
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: 40785
Project: 40785
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: 40787
Project: 40787
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: 40788
Project: 40788
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: 40789
Project: 40789
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: 40790
Project: 40790
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: 40791
Project: 40791
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: 40792
Project: 40792
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: 40793
Project: 40793
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: 40794
Project: 40794
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: 40795
Project: 40795
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: 40796
Project: 40796
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();
}