nus-yam/ex-repair huggingface dataset:
Program: 99955
Project: 99955
Buggy source:
private void populate(CGNode n){
  if (n.getMethod().isSynthetic()) {
    if (DEBUG) {
      System.err.println("String_Node_Str");
    }
    SyntheticMethod sm=(SyntheticMethod)n.getMethod();
    SSAInstruction[] statements=sm.getStatements();
    SSAMemoryAccessVisitor v=new SSAMemoryAccessVisitor(n);
    for (int i=0; i < statements.length; i++) {
      SSAInstruction s=statements[i];
      if (s != null) {
        v.setInstructionIndex(i);
        s.visit(v);
      }
    }
  }
 else {
    if (DEBUG) {
      System.err.println("String_Node_Str");
    }
    ShrikeCTMethod sm=(ShrikeCTMethod)n.getMethod();
    MemoryAccessVisitor v=new MemoryAccessVisitor(n.getMethod().getReference().getDeclaringClass().getClassLoader(),n);
    try {
      Instruction[] statements=sm.getInstructions();
      if (statements == null) {
        return;
      }
      if (DEBUG) {
        for (int i=0; i < statements.length; i++) {
          System.err.println(i + "String_Node_Str" + statements[i]);
        }
      }
      for (int i=0; i < statements.length; i++) {
        Instruction s=statements[i];
        if (s != null) {
          v.setInstructionIndex(i);
          s.visit(v);
        }
      }
    }
 catch (    InvalidClassFileException e) {
      e.printStackTrace();
      Assertions.UNREACHABLE();
    }
  }
}

Fixed version (ground truth):
private void populate(CGNode n){
  if (n.getMethod().isSynthetic()) {
    if (DEBUG) {
      System.err.println("String_Node_Str");
    }
    SSAInstruction[] statements=n.getIR().getInstructions();
    SSAMemoryAccessVisitor v=new SSAMemoryAccessVisitor(n);
    for (int i=0; i < statements.length; i++) {
      SSAInstruction s=statements[i];
      if (s != null) {
        v.setInstructionIndex(i);
        s.visit(v);
      }
    }
  }
 else {
    if (DEBUG) {
      System.err.println("String_Node_Str");
    }
    ShrikeCTMethod sm=(ShrikeCTMethod)n.getMethod();
    MemoryAccessVisitor v=new MemoryAccessVisitor(n.getMethod().getReference().getDeclaringClass().getClassLoader(),n);
    try {
      Instruction[] statements=sm.getInstructions();
      if (statements == null) {
        return;
      }
      if (DEBUG) {
        for (int i=0; i < statements.length; i++) {
          System.err.println(i + "String_Node_Str" + statements[i]);
        }
      }
      for (int i=0; i < statements.length; i++) {
        Instruction s=statements[i];
        if (s != null) {
          v.setInstructionIndex(i);
          s.visit(v);
        }
      }
    }
 catch (    InvalidClassFileException e) {
      e.printStackTrace();
      Assertions.UNREACHABLE();
    }
  }
}
Program: 99956
Project: 99956
Buggy source:
/** 
 * @return Collection of IClasses, representing the interfaces this class implements.
 */
