nus-yam/ex-repair huggingface dataset:
Program: 40854
Project: 40854
Buggy source:
@SuppressWarnings("String_Node_Str") private static ECallGraph loadFromFile(String fileName,ClassLoader loader){
  Resource r=new XMIResourceImpl(URI.createURI(fileName));
  XMLResource.XMLMap xmlMap=new XMLMapImpl();
  xmlMap.setNoNamespacePackage(CallGraphPackage.eINSTANCE);
  Map<String,XMLMap> options=new HashMap<String,XMLMap>();
  options.put(XMLResource.OPTION_XML_MAP,xmlMap);
  try {
    r.load(options);
  }
 catch (  IOException e) {
    InputStream s=loader.getResourceAsStream(fileName);
    Assertions.productionAssertion(s != null,"String_Node_Str" + fileName);
    ResourceSet resSet=new ResourceSetImpl();
    r=resSet.createResource(URI.createURI("String_Node_Str"));
    options=new HashMap<String,XMLMap>();
    try {
      r.load(s,options);
    }
 catch (    IOException e2) {
      e2.printStackTrace();
      Assertions.UNREACHABLE("String_Node_Str" + fileName);
    }
  }
  EList contents=r.getContents();
  for (Iterator<EObject> it=contents.iterator(); it.hasNext(); ) {
    Object o=it.next();
    if (o instanceof ECallGraph) {
      return (ECallGraph)o;
    }
  }
  return null;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private static ECallGraph loadFromFile(String fileName,ClassLoader loader) throws IllegalArgumentException {
  Resource r=new XMIResourceImpl(URI.createURI(fileName));
  XMLResource.XMLMap xmlMap=new XMLMapImpl();
  xmlMap.setNoNamespacePackage(CallGraphPackage.eINSTANCE);
  Map<String,XMLMap> options=new HashMap<String,XMLMap>();
  options.put(XMLResource.OPTION_XML_MAP,xmlMap);
  try {
    r.load(options);
  }
 catch (  IOException e) {
    InputStream s=loader.getResourceAsStream(fileName);
    if (s == null) {
      throw new IllegalArgumentException("String_Node_Str" + fileName);
    }
    ResourceSet resSet=new ResourceSetImpl();
    r=resSet.createResource(URI.createURI("String_Node_Str"));
    options=new HashMap<String,XMLMap>();
    try {
      r.load(s,options);
    }
 catch (    IOException e2) {
      e2.printStackTrace();
      Assertions.UNREACHABLE("String_Node_Str" + fileName);
    }
  }
  EList contents=r.getContents();
  for (Iterator<EObject> it=contents.iterator(); it.hasNext(); ) {
    Object o=it.next();
    if (o instanceof ECallGraph) {
      return (ECallGraph)o;
    }
  }
  return null;
}
Program: 40855
Project: 40855
Buggy source:
@SuppressWarnings("String_Node_Str") public static ECallGraphWrapper load(String fileName,ClassLoader loader){
  ECallGraph G=loadFromFile(fileName,loader);
  Assertions.productionAssertion(G != null);
  ECallGraphWrapper result=new ECallGraphWrapper();
  for (Iterator<EPair> it=G.getNodes().getContents().iterator(); it.hasNext(); ) {
    result.addNode(it.next());
  }
  for (Iterator<EPair> it=G.getEdges().getContents().iterator(); it.hasNext(); ) {
    EPair p=it.next();
    result.addEdge(p.getX(),p.getY());
  }
  return result;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static ECallGraphWrapper load(String fileName,ClassLoader loader) throws IllegalArgumentException {
  ECallGraph G=loadFromFile(fileName,loader);
  Assertions.productionAssertion(G != null);
  ECallGraphWrapper result=new ECallGraphWrapper();
  for (Iterator<EPair> it=G.getNodes().getContents().iterator(); it.hasNext(); ) {
    result.addNode(it.next());
  }
  for (Iterator<EPair> it=G.getEdges().getContents().iterator(); it.hasNext(); ) {
    EPair p=it.next();
    result.addEdge(p.getX(),p.getY());
  }
  return result;
}
Program: 40856
Project: 40856
Buggy source:
/** 
 * @param o an EClassHierarchy
 * @return a ClassHierarchy populated according to the contents of o
 */
@SuppressWarnings("String_Node_Str") public static EClassHierarchyWrapper load(EObject o){
  EClassHierarchy cha=(EClassHierarchy)o;
  Assertions.productionAssertion(cha != null);
  EClassHierarchyWrapper result=new EClassHierarchyWrapper();
  for (Iterator<EObject> it=cha.getNodes().getContents().iterator(); it.hasNext(); ) {
    result.addNode(it.next());
  }
  for (Iterator it=cha.getEdges().getContents().iterator(); it.hasNext(); ) {
    EPair p=(EPair)it.next();
    result.addEdge(p.getX(),p.getY());
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @param o an EClassHierarchy
 * @return a ClassHierarchy populated according to the contents of o
 */
@SuppressWarnings("String_Node_Str") public static EClassHierarchyWrapper load(EClassHierarchy cha){
  Assertions.productionAssertion(cha != null);
  EClassHierarchyWrapper result=new EClassHierarchyWrapper();
  for (Iterator<EObject> it=cha.getNodes().getContents().iterator(); it.hasNext(); ) {
    result.addNode(it.next());
  }
  for (Iterator it=cha.getEdges().getContents().iterator(); it.hasNext(); ) {
    EPair p=(EPair)it.next();
    result.addEdge(p.getX(),p.getY());
  }
  return result;
}
Program: 40857
Project: 40857
Buggy source:
/** 
 * TODO: refactor
 */
@SuppressWarnings("String_Node_Str") public static EInterfaceHierarchyWrapper load(EObject o){
  EInterfaceHierarchy h=(EInterfaceHierarchy)o;
  Assertions.productionAssertion(h != null);
  EInterfaceHierarchyWrapper result=new EInterfaceHierarchyWrapper();
  for (Iterator<EObject> it=h.getNodes().getContents().iterator(); it.hasNext(); ) {
    result.addNode(it.next());
  }
  for (Iterator it=h.getEdges().getContents().iterator(); it.hasNext(); ) {
    EPair p=(EPair)it.next();
    result.addEdge(p.getX(),p.getY());
  }
  return result;
}

Fixed version (ground truth):
/** 
 * TODO: refactor
 */
@SuppressWarnings("String_Node_Str") public static EInterfaceHierarchyWrapper load(EInterfaceHierarchy h){
  Assertions.productionAssertion(h != null);
  EInterfaceHierarchyWrapper result=new EInterfaceHierarchyWrapper();
  for (Iterator<EObject> it=h.getNodes().getContents().iterator(); it.hasNext(); ) {
    result.addNode(it.next());
  }
  for (Iterator it=h.getEdges().getContents().iterator(); it.hasNext(); ) {
    EPair p=(EPair)it.next();
    result.addEdge(p.getX(),p.getY());
  }
  return result;
}
Program: 40858
Project: 40858
Buggy source:
/** 
 * @param xmlFile an xml file
 * @return List<EObject> serialized in said file.
 */
public static List<EObject> readEObjects(String xmlFile,ClassLoader loader){
}

Fixed version (ground truth):
/** 
 * @param xmlFile an xml file
 * @return List<EObject> serialized in said file.
 */
public static List<EObject> readEObjects(String xmlFile,ClassLoader loader) throws WalaException {
  URL url=loader.getResource(xmlFile);
  URI fileURI=null;
  if (url != null) {
    fileURI=URI.createURI(url.toString());
  }
 else {
    fileURI=URI.createFileURI(xmlFile);
  }
  URIConverter converter=getURIConverter();
  ResourceSet resourceSet=new ResourceSetImpl();
  resourceSet.setURIConverter(converter);
  Resource resource=resourceSet.createResource(fileURI);
  try {
    resource.load(null);
  }
 catch (  IOException e) {
    throw new WalaException("String_Node_Str" + xmlFile + "String_Node_Str",e);
  }
  return resource.getContents();
}
Program: 40859
Project: 40859
Buggy source:
public SSAInstruction copyForSSA(int[] defs,int[] uses){
  return new SSAComparisonInstruction(opcode,defs == null || defs.length == 0 ? result : defs[0],uses == null ? val1 : uses[0],uses == null ? val2 : uses[1]);
}

Fixed version (ground truth):
public SSAInstruction copyForSSA(int[] defs,int[] uses){
  return new SSAComparisonInstruction(opcode,defs == null || defs.length == 0 ? result : defs[0],uses == null || uses.length == 0 ? val1 : uses[0],uses == null ? val2 : uses[1]);
}
Program: 40860
Project: 40860
Buggy source:
public SSAInstruction copyForSSA(int[] defs,int[] uses){
  return new SSAGetCaughtExceptionInstruction(bbNumber,defs == null ? exceptionValueNumber : defs[0]);
}

Fixed version (ground truth):
public SSAInstruction copyForSSA(int[] defs,int[] uses){
  return new SSAGetCaughtExceptionInstruction(bbNumber,defs == null || defs.length == 0 ? exceptionValueNumber : defs[0]);
}
Program: 40861
Project: 40861
Buggy source:
/** 
 * Method getUse.
 * @param j
 * @return value number representing the jth use in this instruction. -1 meansTOP (i.e., the value doesn't matter)
 */
public int getUse(int j){
  Assertions.UNREACHABLE();
  return -1;
}

Fixed version (ground truth):
/** 
 * Method getUse.
 * @param j
 * @return value number representing the jth use in this instruction. -1 meansTOP (i.e., the value doesn't matter)
 */
public int getUse(int j) throws UnsupportedOperationException {
  throw new UnsupportedOperationException();
}
Program: 40862
Project: 40862
Buggy source:
public ExplodedSupergraph(ISupergraph<T,?> supergraph,IFlowFunctionMap flowFunctions){
  this.supergraph=supergraph;
  this.flowFunctions=flowFunctions;
}

Fixed version (ground truth):
public ExplodedSupergraph(ISupergraph<T,?> supergraph,IFlowFunctionMap<T> flowFunctions){
  this.supergraph=supergraph;
  this.flowFunctions=flowFunctions;
}
Program: 40864
Project: 40864
Buggy source:
public Iterator<ExplodedSupergraphNode<T>> getSuccNodes(ExplodedSupergraphNode<T> node){
  T src=node.getSupergraphNode();
  HashSet<ExplodedSupergraphNode<T>> result=HashSetFactory.make(supergraph.getSuccNodeCount(src));
  for (Iterator<? extends T> it=supergraph.getSuccNodes(src); it.hasNext(); ) {
    T dest=it.next();
    if (supergraph.classifyEdge(src,dest) != ISupergraph.RETURN_EDGE) {
      IUnaryFlowFunction f=(IUnaryFlowFunction)getFlowFunction(src,dest);
      IntSet targets=f.getTargets(node.getFact());
      if (targets != null) {
        for (IntIterator ii=targets.intIterator(); ii.hasNext(); ) {
          int t=ii.next();
          result.add(new ExplodedSupergraphNode<T>(dest,t));
        }
      }
    }
 else {
      for (Iterator it2=supergraph.getCallSites(dest); it2.hasNext(); ) {
        Object callBlock=it2.next();
        IUnaryFlowFunction f=(IUnaryFlowFunction)flowFunctions.getReturnFlowFunction(callBlock,src,dest);
        IntSet targets=f.getTargets(node.getFact());
        if (targets != null) {
          for (IntIterator ii=targets.intIterator(); ii.hasNext(); ) {
            int t=ii.next();
            result.add(new ExplodedSupergraphNode<T>(dest,t));
          }
        }
      }
    }
  }
  return result.iterator();
}

Fixed version (ground truth):
public Iterator<ExplodedSupergraphNode<T>> getSuccNodes(ExplodedSupergraphNode<T> node){
  T src=node.getSupergraphNode();
  HashSet<ExplodedSupergraphNode<T>> result=HashSetFactory.make(supergraph.getSuccNodeCount(src));
  for (Iterator<? extends T> it=supergraph.getSuccNodes(src); it.hasNext(); ) {
    T dest=it.next();
    if (supergraph.classifyEdge(src,dest) != ISupergraph.RETURN_EDGE) {
      IUnaryFlowFunction f=(IUnaryFlowFunction)getFlowFunction(src,dest);
      IntSet targets=f.getTargets(node.getFact());
      if (targets != null) {
        for (IntIterator ii=targets.intIterator(); ii.hasNext(); ) {
          int t=ii.next();
          result.add(new ExplodedSupergraphNode<T>(dest,t));
        }
      }
    }
 else {
      for (Iterator<? extends T> it2=supergraph.getCallSites(dest); it2.hasNext(); ) {
        T callBlock=it2.next();
        IUnaryFlowFunction f=(IUnaryFlowFunction)flowFunctions.getReturnFlowFunction(callBlock,src,dest);
        IntSet targets=f.getTargets(node.getFact());
        if (targets != null) {
          for (IntIterator ii=targets.intIterator(); ii.hasNext(); ) {
            int t=ii.next();
            result.add(new ExplodedSupergraphNode<T>(dest,t));
          }
        }
      }
    }
  }
  return result.iterator();
}
Program: 40865
Project: 40865
Buggy source:
/** 
 * @param supergraph
 * @param flowFunctions
 * @param solver
 */
public ExplodedSupergraphWithSummaryEdges(ISupergraph<T,?> supergraph,IFlowFunctionMap flowFunctions,TabulationSolver<T,?> solver){
  super(supergraph,flowFunctions);
  this.solver=solver;
}

Fixed version (ground truth):
/** 
 * @param supergraph
 * @param flowFunctions
 * @param solver
 */
public ExplodedSupergraphWithSummaryEdges(ISupergraph<T,?> supergraph,IFlowFunctionMap<T> flowFunctions,TabulationSolver<T,?> solver){
  super(supergraph,flowFunctions);
  this.solver=solver;
}
Program: 40866
Project: 40866
Buggy source:
/** 
 * @param src
 * @param dest
 * @return the flow function for a "call-to-return" edge in the supergraphfrom src->dest, when the supergraph does not contain any callees of src. This happens via, e.g., slicing.
 */
public IUnaryFlowFunction getCallNoneToReturnFlowFunction(Object src,Object dest);

Fixed version (ground truth):
/** 
 * @param src
 * @param dest
 * @return the flow function for a "call-to-return" edge in the supergraphfrom src->dest, when the supergraph does not contain any callees of src. This happens via, e.g., slicing.
 */
public IUnaryFlowFunction getCallNoneToReturnFlowFunction(T src,T dest);
Program: 40867
Project: 40867
Buggy source:
/** 
 * @param call supergraph node of the call instruction for this return edge.
 * @param src
 * @param dest
 * @return the flow function for a "return" edge in the supergraph fromsrc->dest
 */
public IFlowFunction getReturnFlowFunction(Object call,Object src,Object dest);

Fixed version (ground truth):
/** 
 * @param call supergraph node of the call instruction for this return edge.
 * @param src
 * @param dest
 * @return the flow function for a "return" edge in the supergraph fromsrc->dest
 */
public IFlowFunction getReturnFlowFunction(T call,T src,T dest);
Program: 40868
Project: 40868
Buggy source:
/** 
 * @param src
 * @param dest
 * @return the flow function for a "call" edge in the supergraph fromsrc->dest
 */
public IUnaryFlowFunction getCallFlowFunction(Object src,Object dest);

Fixed version (ground truth):
/** 
 * @param src
 * @param dest
 * @return the flow function for a "call" edge in the supergraph fromsrc->dest
 */
public IUnaryFlowFunction getCallFlowFunction(T src,T dest);
Program: 40869
Project: 40869
Buggy source:
/** 
 * @param src
 * @param dest
 * @return the flow function for a "normal" edge in the supergraph fromsrc->dest
 */
public IUnaryFlowFunction getNormalFlowFunction(Object src,Object dest);

Fixed version (ground truth):
/** 
 * @param src
 * @param dest
 * @return the flow function for a "normal" edge in the supergraph fromsrc->dest
 */
public IUnaryFlowFunction getNormalFlowFunction(T src,T dest);
Program: 40870
Project: 40870
Buggy source:
/** 
 * @param src
 * @param dest
 * @return the flow function for a "call-to-return" edge in the supergraphfrom src->dest
 */
public IUnaryFlowFunction getCallToReturnFlowFunction(Object src,Object dest);

Fixed version (ground truth):
/** 
 * @param src
 * @param dest
 * @return the flow function for a "call-to-return" edge in the supergraphfrom src->dest
 */
public IUnaryFlowFunction getCallToReturnFlowFunction(T src,T dest);
Program: 40871
Project: 40871
Buggy source:
public static IdentityFlowFunctions singleton(){
  return SINGLETON;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static <T>IdentityFlowFunctions<T> singleton(){
  return SINGLETON;
}
Program: 40872
Project: 40872
Buggy source:
public IFlowFunctionMap getFunctionMap();

Fixed version (ground truth):
public IFlowFunctionMap<T> getFunctionMap();
Program: 40873
Project: 40873
Buggy source:
public IUnaryFlowFunction getCallNoneToReturnFlowFunction(Object src,Object dest){
  Statement s=(Statement)src;
switch (s.getKind()) {
case NORMAL_RET_CALLER:
case PARAM_CALLER:
    return ReachabilityFunctions.killReachability;
case HEAP_PARAM_CALLEE:
case HEAP_PARAM_CALLER:
case HEAP_RET_CALLEE:
case HEAP_RET_CALLER:
  if (dest instanceof HeapStatement) {
    HeapStatement hd=(HeapStatement)dest;
    HeapStatement hs=(HeapStatement)src;
    if (hs.getLocation().equals(hd.getLocation())) {
      return IdentityFlowFunction.identity();
    }
 else {
      return ReachabilityFunctions.killReachability;
    }
  }
 else {
    return ReachabilityFunctions.killReachability;
  }
default :
Assertions.UNREACHABLE(s.getKind().toString());
return null;
}
}

Fixed version (ground truth):
public IUnaryFlowFunction getCallNoneToReturnFlowFunction(Statement src,Statement dest){
  Statement s=(Statement)src;
switch (s.getKind()) {
case NORMAL_RET_CALLER:
case PARAM_CALLER:
    return ReachabilityFunctions.killReachability;
case HEAP_PARAM_CALLEE:
case HEAP_PARAM_CALLER:
case HEAP_RET_CALLEE:
case HEAP_RET_CALLER:
  if (dest instanceof HeapStatement) {
    HeapStatement hd=(HeapStatement)dest;
    HeapStatement hs=(HeapStatement)src;
    if (hs.getLocation().equals(hd.getLocation())) {
      return IdentityFlowFunction.identity();
    }
 else {
      return ReachabilityFunctions.killReachability;
    }
  }
 else {
    return ReachabilityFunctions.killReachability;
  }
default :
Assertions.UNREACHABLE(s.getKind().toString());
return null;
}
}
Program: 40874
Project: 40874
Buggy source:
public IFlowFunction getReturnFlowFunction(Object call,Object src,Object dest){
  return ReachabilityFunctions.singleton().getReturnFlowFunction(call,src,dest);
}

Fixed version (ground truth):
public IFlowFunction getReturnFlowFunction(Statement call,Statement src,Statement dest){
  return ReachabilityFunctions.singleton().getReturnFlowFunction(call,src,dest);
}
Program: 40875
Project: 40875
Buggy source:
public IUnaryFlowFunction getCallFlowFunction(Object src,Object dest){
  return ReachabilityFunctions.singleton().getCallFlowFunction(src,dest);
}

Fixed version (ground truth):
public IUnaryFlowFunction getCallFlowFunction(Statement src,Statement dest){
  return ReachabilityFunctions.singleton().getCallFlowFunction(src,dest);
}
Program: 40876
Project: 40876
Buggy source:
public IUnaryFlowFunction getNormalFlowFunction(Object src,Object dest){
  return ReachabilityFunctions.singleton().getNormalFlowFunction(src,dest);
}

Fixed version (ground truth):
public IUnaryFlowFunction getNormalFlowFunction(Statement src,Statement dest){
  return ReachabilityFunctions.singleton().getNormalFlowFunction(src,dest);
}
Program: 40877
Project: 40877
Buggy source:
public IUnaryFlowFunction getCallToReturnFlowFunction(Object src,Object dest){
  return ReachabilityFunctions.singleton().getCallToReturnFlowFunction(src,dest);
}

Fixed version (ground truth):
public IUnaryFlowFunction getCallToReturnFlowFunction(Statement src,Statement dest){
  return ReachabilityFunctions.singleton().getCallToReturnFlowFunction(src,dest);
}
Program: 40878
Project: 40878
Buggy source:
public IFlowFunctionMap getFunctionMap(){
  return f;
}

Fixed version (ground truth):
public IFlowFunctionMap<Statement> getFunctionMap(){
  return f;
}
Program: 40879
Project: 40879
Buggy source:
/** 
 * Method newPhi.
 * @param rhs
 * @return int
 */
public int newPhi(int[] rhs){
  int result=getNewValueNumber();
  SSAPhiInstruction phi=new SSAPhiInstruction(result,(int[])rhs.clone());
  values[result]=new PhiValue(phi);
  return result;
}

Fixed version (ground truth):
/** 
 * Method newPhi.
 * @param rhs
 * @return int
 */
public int newPhi(int[] rhs) throws IllegalArgumentException {
  int result=getNewValueNumber();
  SSAPhiInstruction phi=new SSAPhiInstruction(result,(int[])rhs.clone());
  values[result]=new PhiValue(phi);
  return result;
}
Program: 40880
Project: 40880
Buggy source:
public static IWorkspace getWorkspace(){
  return ResourcesPlugin.getWorkspace();
}

Fixed version (ground truth):
/** 
 * @return null if there's a problem
 */
public static IWorkspace getWorkspace(){
  try {
    return ResourcesPlugin.getWorkspace();
  }
 catch (  Throwable t) {
    return null;
  }
}
Program: 40881
Project: 40881
Buggy source:
/** 
 * Add allocation statements to the fake root method for each possible value of parameter i. If necessary, add a phi to combine the values.
 * @param m
 * @param i
 * @return value number holding the parameter to the call; -1 if there wassome error
 */
protected int makeArgument(FakeRootMethod m,int i,WarningSet warnings){
  TypeReference[] p=getParameterTypes(i);
  if (p.length == 1) {
    SSANewInstruction n=m.addAllocation(p[0],warnings);
    return (n == null) ? -1 : n.getDef();
  }
 else {
    int[] values=new int[p.length];
    int countErrors=0;
    for (int j=0; j < p.length; j++) {
      SSANewInstruction n=m.addAllocation(p[j],warnings);
      int value=(n == null) ? -1 : n.getDef();
      if (value == -1) {
        countErrors++;
      }
 else {
        values[j - countErrors]=value;
      }
    }
    if (countErrors > 0) {
      int[] oldValues=values;
      values=new int[oldValues.length - countErrors];
      System.arraycopy(oldValues,0,values,0,values.length);
    }
    return m.addPhi(values);
  }
}

Fixed version (ground truth):
/** 
 * Add allocation statements to the fake root method for each possible value of parameter i. If necessary, add a phi to combine the values.
 * @param m
 * @param i
 * @return value number holding the parameter to the call; -1 if there wassome error
 */
protected int makeArgument(FakeRootMethod m,int i,WarningSet warnings){
  TypeReference[] p=getParameterTypes(i);
  if (p.length == 0) {
    return -1;
  }
 else   if (p.length == 1) {
    SSANewInstruction n=m.addAllocation(p[0],warnings);
    return (n == null) ? -1 : n.getDef();
  }
 else {
    int[] values=new int[p.length];
    int countErrors=0;
    for (int j=0; j < p.length; j++) {
      SSANewInstruction n=m.addAllocation(p[j],warnings);
      int value=(n == null) ? -1 : n.getDef();
      if (value == -1) {
        countErrors++;
      }
 else {
        values[j - countErrors]=value;
      }
    }
    if (countErrors > 0) {
      int[] oldValues=values;
      values=new int[oldValues.length - countErrors];
      System.arraycopy(oldValues,0,values,0,values.length);
    }
    return m.addPhi(values);
  }
}
Program: 40882
Project: 40882
Buggy source:
/** 
 * Add a call to this entrypoint from the fake root method
 * @param m the Fake Root Method
 * @return the call instruction added, or null if the operation fails
 */
public SSAAbstractInvokeInstruction addCall(FakeRootMethod m,WarningSet warnings){
  int paramValues[];
  CallSiteReference site=makeSite(0);
  if (site == null) {
    return null;
  }
  paramValues=new int[getNumberOfParameters()];
  for (int j=0; j < paramValues.length; j++) {
    paramValues[j]=makeArgument(m,j,warnings);
  }
  return m.addInvocation(paramValues,site);
}

Fixed version (ground truth):
/** 
 * Add a call to this entrypoint from the fake root method
 * @param m the Fake Root Method
 * @return the call instruction added, or null if the operation fails
 */
public SSAAbstractInvokeInstruction addCall(FakeRootMethod m,WarningSet warnings){
  int paramValues[];
  CallSiteReference site=makeSite(0);
  if (site == null) {
    return null;
  }
  paramValues=new int[getNumberOfParameters()];
  for (int j=0; j < paramValues.length; j++) {
    paramValues[j]=makeArgument(m,j,warnings);
    if (paramValues[j] == -1) {
      return null;
    }
  }
  return m.addInvocation(paramValues,site);
}
Program: 40883
Project: 40883
Buggy source:
/** 
 * @param method
 */
protected TypeReference[][] makeParameterTypes(IMethod method){
  TypeReference[][] result=new TypeReference[method.getNumberOfParameters()][];
  for (int i=0; i < result.length; i++) {
    TypeReference t=method.getParameterType(i);
    IClass klass=cha.lookupClass(t);
    if (klass == null) {
      t=null;
    }
 else     if (klass.isAbstract()) {
      t=chooseAConcreteSubClass(klass);
    }
 else     if (klass.isInterface()) {
      t=chooseAnImplementor(klass);
    }
 else     if (klass.isArrayClass()) {
      ArrayClass arrayKlass=(ArrayClass)klass;
      IClass innermost=arrayKlass.getInnermostElementClass();
      if (innermost != null && innermost.isInterface()) {
        TypeReference impl=chooseAnImplementor(innermost);
        if (impl == null) {
          t=null;
        }
 else {
          t=TypeReference.findOrCreateArrayOf(impl);
          for (int dim=1; dim < arrayKlass.getDimensionality(); dim++) {
            t=TypeReference.findOrCreateArrayOf(t);
          }
        }
      }
    }
    result[i]=(t == null) ? new TypeReference[0] : new TypeReference[]{t};
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @param method
 */
protected TypeReference[][] makeParameterTypes(IMethod method){
  TypeReference[][] result=new TypeReference[method.getNumberOfParameters()][];
  for (int i=0; i < result.length; i++) {
    TypeReference t=method.getParameterType(i);
    if (!t.isPrimitiveType()) {
      IClass klass=cha.lookupClass(t);
      if (klass == null) {
        t=null;
      }
 else       if (klass.isAbstract()) {
        t=chooseAConcreteSubClass(klass);
      }
 else       if (klass.isInterface()) {
        t=chooseAnImplementor(klass);
      }
 else       if (klass.isArrayClass()) {
        ArrayClass arrayKlass=(ArrayClass)klass;
        IClass innermost=arrayKlass.getInnermostElementClass();
        if (innermost != null && innermost.isInterface()) {
          TypeReference impl=chooseAnImplementor(innermost);
          if (impl == null) {
            t=null;
          }
 else {
            t=TypeReference.findOrCreateArrayOf(impl);
            for (int dim=1; dim < arrayKlass.getDimensionality(); dim++) {
              t=TypeReference.findOrCreateArrayOf(t);
            }
          }
        }
      }
    }
    result[i]=(t == null) ? new TypeReference[0] : new TypeReference[]{t};
  }
  return result;
}
Program: 40884
Project: 40884
Buggy source:
public TypeName getRawName(){
  String s=rawString().substring(0,rawString().length() - 1);
  s=s.replaceAll("String_Node_Str","String_Node_Str");
  return TypeName.string2TypeName(s);
}

Fixed version (ground truth):
/** 
 * Return the name of the raw type for this signature
 */
public TypeName getRawName(){
  StringBuffer s=new StringBuffer();
  StringTokenizer t=new StringTokenizer(rawString(),"String_Node_Str");
  while (t.hasMoreTokens()) {
    String x=t.nextToken();
    s.append(x.replaceAll("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str"));
    if (t.hasMoreElements()) {
      s.append('$');
    }
  }
  return TypeName.string2TypeName(s.toString());
}
Program: 40886
Project: 40886
Buggy source:
public static void deleteContents(String directory) throws WalaException {
  Collection fl=listFiles(directory,null,true);
  for (Iterator it=fl.iterator(); it.hasNext(); ) {
    File f=(File)it.next();
    if (!f.isDirectory()) {
      f.delete();
    }
  }
  Collection f2=listFiles(directory,null,true);
  for (Iterator it=f2.iterator(); it.hasNext(); ) {
    File f=(File)it.next();
    f.delete();
  }
}

Fixed version (ground truth):
/** 
 * delete all files (recursively) in a directory. This is dangerous. Use with care.
 */
public static void deleteContents(String directory) throws WalaException {
  Collection fl=listFiles(directory,null,true);
  for (Iterator it=fl.iterator(); it.hasNext(); ) {
    File f=(File)it.next();
    if (!f.isDirectory()) {
      f.delete();
    }
  }
  do {
    Collection f2=listFiles(directory,null,true);
    for (Iterator it=f2.iterator(); it.hasNext(); ) {
      File f=(File)it.next();
      f.delete();
    }
  }
 while (listFiles(directory,null,true).size() > 0);
}
Program: 40887
Project: 40887
Buggy source:
public TypeArgument[] getTypeArguments(){
  if (rawString().indexOf('<') == -1) {
    return null;
  }
 else {
    int start=rawString().indexOf('<');
    int end=endOfTypeArguments();
    return TypeArgument.make(rawString().substring(start,end));
  }
}

Fixed version (ground truth):
public TypeArgument[] getTypeArguments(){
  int lastDot=rawString().lastIndexOf('.');
  if (rawString().indexOf('<',lastDot) == -1) {
    return null;
  }
 else {
    int start=rawString().indexOf('<',lastDot);
    int end=endOfTypeArguments();
    return TypeArgument.make(rawString().substring(start,end));
  }
}
Program: 40888
Project: 40888
Buggy source:
private int endOfTypeArguments(){
  int i=rawString().indexOf('<') + 1;
  assert(i > 0);
  int depth=1;
  while (depth > 0) {
    if (rawString().charAt(i) == '>') {
      depth--;
    }
    if (rawString().charAt(i) == '<') {
      depth++;
    }
    i++;
  }
  return i;
}

Fixed version (ground truth):
private int endOfTypeArguments(){
  int lastDot=rawString().lastIndexOf('.');
  int i=rawString().indexOf('<',lastDot) + 1;
  assert(i > 0);
  int depth=1;
  while (depth > 0) {
    if (rawString().charAt(i) == '>') {
      depth--;
    }
    if (rawString().charAt(i) == '<') {
      depth++;
    }
    i++;
  }
  return i;
}
Program: 40889
Project: 40889
Buggy source:
private static TypeArgument makeTypeArgument(String s){
switch (s.charAt(0)) {
case '*':
    return WILDCARD;
case '+':
case '-':
  Assertions.UNREACHABLE();
return null;
default :
TypeSignature sig=TypeSignature.make(s);
return new TypeArgument(sig);
}
}

Fixed version (ground truth):
private static TypeArgument makeTypeArgument(String s){
switch (s.charAt(0)) {
case '*':
    return WILDCARD;
case '+':
{
    TypeSignature sig=TypeSignature.make(s.substring(1));
    return new TypeArgument(sig,WildcardIndicator.PLUS);
  }
case '-':
{
  TypeSignature sig=TypeSignature.make(s.substring(1));
  return new TypeArgument(sig,WildcardIndicator.MINUS);
}
default :
TypeSignature sig=TypeSignature.make(s);
return new TypeArgument(sig,null);
}
}
Program: 40890
Project: 40890
Buggy source:
/** 
 * @param typeSigs Strin TypeSignature
 * @return tokenize it
 */
static String[] parseForTypeArguments(String typeArgs){
  ArrayList<String> args=new ArrayList<String>(10);
  int i=1;
  while (true) {
switch (typeArgs.charAt(i++)) {
case TypeReference.ClassTypeCode:
{
        int off=i - 1;
        int depth=0;
        while (typeArgs.charAt(i++) != ';' || depth > 0) {
          if (typeArgs.charAt(i - 1) == '<') {
            depth++;
          }
          if (typeArgs.charAt(i - 1) == '>') {
            depth--;
          }
        }
        args.add(typeArgs.substring(off,i));
        continue;
      }
case TypeReference.ArrayTypeCode:
{
      int off=i - 1;
      while (typeArgs.charAt(i) == TypeReference.ArrayTypeCode) {
        ++i;
      }
      if (typeArgs.charAt(i++) == TypeReference.ClassTypeCode) {
        while (typeArgs.charAt(i++) != ';')         ;
        args.add(typeArgs.substring(off,i - off - 1));
      }
 else {
        args.add(typeArgs.substring(off,i - off));
      }
      continue;
    }
case (byte)'T':
{
    int off=i - 1;
    while (typeArgs.charAt(i++) != ';')     ;
    args.add(typeArgs.substring(off,i));
    continue;
  }
case (byte)'>':
int size=args.size();
if (size == 0) {
return null;
}
Iterator<String> it=args.iterator();
String[] result=new String[size];
for (int j=0; j < size; j++) {
result[j]=it.next();
}
return result;
default :
if (Assertions.verifyAssertions) {
Assertions._assert(false,"String_Node_Str" + typeArgs);
}
}
}
}

Fixed version (ground truth):
/** 
 * @param typeSigs TypeSignature
 * @return tokenize it
 */
static String[] parseForTypeArguments(String typeArgs){
  ArrayList<String> args=new ArrayList<String>(10);
  int i=1;
  while (true) {
switch (typeArgs.charAt(i++)) {
case TypeReference.ClassTypeCode:
{
        int off=i - 1;
        int depth=0;
        while (typeArgs.charAt(i++) != ';' || depth > 0) {
          if (typeArgs.charAt(i - 1) == '<') {
            depth++;
          }
          if (typeArgs.charAt(i - 1) == '>') {
            depth--;
          }
        }
        args.add(typeArgs.substring(off,i));
        continue;
      }
case TypeReference.ArrayTypeCode:
{
      int off=i - 1;
      while (typeArgs.charAt(i) == TypeReference.ArrayTypeCode) {
        ++i;
      }
      if (typeArgs.charAt(i++) == TypeReference.ClassTypeCode) {
        while (typeArgs.charAt(i++) != ';')         ;
        args.add(typeArgs.substring(off,i - off - 1));
      }
 else {
        args.add(typeArgs.substring(off,i - off));
      }
      continue;
    }
case (byte)'+':
case (byte)'T':
{
    int off=i - 1;
    while (typeArgs.charAt(i++) != ';')     ;
    args.add(typeArgs.substring(off,i));
    continue;
  }
case (byte)'>':
int size=args.size();
if (size == 0) {
return null;
}
Iterator<String> it=args.iterator();
String[] result=new String[size];
for (int j=0; j < size; j++) {
result[j]=it.next();
}
return result;
default :
if (Assertions.verifyAssertions) {
Assertions._assert(false,"String_Node_Str" + typeArgs);
}
}
}
}
Program: 40891
Project: 40891
Buggy source:
private TypeArgument(TypeSignature sig){
  super(sig.rawString());
  this.sig=sig;
}

Fixed version (ground truth):
private TypeArgument(TypeSignature sig,WildcardIndicator w){
  super(sig.rawString());
  this.sig=sig;
  this.w=w;
}
Program: 40892
Project: 40892
Buggy source:
/** 
 * @param s a string that holds a sequence of formal type parameters beginningat index begin
 * @return the index where the next formal type parameter ends (actually, end +1)
 */
static int formalTypeParameterEnds(String s,int begin){
  int result=begin;
  while (s.charAt(result) != ':') {
    result++;
  }
  do {
    assert(s.charAt(result) == ':');
switch (s.charAt(++result)) {
case TypeReference.ClassTypeCode:
{
        while (s.charAt(result++) != ';')         ;
        break;
      }
case ':':
    break;
default :
  if (Assertions.verifyAssertions) {
    Assertions._assert(false,"String_Node_Str" + s + "String_Node_Str"+ (result - 1));
  }
}
}
 while (s.charAt(result) == ':');
return result;
}

Fixed version (ground truth):
/** 
 * @param s a string that holds a sequence of formal type parameters beginningat index begin
 * @return the index where the next formal type parameter ends (actually, end +1)
 */
static int formalTypeParameterEnds(String s,int begin){
  int result=begin;
  while (s.charAt(result) != ':') {
    result++;
  }
  do {
    assert(s.charAt(result) == ':');
switch (s.charAt(++result)) {
case TypeReference.ClassTypeCode:
{
        int depth=0;
        while (s.charAt(result) != ';' || depth > 0) {
          if (s.charAt(result) == '<') {
            depth++;
          }
          if (s.charAt(result) == '>') {
            depth--;
          }
          result++;
        }
        result++;
        break;
      }
case ':':
    break;
default :
  if (Assertions.verifyAssertions) {
    Assertions._assert(false,"String_Node_Str" + s + "String_Node_Str"+ (result - 1));
  }
}
}
 while (s.charAt(result) == ':');
return result;
}
Program: 40894
Project: 40894
Buggy source:
/** 
 * @param v
 * @param klass
 * @return -1 if there is no match
 */
public static int getTypeVariablePosition(TypeVariableSignature v,ShrikeClass klass){
  try {
    ClassSignature sig=klass.getClassSignature();
    if (sig == null) {
      return -1;
    }
    FormalTypeParameter[] fp=sig.getFormalTypeParameters();
    if (fp == null) {
      return -1;
    }
    for (int i=0; i < fp.length; i++) {
      FormalTypeParameter f=fp[i];
      if (f.getIdentifier().equals(v.getIdentifier())) {
        return i;
      }
    }
    Assertions.UNREACHABLE();
    return -1;
  }
 catch (  InvalidClassFileException e) {
    e.printStackTrace();
    Assertions.UNREACHABLE();
    return -1;
  }
}

Fixed version (ground truth):
/** 
 * @param v
 * @param klass
 * @return -1 if there is no match
 */
public static int getTypeVariablePosition(TypeVariableSignature v,ShrikeClass klass){
  try {
    ClassSignature sig=klass.getClassSignature();
    if (sig == null) {
      return -1;
    }
    FormalTypeParameter[] fp=sig.getFormalTypeParameters();
    if (fp == null) {
      return -1;
    }
    for (int i=0; i < fp.length; i++) {
      FormalTypeParameter f=fp[i];
      if (f.getIdentifier().equals(v.getIdentifier())) {
        return i;
      }
    }
    return -1;
  }
 catch (  InvalidClassFileException e) {
    e.printStackTrace();
    Assertions.UNREACHABLE();
    return -1;
  }
}
Program: 40895
Project: 40895
Buggy source:
/** 
 * @param typeSigs TypeSignature
 * @return tokenize it
 */
static String[] parseForTypeArguments(String typeArgs){
  ArrayList<String> args=new ArrayList<String>(10);
  int i=1;
  while (true) {
switch (typeArgs.charAt(i++)) {
case TypeReference.ClassTypeCode:
{
        int off=i - 1;
        int depth=0;
        while (typeArgs.charAt(i++) != ';' || depth > 0) {
          if (typeArgs.charAt(i - 1) == '<') {
            depth++;
          }
          if (typeArgs.charAt(i - 1) == '>') {
            depth--;
          }
        }
        args.add(typeArgs.substring(off,i));
        continue;
      }
case TypeReference.ArrayTypeCode:
{
      int off=i - 1;
      while (typeArgs.charAt(i) == TypeReference.ArrayTypeCode) {
        ++i;
      }
      if (typeArgs.charAt(i++) == TypeReference.ClassTypeCode) {
        while (typeArgs.charAt(i++) != ';')         ;
        args.add(typeArgs.substring(off,i - off - 1));
      }
 else {
        args.add(typeArgs.substring(off,i - off));
      }
      continue;
    }
case (byte)'+':
case (byte)'T':
{
    int off=i - 1;
    while (typeArgs.charAt(i++) != ';')     ;
    args.add(typeArgs.substring(off,i));
    continue;
  }
case (byte)'>':
int size=args.size();
if (size == 0) {
return null;
}
Iterator<String> it=args.iterator();
String[] result=new String[size];
for (int j=0; j < size; j++) {
result[j]=it.next();
}
return result;
default :
if (Assertions.verifyAssertions) {
Assertions._assert(false,"String_Node_Str" + typeArgs);
}
}
}
}

Fixed version (ground truth):
/** 
 * @param typeSigs TypeSignature
 * @return tokenize it
 */
static String[] parseForTypeArguments(String typeArgs){
  ArrayList<String> args=new ArrayList<String>(10);
  int i=1;
  while (true) {
switch (typeArgs.charAt(i++)) {
case TypeReference.ClassTypeCode:
{
        int off=i - 1;
        int depth=0;
        while (typeArgs.charAt(i++) != ';' || depth > 0) {
          if (typeArgs.charAt(i - 1) == '<') {
            depth++;
          }
          if (typeArgs.charAt(i - 1) == '>') {
            depth--;
          }
        }
        args.add(typeArgs.substring(off,i));
        continue;
      }
case TypeReference.ArrayTypeCode:
{
      int off=i - 1;
      while (typeArgs.charAt(i) == TypeReference.ArrayTypeCode) {
        ++i;
      }
      if (typeArgs.charAt(i++) == TypeReference.ClassTypeCode) {
        while (typeArgs.charAt(i++) != ';')         ;
        args.add(typeArgs.substring(off,i - off - 1));
      }
 else {
        args.add(typeArgs.substring(off,i - off));
      }
      continue;
    }
case (byte)'+':
case (byte)'T':
{
    int off=i - 1;
    while (typeArgs.charAt(i++) != ';')     ;
    args.add(typeArgs.substring(off,i));
    continue;
  }
case (byte)'*':
{
  args.add("String_Node_Str");
  continue;
}
case (byte)'>':
int size=args.size();
if (size == 0) {
return null;
}
Iterator<String> it=args.iterator();
String[] result=new String[size];
for (int j=0; j < size; j++) {
result[j]=it.next();
}
return result;
default :
if (Assertions.verifyAssertions) {
Assertions._assert(false,"String_Node_Str" + typeArgs);
}
}
}
}
Program: 40896
Project: 40896
Buggy source:
public boolean isReturn(Statement n){
switch (n.getKind()) {
case EXC_RET_CALLER:
case NORMAL_RET_CALLER:
case HEAP_RET_CALLER:
    return true;
case EXC_RET_CALLEE:
case HEAP_PARAM_CALLEE:
case HEAP_PARAM_CALLER:
case HEAP_RET_CALLEE:
case NORMAL:
case NORMAL_RET_CALLEE:
case PARAM_CALLEE:
case PARAM_CALLER:
case PHI:
case PI:
case METHOD_ENTRY:
  return false;
default :
Assertions.UNREACHABLE(n.getKind().toString());
return false;
}
}

Fixed version (ground truth):
public boolean isReturn(Statement n){
switch (n.getKind()) {
case EXC_RET_CALLER:
case NORMAL_RET_CALLER:
case HEAP_RET_CALLER:
    return true;
case EXC_RET_CALLEE:
case HEAP_PARAM_CALLEE:
case HEAP_PARAM_CALLER:
case HEAP_RET_CALLEE:
case NORMAL:
case NORMAL_RET_CALLEE:
case PARAM_CALLEE:
case PARAM_CALLER:
case PHI:
case PI:
case METHOD_ENTRY:
case CATCH:
  return false;
default :
Assertions.UNREACHABLE(n.getKind().toString());
return false;
}
}
Program: 40897
Project: 40897
Buggy source:
public boolean isEntry(Statement n){
switch (n.getKind()) {
case PARAM_CALLEE:
case HEAP_PARAM_CALLEE:
case METHOD_ENTRY:
    return true;
case PHI:
case PI:
case NORMAL_RET_CALLER:
case PARAM_CALLER:
case HEAP_RET_CALLER:
case NORMAL:
case EXC_RET_CALLEE:
case EXC_RET_CALLER:
case HEAP_PARAM_CALLER:
case HEAP_RET_CALLEE:
case NORMAL_RET_CALLEE:
  return false;
default :
Assertions.UNREACHABLE();
return false;
}
}

Fixed version (ground truth):
public boolean isEntry(Statement n){
switch (n.getKind()) {
case PARAM_CALLEE:
case HEAP_PARAM_CALLEE:
case METHOD_ENTRY:
    return true;
case PHI:
case PI:
case NORMAL_RET_CALLER:
case PARAM_CALLER:
case HEAP_RET_CALLER:
case NORMAL:
case EXC_RET_CALLEE:
case EXC_RET_CALLER:
case HEAP_PARAM_CALLER:
case HEAP_RET_CALLEE:
case NORMAL_RET_CALLEE:
case CATCH:
  return false;
default :
Assertions.UNREACHABLE(n.toString());
return false;
}
}
Program: 40898
Project: 40898
Buggy source:
public boolean isCall(Statement n){
switch (n.getKind()) {
case EXC_RET_CALLEE:
case EXC_RET_CALLER:
case HEAP_PARAM_CALLEE:
case NORMAL_RET_CALLEE:
case NORMAL_RET_CALLER:
case PARAM_CALLEE:
case PHI:
case HEAP_RET_CALLEE:
case HEAP_RET_CALLER:
    return false;
case HEAP_PARAM_CALLER:
case PARAM_CALLER:
  return true;
case NORMAL:
if (sdg.getCOptions().equals(ControlDependenceOptions.NONE)) {
  return false;
}
 else {
  NormalStatement s=(NormalStatement)n;
  return s.getInstruction() instanceof SSAAbstractInvokeInstruction;
}
default :
Assertions.UNREACHABLE();
return false;
}
}

Fixed version (ground truth):
public boolean isCall(Statement n){
switch (n.getKind()) {
case EXC_RET_CALLEE:
case EXC_RET_CALLER:
case HEAP_PARAM_CALLEE:
case NORMAL_RET_CALLEE:
case NORMAL_RET_CALLER:
case PARAM_CALLEE:
case PHI:
case HEAP_RET_CALLEE:
case HEAP_RET_CALLER:
case METHOD_ENTRY:
    return false;
case HEAP_PARAM_CALLER:
case PARAM_CALLER:
  return true;
case NORMAL:
if (sdg.getCOptions().equals(ControlDependenceOptions.NONE)) {
  return false;
}
 else {
  NormalStatement s=(NormalStatement)n;
  return s.getInstruction() instanceof SSAAbstractInvokeInstruction;
}
default :
Assertions.UNREACHABLE(n.toString());
return false;
}
}
Program: 40899
Project: 40899
Buggy source:
public boolean isExit(Statement n){
switch (n.getKind()) {
case PARAM_CALLEE:
case HEAP_PARAM_CALLEE:
case PHI:
case NORMAL_RET_CALLER:
case PARAM_CALLER:
case HEAP_RET_CALLER:
case NORMAL:
case EXC_RET_CALLER:
    return false;
case HEAP_RET_CALLEE:
case EXC_RET_CALLEE:
case NORMAL_RET_CALLEE:
  return true;
default :
Assertions.UNREACHABLE();
return false;
}
}

Fixed version (ground truth):
public boolean isExit(Statement n){
switch (n.getKind()) {
case PARAM_CALLEE:
case HEAP_PARAM_CALLEE:
case PHI:
case NORMAL_RET_CALLER:
case PARAM_CALLER:
case HEAP_RET_CALLER:
case NORMAL:
case EXC_RET_CALLER:
case METHOD_ENTRY:
    return false;
case HEAP_RET_CALLEE:
case EXC_RET_CALLEE:
case NORMAL_RET_CALLEE:
  return true;
default :
Assertions.UNREACHABLE(n.toString());
return false;
}
}
Program: 40900
Project: 40900
Buggy source:
public int getMappedIndex(T o){
  return offset + delegate.getMappedIndex(o);
}

Fixed version (ground truth):
public int getMappedIndex(T o){
  if (delegate.getMappedIndex(o) == -1) {
    return -1;
  }
  return offset + delegate.getMappedIndex(o);
}
Program: 40901
Project: 40901
Buggy source:
private Set<ModuleEntry> getEntriesRecursive(File dir){
  Set<ModuleEntry> result=new HashSet<ModuleEntry>();
  File[] files=dir.listFiles();
  for (int i=0; i < files.length; i++) {
    if (files[i].isDirectory())     result.addAll(getEntriesRecursive(files[i]));
 else     if (includeFile(files[i]))     result.add(makeFile(files[i]));
  }
  return result;
}

Fixed version (ground truth):
private Set<ModuleEntry> getEntriesRecursive(File dir){
  Set<ModuleEntry> result=HashSetFactory.make();
  File[] files=dir.listFiles();
  if (files != null) {
    for (int i=0; i < files.length; i++) {
      if (files[i].isDirectory()) {
        result.addAll(getEntriesRecursive(files[i]));
      }
 else       if (includeFile(files[i])) {
        result.add(makeFile(files[i]));
      }
    }
  }
 else {
    Trace.println("String_Node_Str" + dir);
  }
  return result;
}
Program: 40902
Project: 40902
Buggy source:
DirectoryTreeModule(File root){
  this.root=root;
}

Fixed version (ground truth):
/** 
 * @param root a directory
 */
DirectoryTreeModule(File root){
}
Program: 40903
Project: 40903
Buggy source:
public void bar() throws BadLanguageExceptionEx1 {
  throw new BadLanguageExceptionEx1();
}

Fixed version (ground truth):
public void bar(){
  throw new NullPointerException();
}
Program: 40904
Project: 40904
Buggy source:
public static void main(String[] args){
  Exception1 e1=new Exception1();
  try {
    FooEx1 f=new FooEx1();
    f.bar();
  }
 catch (  BadLanguageExceptionEx1 e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  Exception1 e1=new Exception1();
  try {
    FooEx1 f=new FooEx1();
    f.bar();
  }
 catch (  BadLanguageExceptionEx1 e) {
    e.printStackTrace();
  }
  try {
    FooEx2 f=new FooEx2();
    f.bar();
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}
Program: 40905
Project: 40905
Buggy source:
private void setCatchInstructions(SSACFG ssacfg,AbstractCFG oldcfg){
  for (int i=0; i < oldcfg.getNumberOfNodes(); i++)   if (oldcfg.isCatchBlock(i)) {
    ExceptionHandlerBasicBlock B=(ExceptionHandlerBasicBlock)ssacfg.getNode(i);
    B.setCatchInstruction((SSAGetCaughtExceptionInstruction)getInstructions()[B.getFirstInstructionIndex()]);
  }
}

Fixed version (ground truth):
private void setCatchInstructions(SSACFG ssacfg,AbstractCFG oldcfg){
  for (int i=0; i < oldcfg.getNumberOfNodes(); i++)   if (oldcfg.isCatchBlock(i)) {
    ExceptionHandlerBasicBlock B=(ExceptionHandlerBasicBlock)ssacfg.getNode(i);
    B.setCatchInstruction((SSAGetCaughtExceptionInstruction)getInstructions()[B.getFirstInstructionIndex()]);
    getInstructions()[B.getFirstInstructionIndex()]=null;
  }
}
Program: 40906
Project: 40906
Buggy source:
private AstIR(AstMethod method,SSAInstruction[] instructions,SymbolTable symbolTable,SSACFG cfg,SSAOptions options){
  super(method,instructions,symbolTable,cfg,options);
  setCatchInstructions(getControlFlowGraph(),method.cfg);
  localMap=SSAConversion.convert(method,this,options);
  setupCatchTypes(getControlFlowGraph(),method.catchTypes);
  setupLocationMap();
}

Fixed version (ground truth):
private AstIR(AstMethod method,SSAInstruction[] instructions,SymbolTable symbolTable,SSACFG cfg,SSAOptions options){
  super(method,instructions,symbolTable,cfg,options);
  localMap=SSAConversion.convert(method,this,options);
  setCatchInstructions(getControlFlowGraph(),method.cfg);
  setupCatchTypes(getControlFlowGraph(),method.catchTypes);
  setupLocationMap();
}
Program: 40908
Project: 40908
Buggy source:
private static String[] getJarsInDirectory(String dir){
  File f=new File(dir);
  Assertions.productionAssertion(f.isDirectory(),"String_Node_Str" + dir);
  ArrayList<String> list=new ArrayList<String>();
  addJarFilesFromDirectory(f,list);
  String[] result=new String[list.size()];
  int i=0;
  for (Iterator<String> it=list.iterator(); it.hasNext(); ) {
    result[i++]=it.next();
  }
  return result;
}

Fixed version (ground truth):
private static String[] getJarsInDirectory(String dir){
  File f=new File(dir);
  Assertions.productionAssertion(f.isDirectory(),"String_Node_Str" + dir);
  Collection<File> col=FileUtil.listFiles(dir,"String_Node_Str",true);
  String[] result=new String[col.size()];
  int i=0;
  for (  File jarFile : col) {
    result[i++]=jarFile.getAbsolutePath();
  }
  return result;
}
Program: 40909
Project: 40909
Buggy source:
/** 
 */
public void init(){
  fakeRoot=makeFakeRootNode();
  Key k=new Key(fakeRoot.getMethod(),fakeRoot.getContext());
  registerNode(k,fakeRoot);
  fakeWorldClinit=makeFakeWorldClinitNode();
  k=new Key(fakeWorldClinit.getMethod(),fakeWorldClinit.getContext());
  registerNode(k,fakeWorldClinit);
  CallSiteReference site=CallSiteReference.make(1,fakeWorldClinit.getMethod().getReference(),IInvokeInstruction.Dispatch.STATIC);
  ((FakeRootMethod)fakeRoot.getMethod()).addInvocation(null,site);
  fakeRoot.addTarget(site,fakeWorldClinit);
}

Fixed version (ground truth):
/** 
 */
public void init(){
  fakeRoot=makeFakeRootNode();
  Key k=new Key(fakeRoot.getMethod(),fakeRoot.getContext());
  registerNode(k,fakeRoot);
  fakeWorldClinit=makeFakeWorldClinitNode();
  k=new Key(fakeWorldClinit.getMethod(),fakeWorldClinit.getContext());
  registerNode(k,fakeWorldClinit);
  CallSiteReference site=CallSiteReference.make(1,fakeWorldClinit.getMethod().getReference(),IInvokeInstruction.Dispatch.STATIC);
  site=((FakeRootMethod)fakeRoot.getMethod()).addInvocation(null,site).getCallSite();
  fakeRoot.addTarget(site,fakeWorldClinit);
}