protected Collection<IClass> computeAllInterfacesAsCollection() throws ClassHierarchyException {
  Collection<IClass> c=getDirectInterfaces();
  Set<IClass> result=HashSetFactory.make();
  for (Iterator<IClass> it=c.iterator(); it.hasNext(); ) {
    IClass klass=it.next();
    if (klass.isInterface()) {
      result.add(klass);
    }
 else {
      Warnings.add(ClassHierarchyWarning.create("String_Node_Str" + klass));
    }
  }
  for (Iterator<IClass> it=c.iterator(); it.hasNext(); ) {
    BytecodeClass I=(BytecodeClass)it.next();
    if (I.isInterface()) {
      result.addAll(I.computeAllInterfacesAsCollection());
    }
 else {
      Warnings.add(ClassHierarchyWarning.create("String_Node_Str" + I));
    }
  }
  IClass sup=null;
  try {
    sup=getSuperclass();
  }
 catch (  ClassHierarchyException e1) {
    Assertions.UNREACHABLE();
  }
  if (sup != null) {
    result.addAll(sup.getAllImplementedInterfaces());
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @return Collection of IClasses, representing the interfaces this class implements.
 */
protected Collection<IClass> computeAllInterfacesAsCollection() throws ClassHierarchyException {
  Collection<IClass> c=getDirectInterfaces();
  Set<IClass> result=HashSetFactory.make();
  for (Iterator<IClass> it=c.iterator(); it.hasNext(); ) {
    IClass klass=it.next();
    if (klass.isInterface()) {
      result.add(klass);
    }
 else {
      Warnings.add(ClassHierarchyWarning.create("String_Node_Str" + klass));
    }
  }
  Set<IClass> last=null;
  do {
    last=HashSetFactory.make(result);
    for (    IClass i : last) {
      result.addAll(i.getDirectInterfaces());
    }
  }
 while (last.size() < result.size());
  IClass sup=null;
  try {
    sup=getSuperclass();
  }
 catch (  ClassHierarchyException e1) {
    Assertions.UNREACHABLE();
  }
  if (sup != null) {
    result.addAll(sup.getAllImplementedInterfaces());
  }
  return result;
}
Program: 99957
Project: 99957
Buggy source:
/** 
 * Method array2Set.
 * @param interfaces a set of class names
 * @return Set of all IClasses that can be loaded corresponding to the class names in the interfaces array; raise warnings ifclasses can not be loaded
 */
private Collection<IClass> array2IClassSet(ImmutableByteArray[] interfaces){
  ArrayList<IClass> result=new ArrayList<IClass>(interfaces.length);
  for (int i=0; i < interfaces.length; i++) {
    ImmutableByteArray name=interfaces[i];
    IClass klass=null;
    klass=loader.lookupClass(TypeName.findOrCreate(name));
    if (klass == null) {
      Warnings.add(ClassNotFoundWarning.create(name));
    }
 else {
      result.add(klass);
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * @param interfaces a set of class names
 * @return Set of all IClasses that can be loaded corresponding to the class names in the interfaces array; raise warnings ifclasses can not be loaded
 */
private Collection<IClass> array2IClassSet(ImmutableByteArray[] interfaces){
  ArrayList<IClass> result=new ArrayList<IClass>(interfaces.length);
  for (int i=0; i < interfaces.length; i++) {
    ImmutableByteArray name=interfaces[i];
    IClass klass=null;
    klass=loader.lookupClass(TypeName.findOrCreate(name));
    if (klass == null) {
      Warnings.add(ClassNotFoundWarning.create(name));
    }
 else {
      result.add(klass);
    }
  }
  return result;
}
Program: 99958
Project: 99958
Buggy source:
/** 
 * @param line a whitespace-delimited string of column names
 */
private void populateColumnHeadings(String line,Character delimiter){
  StringTokenizer st=new StringTokenizer(line,delimiter.toString());
  int nColumns=st.countTokens();
  for (int i=0; i < nColumns; i++) {
    columnHeadings.set(i,(String)st.nextElement());
  }
}

Fixed version (ground truth):
/** 
 * @param line a whitespace-delimited string of column names
 */
private void populateColumnHeadings(String line,Character delimiter){
  StringTokenizer st=delimiter == null ? new StringTokenizer(line) : new StringTokenizer(line,delimiter.toString());
  int nColumns=st.countTokens();
  for (int i=0; i < nColumns; i++) {
    columnHeadings.set(i,(String)st.nextElement());
  }
}
Program: 99959
Project: 99959
Buggy source:
private void populateRow(int row,String line,Character delimiter){
  StringTokenizer st=new StringTokenizer(line,delimiter.toString());
  int nColumns=st.countTokens();
  Assertions.productionAssertion(nColumns == getNumberOfColumns(),"String_Node_Str" + getNumberOfColumns() + "String_Node_Str"+ nColumns+ "String_Node_Str"+ row+ "String_Node_Str"+ line.length()+ "String_Node_Str"+ line);
  SimpleVector<String> r=new SimpleVector<String>();
  rows.add(row,r);
  for (int i=0; i < nColumns; i++) {
    r.set(i,(String)st.nextElement());
  }
}

Fixed version (ground truth):
private void populateRow(int row,String line,Character delimiter){
  StringTokenizer st=delimiter == null ? new StringTokenizer(line) : new StringTokenizer(line,delimiter.toString());
  int nColumns=st.countTokens();
  Assertions.productionAssertion(nColumns == getNumberOfColumns(),"String_Node_Str" + getNumberOfColumns() + "String_Node_Str"+ nColumns+ "String_Node_Str"+ row+ "String_Node_Str"+ line.length()+ "String_Node_Str"+ line);
  SimpleVector<String> r=new SimpleVector<String>();
  rows.add(row,r);
  for (int i=0; i < nColumns; i++) {
    r.set(i,(String)st.nextElement());
  }
}
Program: 99960
Project: 99960
Buggy source:
/** 
 * TODO: really shouldn't allow A to be null.
 */
public DelegatingSSAContextInterpreter(SSAContextInterpreter A,SSAContextInterpreter B){
  super(A,B);
  this.A=A;
  this.B=B;
  if (Assertions.verifyAssertions) {
    Assertions._assert(B != null,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * neither A nor B should be null.
 */
public DelegatingSSAContextInterpreter(SSAContextInterpreter A,SSAContextInterpreter B){
  super(A,B);
  this.A=A;
  this.B=B;
  if (A == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (B == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
}
Program: 99961
Project: 99961
Buggy source:
public ZeroXCFABuilder(IClassHierarchy cha,AnalysisOptions options,AnalysisCache cache,ContextSelector appContextSelector,SSAContextInterpreter appContextInterpreter,ReflectionSpecification reflect,int instancePolicy){
  super(cha,options,cache,new DefaultPointerKeyFactory());
  ContextSelector def=new DefaultContextSelector();
  ContextSelector contextSelector=appContextSelector == null ? def : new DelegatingContextSelector(appContextSelector,def);
  setContextSelector(contextSelector);
  SSAContextInterpreter c=new DefaultSSAInterpreter(options,cache);
  c=new DelegatingSSAContextInterpreter(ReflectionContextInterpreter.createReflectionContextInterpreter(cha,options,getAnalysisCache(),reflect),c);
  SSAContextInterpreter contextInterpreter=new DelegatingSSAContextInterpreter(appContextInterpreter,c);
  setContextInterpreter(contextInterpreter);
  ZeroXInstanceKeys zik=makeInstanceKeys(cha,options,contextInterpreter,instancePolicy);
  setInstanceKeys(zik);
}

Fixed version (ground truth):
public ZeroXCFABuilder(IClassHierarchy cha,AnalysisOptions options,AnalysisCache cache,ContextSelector appContextSelector,SSAContextInterpreter appContextInterpreter,ReflectionSpecification reflect,int instancePolicy){
  super(cha,options,cache,new DefaultPointerKeyFactory());
  ContextSelector def=new DefaultContextSelector();
  ContextSelector contextSelector=appContextSelector == null ? def : new DelegatingContextSelector(appContextSelector,def);
  setContextSelector(contextSelector);
  SSAContextInterpreter c=new DefaultSSAInterpreter(options,cache);
  c=new DelegatingSSAContextInterpreter(ReflectionContextInterpreter.createReflectionContextInterpreter(cha,options,getAnalysisCache(),reflect),c);
  SSAContextInterpreter contextInterpreter=appContextInterpreter == null ? c : new DelegatingSSAContextInterpreter(appContextInterpreter,c);
  setContextInterpreter(contextInterpreter);
  ZeroXInstanceKeys zik=makeInstanceKeys(cha,options,contextInterpreter,instancePolicy);
  setInstanceKeys(zik);
}
Program: 99962
Project: 99962
Buggy source:
protected SSAContextInterpreter makeContextInterpreter(SSAContextInterpreter appContextInterpreter,ReflectionSpecification reflect){
  SSAContextInterpreter defI=new DefaultSSAInterpreter(getOptions(),getAnalysisCache());
  defI=new DelegatingSSAContextInterpreter(ReflectionContextInterpreter.createReflectionContextInterpreter(cha,getOptions(),getAnalysisCache(),reflect),defI);
  SSAContextInterpreter contextInterpreter=new DelegatingSSAContextInterpreter(appContextInterpreter,defI);
  return contextInterpreter;
}

Fixed version (ground truth):
protected SSAContextInterpreter makeContextInterpreter(SSAContextInterpreter appContextInterpreter,ReflectionSpecification reflect){
  SSAContextInterpreter defI=new DefaultSSAInterpreter(getOptions(),getAnalysisCache());
  defI=new DelegatingSSAContextInterpreter(ReflectionContextInterpreter.createReflectionContextInterpreter(cha,getOptions(),getAnalysisCache(),reflect),defI);
  SSAContextInterpreter contextInterpreter=appContextInterpreter == null ? defI : new DelegatingSSAContextInterpreter(appContextInterpreter,defI);
  return contextInterpreter;
}
Program: 99963
Project: 99963
Buggy source:
@Override public void addSeed(PathEdge<T> seed){
  unbalancedSeeds.add(Pair.make(seed.entry,seed.d1));
  super.addSeed(seed);
}

Fixed version (ground truth):
@Override public void addSeed(PathEdge<T> seed){
  if (getSeeds().contains(seed)) {
    return;
  }
  unbalancedSeeds.add(Pair.make(seed.entry,seed.d1));
  super.addSeed(seed);
}
Program: 99964
Project: 99964
Buggy source:
/** 
 * Spawn a process to execute the given command
 * @return an object representing the process
 * @throws WalaException
 * @throws IllegalArgumentException
 * @throws IOException
 */
protected Process spawnProcess(String cmd) throws IllegalArgumentException, IOException {
  if (cmd == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (logger != null) {
    logger.fine("String_Node_Str" + cmd);
  }
  String[] ev=getEnv() == null ? null : buildEnv(getEnv());
  Process p=Runtime.getRuntime().exec(cmd,ev,getWorkingDir());
  return p;
}

Fixed version (ground truth):
/** 
 * Spawn a process to execute the given command
 * @return an object representing the process
 * @throws WalaException
 * @throws IllegalArgumentException
 * @throws IOException
 */
protected Process spawnProcess(String cmd) throws IllegalArgumentException, IOException {
  if (cmd == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  System.out.println("String_Node_Str" + cmd);
  if (logger != null) {
    logger.fine("String_Node_Str" + cmd);
  }
  String[] ev=getEnv() == null ? null : buildEnv(getEnv());
  Process p=Runtime.getRuntime().exec(cmd,ev,getWorkingDir());
  return p;
}
Program: 99965
Project: 99965
Buggy source:
/** 
 * This is fragile.  Use with care.
 * @return a String representing the path to the wala.core plugin installation
 */
public static String getWalaCorePluginHome(){
  if (CorePlugin.getDefault() == null) {
    return null;
  }
  String install=Platform.getInstallLocation().getURL().getPath();
  Bundle b=Platform.getBundle("String_Node_Str");
  String l=b.getLocation();
  if (l.startsWith("String_Node_Str")) {
    l=l.replace("String_Node_Str","String_Node_Str");
  }
  return install + File.separator + l;
}

Fixed version (ground truth):
/** 
 * This is fragile.  Use with care.
 * @return a String representing the path to the wala.core plugin installation
 */
public static String getWalaCorePluginHome(){
  if (CorePlugin.getDefault() == null) {
    return null;
  }
  String install=Platform.getInstallLocation().getURL().getPath();
  Bundle b=Platform.getBundle("String_Node_Str");
  String l=b.getLocation();
  if (l.startsWith("String_Node_Str")) {
    l=l.replace("String_Node_Str","String_Node_Str");
  }
  if (l.startsWith("String_Node_Str")) {
    return l.replace("String_Node_Str","String_Node_Str");
  }
 else {
    return install + File.separator + l;
  }
}
Program: 99967
Project: 99967
Buggy source:
public String getForInVar(String loopVarName,Node initExpr){
  this.loopVarName=loopVarName;
  this.forInVar="String_Node_Str" + counter++;
  this.forInInitExpr=initExpr;
  return forInVar;
}

Fixed version (ground truth):
public String getForInVar(Node initExpr){
  this.forInVar="String_Node_Str" + counter++;
  this.forInInitExpr=initExpr;
  return forInVar;
}
Program: 99968
Project: 99968
Buggy source:
public String getForInLoopVar(){
  Assertions._assert(loopVarName != null);
  return loopVarName;
}

Fixed version (ground truth):
public String getForInLoopVar(){
  return null;
}
Program: 99969
Project: 99969
Buggy source:
private CAstNode translateOpcode(int nodeType){
switch (nodeType) {
case Token.ADD:
    return CAstOperator.OP_ADD;
case Token.DIV:
  return CAstOperator.OP_DIV;
case Token.LSH:
return CAstOperator.OP_LSH;
case Token.MOD:
return CAstOperator.OP_MOD;
case Token.MUL:
return CAstOperator.OP_MUL;
case Token.RSH:
return CAstOperator.OP_RSH;
case Token.SUB:
return CAstOperator.OP_SUB;
case Token.URSH:
return CAstOperator.OP_URSH;
case Token.BITAND:
return CAstOperator.OP_BIT_AND;
case Token.EQ:
return CAstOperator.OP_EQ;
case Token.SHEQ:
return CAstOperator.OP_EQ;
case Token.IFEQ:
return CAstOperator.OP_EQ;
case Token.GE:
return CAstOperator.OP_GE;
case Token.GT:
return CAstOperator.OP_GT;
case Token.LE:
return CAstOperator.OP_LE;
case Token.LT:
return CAstOperator.OP_LT;
case Token.NE:
return CAstOperator.OP_NE;
case Token.SHNE:
return CAstOperator.OP_NE;
case Token.IFNE:
return CAstOperator.OP_NE;
case Token.BITNOT:
return CAstOperator.OP_BITNOT;
case Token.NOT:
return CAstOperator.OP_NOT;
default :
Assertions.UNREACHABLE();
return null;
}
}

Fixed version (ground truth):
private CAstNode translateOpcode(int nodeType){
switch (nodeType) {
case Token.ADD:
    return CAstOperator.OP_ADD;
case Token.DIV:
  return CAstOperator.OP_DIV;
case Token.LSH:
return CAstOperator.OP_LSH;
case Token.MOD:
return CAstOperator.OP_MOD;
case Token.MUL:
return CAstOperator.OP_MUL;
case Token.RSH:
return CAstOperator.OP_RSH;
case Token.SUB:
return CAstOperator.OP_SUB;
case Token.URSH:
return CAstOperator.OP_URSH;
case Token.BITAND:
return CAstOperator.OP_BIT_AND;
case Token.BITOR:
return CAstOperator.OP_BIT_OR;
case Token.BITXOR:
return CAstOperator.OP_BIT_XOR;
case Token.EQ:
return CAstOperator.OP_EQ;
case Token.SHEQ:
return CAstOperator.OP_EQ;
case Token.IFEQ:
return CAstOperator.OP_EQ;
case Token.GE:
return CAstOperator.OP_GE;
case Token.GT:
return CAstOperator.OP_GT;
case Token.LE:
return CAstOperator.OP_LE;
case Token.LT:
return CAstOperator.OP_LT;
case Token.NE:
return CAstOperator.OP_NE;
case Token.SHNE:
return CAstOperator.OP_NE;
case Token.IFNE:
return CAstOperator.OP_NE;
case Token.BITNOT:
return CAstOperator.OP_BITNOT;
case Token.NOT:
return CAstOperator.OP_NOT;
default :
Assertions.UNREACHABLE();
return null;
}
}
Program: 99972
Project: 99972
Buggy source:
/** 
 * don't call this unless you really know what you're doing
 */
public Operator getOperator(){
  if (opcode < OP_iand) {
    return Operator.values()[(opcode - OP_iadd) / 4];
  }
 else {
    return Operator.values()[(opcode - OP_iand) / 2];
  }
}

Fixed version (ground truth):
public Operator getOperator(){
  if (opcode < OP_iand) {
    return Operator.values()[(opcode - OP_iadd) / 4];
  }
 else {
    return Operator.values()[5 + (opcode - OP_iand) / 2];
  }
}
Program: 99973
Project: 99973
Buggy source:
/** 
 * Return the unique receiver of an invocation of method on an object of type declaringClass
 * @param receiverClass type of receiver
 * @param selector method signature
 * @return Method resolved method abstraction
 * @throws IllegalArgumentException if receiverClass is null
 */
public IMethod resolveMethod(IClass receiverClass,Selector selector){
  if (receiverClass == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  IMethod result=findMethod(receiverClass,selector);
  if (result != null) {
    return result;
  }
 else {
    IClass superclass=null;
    try {
      superclass=receiverClass.getSuperclass();
    }
 catch (    ClassHierarchyException e) {
      Assertions.UNREACHABLE();
    }
    if (superclass == null) {
      if (DEBUG) {
        Trace.println("String_Node_Str" + selector + "String_Node_Str");
      }
      return null;
    }
 else {
      if (DEBUG) {
        Trace.println("String_Node_Str" + receiverClass + "String_Node_Str"+ superclass+ "String_Node_Str"+ selector);
      }
      return resolveMethod(superclass,selector);
    }
  }
}

Fixed version (ground truth):
/** 
 * Return the unique target of an invocation of method on an object of type declaringClass
 * @param receiverClass type of receiver
 * @param selector method signature
 * @return Method resolved method abstraction
 * @throws IllegalArgumentException if receiverClass is null
 */
public IMethod resolveMethod(IClass receiverClass,Selector selector){
  if (receiverClass == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  IMethod result=findMethod(receiverClass,selector);
  if (result != null) {
    return result;
  }
 else {
    IClass superclass=null;
    try {
      superclass=receiverClass.getSuperclass();
    }
 catch (    ClassHierarchyException e) {
      Assertions.UNREACHABLE();
    }
    if (superclass == null) {
      if (DEBUG) {
        Trace.println("String_Node_Str" + selector + "String_Node_Str");
      }
      return null;
    }
 else {
      if (DEBUG) {
        Trace.println("String_Node_Str" + receiverClass + "String_Node_Str"+ superclass+ "String_Node_Str"+ selector);
      }
      return resolveMethod(superclass,selector);
    }
  }
}
Program: 99974
Project: 99974
Buggy source:
/** 
 * Find the possible receivers of a call to a method reference
 * @param ref method reference
 * @return the set of IMethods that this call can resolve to.
 */
@SuppressWarnings("String_Node_Str") private Set<IMethod> findOrCreateTargetSet(IClass declaredClass,MethodReference ref){
  Map<MethodReference,Set<IMethod>> classCache=(Map<MethodReference,Set<IMethod>>)CacheReference.get(targetCache.get(declaredClass));
  if (classCache == null) {
    classCache=HashMapFactory.make(3);
    targetCache.put(declaredClass,CacheReference.make(classCache));
  }
  Set<IMethod> result=classCache.get(ref);
  if (result == null) {
    result=getPossibleTargets(declaredClass,ref);
    classCache.put(ref,result);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Find the possible targets of a call to a method reference
 * @param ref method reference
 * @return the set of IMethods that this call can resolve to.
 */
@SuppressWarnings("String_Node_Str") private Set<IMethod> findOrCreateTargetSet(IClass declaredClass,MethodReference ref){
  Map<MethodReference,Set<IMethod>> classCache=(Map<MethodReference,Set<IMethod>>)CacheReference.get(targetCache.get(declaredClass));
  if (classCache == null) {
    classCache=HashMapFactory.make(3);
    targetCache.put(declaredClass,CacheReference.make(classCache));
  }
  Set<IMethod> result=classCache.get(ref);
  if (result == null) {
    result=getPossibleTargets(declaredClass,ref);
    classCache.put(ref,result);
  }
  return result;
}
Program: 99975
Project: 99975
Buggy source:
/** 
 * Find the possible receivers of a call to a method reference where the receiver is of a certain type
 * @param receiverClass the class of the receiver
 * @param ref method reference
 * @return the set of IMethods that this call can resolve to.
 */
public Set<IMethod> getPossibleTargets(IClass receiverClass,MethodReference ref);

Fixed version (ground truth):
/** 
 * Find the possible targets of a call to a method reference where the receiver is of a certain type
 * @param receiverClass the class of the receiver
 * @param ref method reference
 * @return the set of IMethods that this call can resolve to.
 */
public Set<IMethod> getPossibleTargets(IClass receiverClass,MethodReference ref);
Program: 99977
Project: 99977
Buggy source:
/** 
 * Propagate information for an "exit" edge to a caller return site [23] for each d5 s.t. <s_p,d2> -> <returnSite(c),d5> ..
 * @param edge the edge being processed
 * @param c a call site of edge.s_p
 * @param D4 set of d1 s.t. <c, d1> -> <edge.s_p, edge.d2> was recorded as call flow
 * @param entries the blocks in the supergraph that are entries for the procedure of c
 * @param retSite the return site being propagated to
 * @param retf the flow function
 */
private void propagateToReturnSiteWithBinaryFlowFunction(final PathEdge edge,final T c,final IntSet D4,final T[] entries,final T retSite,final IFlowFunction retf){
  D4.foreach(new IntSetAction(){
    public void act(    final int d4){
      final IntSet D5=computeBinaryFlow(d4,edge.d2,(IBinaryReturnFlowFunction)retf);
      if (D5 != null) {
        D5.foreach(new IntSetAction(){
          public void act(          final int d5){
            for (int i=0; i < entries.length; i++) {
              final T s_p=entries[i];
              if (DEBUG_LEVEL > 1) {
                System.err.println("String_Node_Str" + s_p);
              }
              IntSet D3=getInversePathEdges(s_p,c,d4);
              if (DEBUG_LEVEL > 1) {
                System.err.println("String_Node_Str" + D3);
              }
              if (D3 != null) {
                D3.foreach(new IntSetAction(){
                  public void act(                  int d3){
                    propagate(s_p,d3,retSite,d5);
                  }
                }
);
              }
            }
          }
        }
);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Propagate information for an "exit" edge to a caller return site [23] for each d5 s.t. <s_p,d2> -> <returnSite(c),d5> ..
 * @param edge the edge being processed
 * @param c a call site of edge.s_p
 * @param D4 set of d1 s.t. <c, d1> -> <edge.s_p, edge.d2> was recorded as call flow
 * @param entries the blocks in the supergraph that are entries for the procedure of c
 * @param retSite the return site being propagated to
 * @param retf the flow function
 */
private void propagateToReturnSiteWithBinaryFlowFunction(final PathEdge edge,final T c,final IntSet D4,final T[] entries,final T retSite,final IFlowFunction retf){
  D4.foreach(new IntSetAction(){
    public void act(    final int d4){
      final IntSet D5=computeBinaryFlow(d4,edge.d2,(IBinaryReturnFlowFunction)retf);
      propToReturnSite(c,entries,retSite,d4,D5);
    }
  }
);
}
Program: 99978
Project: 99978
Buggy source:
private void init(Graph<T> G,Iterator<? extends T> nodes){
  this.G=G;
  if (G.getNumberOfNodes() == 0) {
    return;
  }
  while (nodes.hasNext()) {
    T o=nodes.next();
    if (!visited.contains(o)) {
      Q.add(o);
      visited.add(o);
    }
  }
  index=0;
  T current=Q.get(0);
  visitChildren(current);
}

Fixed version (ground truth):
private void init(Graph<T> G,Iterator<? extends T> nodes){
  this.G=G;
  if (G.getNumberOfNodes() == 0) {
    return;
  }
  while (nodes.hasNext()) {
    T o=nodes.next();
    if (!visited.contains(o)) {
      Q.add(o);
      visited.add(o);
    }
  }
  index=0;
  if (Q.size() > 0) {
    T current=Q.get(0);
    visitChildren(current);
  }
}
Program: 99980
Project: 99980
Buggy source:
/** 
 * Solely for optimization; return a Collection<TypeReference> representing the subclassesOfError kind of ugly. a better scheme?
 */
public Collection<TypeReference> getJavaLangErrorTypes(){
  if (subTypeRefsOfError == null) {
    computeSubClasses(TypeReference.JavaLangError);
    subTypeRefsOfError=HashSetFactory.make(subclassesOfError.size());
    for (Iterator it=subclassesOfError.iterator(); it.hasNext(); ) {
      IClass klass=(IClass)it.next();
      subTypeRefsOfError.add(klass.getReference());
    }
  }
  return Collections.unmodifiableCollection(subTypeRefsOfError);
}

Fixed version (ground truth):
/** 
 * Solely for optimization; return a Collection<TypeReference> representing the subclasses of Error kind of ugly. a better scheme?
 */
public Collection<TypeReference> getJavaLangErrorTypes(){
  if (subTypeRefsOfError == null) {
    computeSubClasses(TypeReference.JavaLangError);
    subTypeRefsOfError=HashSetFactory.make(subclassesOfError.size());
    for (Iterator it=subclassesOfError.iterator(); it.hasNext(); ) {
      IClass klass=(IClass)it.next();
      subTypeRefsOfError.add(klass.getReference());
    }
  }
  return Collections.unmodifiableCollection(subTypeRefsOfError);
}
Program: 99981
Project: 99981
Buggy source:
/** 
 * @param klass
 * @return the classes that immediately extend klass. if klass is an array class A[][]...[], we return array classesB[][]...[] (same dimensionality) where B is an immediate subclass of A. If A is primitive, we return the empty set.
 */
public Collection<IClass> getImmediateSubclasses(IClass klass){
  if (klass.isArrayClass()) {
    return getImmediateArraySubclasses(klass);
  }
  Function<Node,IClass> node2Class=new Function<Node,IClass>(){
    public IClass apply(    Node n){
      return n.klass;
    }
  }
;
  return Iterator2Collection.toCollection(new MapIterator<Node,IClass>(findNode(klass).children.iterator(),node2Class));
}

Fixed version (ground truth):
/** 
 * @param klass
 * @return the classes that immediately extend klass. if klass is an array class A[][]...[], we return array classes B[][]...[](same dimensionality) where B is an immediate subclass of A. If A is primitive, we return the empty set.
 */
public Collection<IClass> getImmediateSubclasses(IClass klass){
  if (klass.isArrayClass()) {
    return getImmediateArraySubclasses(klass);
  }
  Function<Node,IClass> node2Class=new Function<Node,IClass>(){
    public IClass apply(    Node n){
      return n.klass;
    }
  }
;
  return Iterator2Collection.toCollection(new MapIterator<Node,IClass>(findNode(klass).children.iterator(),node2Class));
}
Program: 99982
Project: 99982
Buggy source:
/** 
 * Return set of all subclasses of type in the Class Hierarchy TODO: Tune this implementation. Consider caching if necessary.
 */
public Collection<IClass> computeSubClasses(TypeReference type){
  IClass T=lookupClass(type);
  if (Assertions.verifyAssertions) {
    if (T == null) {
      Assertions._assert(T != null,"String_Node_Str" + type);
    }
  }
  if (T.getReference().equals(TypeReference.JavaLangError)) {
    if (subclassesOfError == null) {
      subclassesOfError=computeSubClassesInternal(T);
    }
    return subclassesOfError;
  }
 else {
    return computeSubClassesInternal(T);
  }
}

Fixed version (ground truth):
/** 
 * Return set of all subclasses of type in the Class Hierarchy TODO: Tune this implementation. Consider caching if necessary.
 */
public Collection<IClass> computeSubClasses(TypeReference type){
  IClass t=lookupClass(type);
  if (Assertions.verifyAssertions) {
    if (t == null) {
      Assertions._assert(t != null,"String_Node_Str" + type);
    }
  }
  if (t.getReference().equals(TypeReference.JavaLangError)) {
    if (subclassesOfError == null) {
      subclassesOfError=computeSubClassesInternal(t);
    }
    return subclassesOfError;
  }
 else   if (t.getReference().equals(TypeReference.JavaLangRuntimeException)) {
    if (runtimeExceptionClasses == null) {
      runtimeExceptionClasses=computeSubClassesInternal(t);
    }
    return runtimeExceptionClasses;
  }
 else {
    return computeSubClassesInternal(t);
  }
}
Program: 99983
Project: 99983
Buggy source:
/** 
 * @param klass
 * @return the number of classes that immediately extend klass. if klass is an array class A[][]...[], we returnnumber of immediate subclasses of A. If A is primitive, we return 0.
 */
public int getNumberOfImmediateSubclasses(IClass klass){
  if (klass.isArrayClass()) {
    IClass innermost=getInnermostTypeOfArrayClass(klass);
    return innermost == null ? 0 : getNumberOfImmediateSubclasses(innermost);
  }
  Node node=findNode(klass);
  return node.children.size();
}

Fixed version (ground truth):
/** 
 * @param klass
 * @return the number of classes that immediately extend klass. if klass is an array class A[][]...[], we return number ofimmediate subclasses of A. If A is primitive, we return 0.
 */
public int getNumberOfImmediateSubclasses(IClass klass){
  if (klass.isArrayClass()) {
    IClass innermost=getInnermostTypeOfArrayClass(klass);
    return innermost == null ? 0 : getNumberOfImmediateSubclasses(innermost);
  }
  Node node=findNode(klass);
  return node.children.size();
}
Program: 99984
Project: 99984
Buggy source:
/** 
 * Solely for optimization; return a Collection<TypeReference> representing the subclassesOfError kind of ugly. a better scheme?
 */
public Collection<TypeReference> getJavaLangErrorTypes();

Fixed version (ground truth):
/** 
 * Solely for optimization; return a Collection<TypeReference> representing the subclasses of Error kind of ugly. a better scheme?
 */
public Collection<TypeReference> getJavaLangErrorTypes();
Program: 99985
Project: 99985
Buggy source:
/** 
 * @return Collection<TypeReference>, set of exception types a call to adeclared target might throw.
 * @throws InvalidClassFileException 
 * @throws IllegalArgumentException  if target is null
 * @throws IllegalArgumentException  if cha is null
 */
public static Collection<TypeReference> inferInvokeExceptions(MethodReference target,IClassHierarchy cha) throws InvalidClassFileException {
  if (cha == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (target == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ArrayList<TypeReference> set=new ArrayList<TypeReference>(runtimeExceptions);
  set.addAll(cha.getJavaLangErrorTypes());
  IClass klass=cha.lookupClass(target.getDeclaringClass());
  if (klass == null) {
    Warnings.add(MethodResolutionFailure.moderate(target));
  }
  if (klass != null) {
    IMethod M=klass.getMethod(target.getSelector());
    if (M == null) {
      Warnings.add(MethodResolutionFailure.severe(target));
    }
 else {
      TypeReference[] exceptionTypes=M.getDeclaredExceptions();
      if (exceptionTypes != null) {
        set.addAll(Arrays.asList(exceptionTypes));
      }
    }
  }
  return set;
}

Fixed version (ground truth):
/** 
 * @return Collection<TypeReference>, set of exception types a call to adeclared target might throw.
 * @throws InvalidClassFileException 
 * @throws IllegalArgumentException  if target is null
 * @throws IllegalArgumentException  if cha is null
 */
public static Collection<TypeReference> inferInvokeExceptions(MethodReference target,IClassHierarchy cha) throws InvalidClassFileException {
  if (cha == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (target == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ArrayList<TypeReference> set=new ArrayList<TypeReference>(cha.getJavaLangRuntimeExceptionTypes());
  set.addAll(cha.getJavaLangErrorTypes());
  IClass klass=cha.lookupClass(target.getDeclaringClass());
  if (klass == null) {
    Warnings.add(MethodResolutionFailure.moderate(target));
  }
  if (klass != null) {
    IMethod M=klass.getMethod(target.getSelector());
    if (M == null) {
      Warnings.add(MethodResolutionFailure.severe(target));
    }
 else {
      TypeReference[] exceptionTypes=M.getDeclaredExceptions();
      if (exceptionTypes != null) {
        set.addAll(Arrays.asList(exceptionTypes));
      }
    }
  }
  return set;
}
Program: 99986
Project: 99986
Buggy source:
public void testMultiNewArray1() throws IOException, ClassHierarchyException {
  AnalysisScope scope=null;
  scope=AnalysisScopeReader.read(TestConstants.WALA_TESTDATA,FileProvider.getFile("String_Node_Str"),MY_CLASSLOADER);
  ClassHierarchy cha=ClassHierarchy.make(scope);
  IClass klass=cha.lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application,TestConstants.MULTI_DIM_MAIN));
  assertTrue(klass != null);
  IMethod m=klass.getMethod(Selector.make("String_Node_Str"));
  assertTrue(m != null);
  AnalysisCache cache=new AnalysisCache();
  IR ir=cache.getIRFactory().makeIR(m,Everywhere.EVERYWHERE,new SSAOptions());
  assertTrue(ir != null);
  SSAInstruction[] instructions=ir.getInstructions();
  for (  SSAInstruction instr : instructions) {
    if (instr instanceof SSANewInstruction) {
    }
  }
}

Fixed version (ground truth):
public void testMultiNewArray1() throws IOException, ClassHierarchyException {
  AnalysisScope scope=null;
  scope=AnalysisScopeReader.read(TestConstants.WALA_TESTDATA,FileProvider.getFile("String_Node_Str"),MY_CLASSLOADER);
  ClassHierarchy cha=ClassHierarchy.make(scope);
  IClass klass=cha.lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application,TestConstants.MULTI_DIM_MAIN));
  assertTrue(klass != null);
  IMethod m=klass.getMethod(Selector.make("String_Node_Str"));
  assertTrue(m != null);
  AnalysisCache cache=new AnalysisCache();
  IR ir=cache.getIRFactory().makeIR(m,Everywhere.EVERYWHERE,new SSAOptions());
  assertTrue(ir != null);
  SSAInstruction[] instructions=ir.getInstructions();
  for (  SSAInstruction instr : instructions) {
    if (instr instanceof SSANewInstruction) {
      System.err.println(instr.toString(ir.getSymbolTable()));
      assertTrue(instr.getNumberOfUses() == 3);
      assertTrue(ir.getSymbolTable().getIntValue(instr.getUse(0)) == 3);
      assertTrue(ir.getSymbolTable().getIntValue(instr.getUse(1)) == 4);
    }
  }
}
Program: 99987
Project: 99987
Buggy source:
/** 
 * @see com.ibm.wala.shrikeBT.Instruction.Visitor#visitNew(NewInstruction)
 */
@Override public void visitNew(com.ibm.wala.shrikeBT.NewInstruction instruction){
  int result=reuseOrCreateDef();
  TypeReference t=ShrikeUtil.makeTypeReference(loader,instruction.getType());
  NewSiteReference ref=NewSiteReference.make(getCurrentProgramCounter(),t);
  if (t.isArrayType()) {
    int[] sizes=new int[t.getDimensionality()];
    for (int i=0; i < instruction.getArrayBoundsCount(); i++) {
      sizes[i]=workingState.pop();
    }
    for (int i=instruction.getArrayBoundsCount(); i < sizes.length; i++) {
      sizes[i]=symbolTable.getConstant(0);
    }
    emitInstruction(new SSANewInstruction(result,ref,sizes));
  }
 else {
    emitInstruction(new SSANewInstruction(result,ref));
    popN(instruction);
  }
  workingState.push(result);
}

Fixed version (ground truth):
/** 
 * @see com.ibm.wala.shrikeBT.Instruction.Visitor#visitNew(NewInstruction)
 */
@Override public void visitNew(com.ibm.wala.shrikeBT.NewInstruction instruction){
  int result=reuseOrCreateDef();
  TypeReference t=ShrikeUtil.makeTypeReference(loader,instruction.getType());
  NewSiteReference ref=NewSiteReference.make(getCurrentProgramCounter(),t);
  if (t.isArrayType()) {
    int[] sizes=new int[t.getDimensionality()];
    for (int i=0; i < instruction.getArrayBoundsCount(); i++) {
      sizes[instruction.getArrayBoundsCount() - 1 - i]=workingState.pop();
    }
    for (int i=instruction.getArrayBoundsCount(); i < sizes.length; i++) {
      sizes[i]=symbolTable.getConstant(0);
    }
    emitInstruction(new SSANewInstruction(result,ref,sizes));
  }
 else {
    emitInstruction(new SSANewInstruction(result,ref));
    popN(instruction);
  }
  workingState.push(result);
}
Program: 99988
Project: 99988
Buggy source:
/** 
 * @param pc a program counter (index into ShrikeBT instruction array)
 * @param vn a value number
 * @return if we know that immediately after the given program counter, v_vn corresponds to some set of locals, thenreturn an array of the local numbers. else return null.
 */
private int[] findLocalsForValueNumber(int pc,int vn){
  IBasicBlock bb=shrikeCFG.getBlockForInstruction(pc);
  int firstInstruction=bb.getFirstInstructionIndex();
  int[] locals=block2LocalState[bb.getNumber()];
  if (locals == null) {
    locals=allocateNewLocalsArray();
  }
  for (int i=firstInstruction; i <= pc; i++) {
    if (localStoreMap[i] != null) {
      IntPair p=localStoreMap[i];
      locals[p.getY()]=p.getX();
    }
  }
  return extractIndices(locals,vn);
}

Fixed version (ground truth):
/** 
 * @param pc a program counter (index into ShrikeBT instruction array)
 * @param vn a value number
 * @return if we know that immediately after the given program counter, v_vn corresponds to some set of locals, then return anarray of the local numbers. else return null.
 */
private int[] findLocalsForValueNumber(int pc,int vn){
  IBasicBlock bb=shrikeCFG.getBlockForInstruction(pc);
  int firstInstruction=bb.getFirstInstructionIndex();
  int[] locals=block2LocalState[bb.getNumber()];
  if (locals == null) {
    locals=allocateNewLocalsArray();
  }
  for (int i=firstInstruction; i <= pc; i++) {
    if (localStoreMap[i] != null) {
      IntPair p=localStoreMap[i];
      locals[p.getY()]=p.getX();
    }
  }
  return extractIndices(locals,vn);
}
Program: 99989
Project: 99989
Buggy source:
@Override public String toString(SymbolTable symbolTable){
  return getValueString(symbolTable,result) + "String_Node_Str" + site.getDeclaredType()+ "String_Node_Str"+ site.getProgramCounter()+ (params == null ? "String_Node_Str" : "String_Node_Str" + params.length);
}

Fixed version (ground truth):
@Override public String toString(SymbolTable symbolTable){
  return getValueString(symbolTable,result) + "String_Node_Str" + site.getDeclaredType()+ "String_Node_Str"+ site.getProgramCounter()+ (params == null ? "String_Node_Str" : "String_Node_Str" + params.length + "String_Node_Str"+ array2String(params,symbolTable));
}
Program: 99990
Project: 99990
Buggy source:
@Override protected void propagate(T s_p,int i,T n,int j){
  super.propagate(s_p,i,n,j);
  if (isExitFromSeedMethod(n)) {
    for (Iterator<? extends T> it2=supergraph.getSuccNodes(n); it2.hasNext(); ) {
      T retSite=it2.next();
      PartiallyBalancedTabulationProblem<T,P> problem=(PartiallyBalancedTabulationProblem<T,P>)getProblem();
      IFlowFunction f=problem.getFunctionMap().getUnbalancedReturnFlowFunction(n,retSite);
      if (f instanceof IUnaryFlowFunction) {
        IUnaryFlowFunction uf=(IUnaryFlowFunction)f;
        IntSet facts=uf.getTargets(j);
        if (facts != null) {
          for (IntIterator it4=facts.intIterator(); it4.hasNext(); ) {
            int d3=it4.next();
            T fakeEntry=problem.getFakeEntry(retSite);
            PathEdge<T> seed=PathEdge.createPathEdge(fakeEntry,d3,retSite,d3);
            addSeed(seed);
          }
        }
      }
 else {
        Assertions.UNREACHABLE("String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void propagate(T s_p,int i,T n,int j){
  super.propagate(s_p,i,n,j);
  if (wasUsedAsUnbalancedSeed(s_p,i) && supergraph.isExit(n)) {
    for (Iterator<? extends T> it2=supergraph.getSuccNodes(n); it2.hasNext(); ) {
      T retSite=it2.next();
      PartiallyBalancedTabulationProblem<T,P> problem=(PartiallyBalancedTabulationProblem<T,P>)getProblem();
      IFlowFunction f=problem.getFunctionMap().getUnbalancedReturnFlowFunction(n,retSite);
      if (f instanceof IUnaryFlowFunction) {
        IUnaryFlowFunction uf=(IUnaryFlowFunction)f;
        IntSet facts=uf.getTargets(j);
        if (facts != null) {
          for (IntIterator it4=facts.intIterator(); it4.hasNext(); ) {
            int d3=it4.next();
            T fakeEntry=problem.getFakeEntry(retSite);
            PathEdge<T> seed=PathEdge.createPathEdge(fakeEntry,d3,retSite,d3);
            addSeed(seed);
          }
        }
      }
 else {
        Assertions.UNREACHABLE("String_Node_Str");
      }
    }
  }
}
Program: 99991
Project: 99991
Buggy source:
@Override public void addSeed(PathEdge<T> seed){
  seedProcedures.add(getSupergraph().getProcOf(seed.entry));
  super.addSeed(seed);
}

Fixed version (ground truth):
@Override public void addSeed(PathEdge<T> seed){
  unbalancedSeeds.add(Pair.make(seed.entry,seed.d1));
  super.addSeed(seed);
}
Program: 99992
Project: 99992
Buggy source:
public InstanceKey getInstanceKeyForAllocation(CGNode node,NewSiteReference allocation){
  IClass type=options.getClassTargetSelector().getAllocatedTarget(node,allocation);
  if (type == null) {
    return null;
  }
  if (node.getContext() instanceof ReceiverInstanceContext) {
    IMethod m=node.getMethod();
    CGNode n=ContainerContextSelector.findNodeRecursiveMatchingContext(m,node.getContext());
    if (n != null) {
      return new NormalAllocationInNode(n,allocation,type);
    }
  }
  InstanceKey key=new NormalAllocationInNode(node,allocation,type);
  return key;
}

Fixed version (ground truth):
public InstanceKey getInstanceKeyForAllocation(CGNode node,NewSiteReference allocation){
  IClass type=options.getClassTargetSelector().getAllocatedTarget(node,allocation);
  if (type == null) {
    return null;
  }
  if (node.getContext() instanceof ReceiverInstanceContext || node.getContext() instanceof CallerContext) {
    IMethod m=node.getMethod();
    CGNode n=ContainerContextSelector.findNodeRecursiveMatchingContext(m,node.getContext());
    if (n != null) {
      return new NormalAllocationInNode(n,allocation,type);
    }
  }
  InstanceKey key=new NormalAllocationInNode(node,allocation,type);
  return key;
}
Program: 99993
Project: 99993
Buggy source:
/** 
 * This method walks recursively up the definition of a context C, to see if the chain of contexts that give rise to C includes the method M. If C is a ReceiverInstanceContext, Let N be the node that allocated C.instance. If N.method == M, return N. Else return findRecursiveMatchingContext(M, N.context) Else return null
 */
public static CGNode findNodeRecursiveMatchingContext(IMethod M,Context C){
  if (DEBUG) {
    System.err.println("String_Node_Str" + M + "String_Node_Str"+ C);
  }
  if (C instanceof ReceiverInstanceContext) {
    ReceiverInstanceContext ric=(ReceiverInstanceContext)C;
    if (!(ric.getReceiver() instanceof AllocationSiteInNode)) {
      return null;
    }
    AllocationSiteInNode I=(AllocationSiteInNode)ric.getReceiver();
    CGNode N=I.getNode();
    if (N.getMethod().equals(M)) {
      return N;
    }
 else {
      return findNodeRecursiveMatchingContext(M,N.getContext());
    }
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * This method walks recursively up the definition of a context C, to see if the chain of contexts that give rise to C includes the method M. If C is a ReceiverInstanceContext, Let N be the node that allocated C.instance. If N.method == M, return N. Else return findRecursiveMatchingContext(M, N.context) Else return null
 */
public static CGNode findNodeRecursiveMatchingContext(IMethod m,Context c){
  if (DEBUG) {
    System.err.println("String_Node_Str" + m + "String_Node_Str"+ c);
  }
  if (c instanceof ReceiverInstanceContext) {
    ReceiverInstanceContext ric=(ReceiverInstanceContext)c;
    if (!(ric.getReceiver() instanceof AllocationSiteInNode)) {
      return null;
    }
    AllocationSiteInNode i=(AllocationSiteInNode)ric.getReceiver();
    CGNode n=i.getNode();
    if (n.getMethod().equals(m)) {
      return n;
    }
 else {
      return findNodeRecursiveMatchingContext(m,n.getContext());
    }
  }
 else   if (c instanceof CallerContext) {
    CallerContext cc=(CallerContext)c;
    CGNode n=cc.getCaller();
    if (n.getMethod().equals(m)) {
      return n;
    }
 else {
      return findNodeRecursiveMatchingContext(m,n.getContext());
    }
  }
 else {
    return null;
  }
}
Program: 99994
Project: 99994
Buggy source:
@Override public void acceptSearchMatch(SearchMatch match) throws CoreException {
  result.add((IMethod)match.getElement());
}

Fixed version (ground truth):
@Override public void acceptSearchMatch(SearchMatch match) throws CoreException {
  if (match.getElement() instanceof IMethod) {
    result.add((IMethod)match.getElement());
  }
}
Program: 99995
Project: 99995
Buggy source:
/** 
 * @param typeSignature Some of the type signatures examples are "QString;" (String) and "I" (int) The type signatures may be either unresolved (for source types) or resolved (for binary types), and either basic (for basic types) or rich (for parameterized types). See {@link Signature} for details.
 */
public static String getHumanReadableType(String typeSignature){
  String simpleName=Signature.getSignatureSimpleName(typeSignature);
  return simpleName;
}

Fixed version (ground truth):
/** 
 * @param typeSignature Some of the type signatures examples are "QString;" (String) and "I" (int) The type signatures may beeither unresolved (for source types) or resolved (for binary types), and either basic (for basic types) or rich (for parameterized types). See  {@link Signature} for details.
 */
public static String getHumanReadableType(String typeSignature){
  String simpleName=Signature.getSignatureSimpleName(typeSignature);
  return simpleName;
}