Program: 85316
Project: 85316
Buggy source:
public void resolve(Type t,Type declaredType,Type sigType,NumberedString subSig,SootMethod container,ChunkedQueue<SootMethod> targets){
  if (declaredType instanceof ArrayType)   declaredType=RefType.v("String_Node_Str");
  if (sigType instanceof ArrayType)   sigType=RefType.v("String_Node_Str");
  if (t instanceof ArrayType)   t=RefType.v("String_Node_Str");
  if (declaredType != null && !Scene.v().getOrMakeFastHierarchy().canStoreType(t,declaredType)) {
    return;
  }
  if (sigType != null && !Scene.v().getOrMakeFastHierarchy().canStoreType(t,sigType)) {
    return;
  }
  if (t instanceof RefType) {
    SootMethod target=resolveNonSpecial((RefType)t,subSig);
    if (target != null)     targets.add(target);
  }
 else   if (t instanceof AnySubType) {
    if (options.library() == CGOptions.library_name_resolution) {
      RefType base=((AnySubType)t).getBase();
      Pair<Type,NumberedString> pair=new Pair<Type,NumberedString>(base,subSig);
      List<Type> types=baseToPossibleSubTypes.get(pair);
      if (types != null) {
        for (        Type st : types) {
          if (!Scene.v().getOrMakeFastHierarchy().canStoreType(st,declaredType)) {
            resolve(st,st,sigType,subSig,container,targets);
          }
 else {
            resolve(st,declaredType,sigType,subSig,container,targets);
          }
        }
        return;
      }
      baseToPossibleSubTypes.put(pair,types=new ArrayList<Type>());
      types.add(base);
      Chain<SootClass> classes=Scene.v().getClasses();
      for (      SootClass sc : classes) {
        for (        SootMethod sm : sc.getMethods()) {
          if (sm.isConcrete() && sm.getSubSignature().equals(subSig.getString())) {
            Type st=sc.getType();
            if (!Scene.v().getOrMakeFastHierarchy().canStoreType(st,declaredType)) {
              resolve(st,st,sigType,subSig,container,targets);
            }
 else {
              resolve(st,declaredType,sigType,subSig,container,targets);
            }
            types.add(st);
          }
        }
      }
    }
 else {
      RefType base=((AnySubType)t).getBase();
      List<Type> subTypes=baseToSubTypes.get(base);
      if (subTypes != null) {
        for (Iterator<Type> stIt=subTypes.iterator(); stIt.hasNext(); ) {
          final Type st=stIt.next();
          resolve(st,declaredType,sigType,subSig,container,targets);
        }
        return;
      }
      baseToSubTypes.put(base,subTypes=new ArrayList<Type>());
      subTypes.add(base);
      LinkedList<SootClass> worklist=new LinkedList<SootClass>();
      HashSet<SootClass> workset=new HashSet<SootClass>();
      FastHierarchy fh=Scene.v().getOrMakeFastHierarchy();
      SootClass cl=base.getSootClass();
      if (workset.add(cl))       worklist.add(cl);
      while (!worklist.isEmpty()) {
        cl=worklist.removeFirst();
        if (cl.isInterface()) {
          for (Iterator<SootClass> cIt=fh.getAllImplementersOfInterface(cl).iterator(); cIt.hasNext(); ) {
            final SootClass c=cIt.next();
            if (workset.add(c))             worklist.add(c);
          }
        }
 else {
          if (cl.isConcrete()) {
            resolve(cl.getType(),declaredType,sigType,subSig,container,targets);
            subTypes.add(cl.getType());
          }
          for (Iterator<SootClass> cIt=fh.getSubclassesOf(cl).iterator(); cIt.hasNext(); ) {
            final SootClass c=cIt.next();
            if (workset.add(c))             worklist.add(c);
          }
        }
      }
    }
  }
 else   if (t instanceof NullType) {
  }
 else {
    throw new RuntimeException("String_Node_Str" + t);
  }
}

Fixed version (ground truth):
public void resolve(Type t,Type declaredType,Type sigType,NumberedString subSig,SootMethod container,ChunkedQueue<SootMethod> targets){
  if (declaredType instanceof ArrayType)   declaredType=RefType.v("String_Node_Str");
  if (sigType instanceof ArrayType)   sigType=RefType.v("String_Node_Str");
  if (t instanceof ArrayType)   t=RefType.v("String_Node_Str");
  if (declaredType != null && !Scene.v().getOrMakeFastHierarchy().canStoreType(t,declaredType)) {
    return;
  }
  if (sigType != null && !Scene.v().getOrMakeFastHierarchy().canStoreType(t,sigType)) {
    return;
  }
  if (t instanceof RefType) {
    SootMethod target=resolveNonSpecial((RefType)t,subSig);
    if (target != null)     targets.add(target);
  }
 else   if (t instanceof AnySubType) {
    if (options.library() == CGOptions.library_name_resolution) {
      RefType base=((AnySubType)t).getBase();
      Pair<Type,NumberedString> pair=new Pair<Type,NumberedString>(base,subSig);
      List<Type> types=baseToPossibleSubTypes.get(pair);
      if (types != null) {
        for (        Type st : types) {
          if (!Scene.v().getOrMakeFastHierarchy().canStoreType(st,declaredType)) {
            resolve(st,st,sigType,subSig,container,targets);
          }
 else {
            resolve(st,declaredType,sigType,subSig,container,targets);
          }
        }
        return;
      }
      baseToPossibleSubTypes.put(pair,types=new ArrayList<Type>());
      types.add(base);
      Chain<SootClass> classes=Scene.v().getClasses();
      for (      SootClass sc : classes) {
        for (        SootMethod sm : sc.getMethods()) {
          if ((sm.isConcrete() || sm.isNative()) && sm.getSubSignature().equals(subSig.getString())) {
            Type st=sc.getType();
            if (!Scene.v().getOrMakeFastHierarchy().canStoreType(st,declaredType)) {
              resolve(st,st,sigType,subSig,container,targets);
            }
 else {
              resolve(st,declaredType,sigType,subSig,container,targets);
            }
            types.add(st);
          }
        }
      }
    }
 else {
      RefType base=((AnySubType)t).getBase();
      List<Type> subTypes=baseToSubTypes.get(base);
      if (subTypes != null) {
        for (Iterator<Type> stIt=subTypes.iterator(); stIt.hasNext(); ) {
          final Type st=stIt.next();
          resolve(st,declaredType,sigType,subSig,container,targets);
        }
        return;
      }
      baseToSubTypes.put(base,subTypes=new ArrayList<Type>());
      subTypes.add(base);
      LinkedList<SootClass> worklist=new LinkedList<SootClass>();
      HashSet<SootClass> workset=new HashSet<SootClass>();
      FastHierarchy fh=Scene.v().getOrMakeFastHierarchy();
      SootClass cl=base.getSootClass();
      if (workset.add(cl))       worklist.add(cl);
      while (!worklist.isEmpty()) {
        cl=worklist.removeFirst();
        if (cl.isInterface()) {
          for (Iterator<SootClass> cIt=fh.getAllImplementersOfInterface(cl).iterator(); cIt.hasNext(); ) {
            final SootClass c=cIt.next();
            if (workset.add(c))             worklist.add(c);
          }
        }
 else {
          if (cl.isConcrete()) {
            resolve(cl.getType(),declaredType,sigType,subSig,container,targets);
            subTypes.add(cl.getType());
          }
          for (Iterator<SootClass> cIt=fh.getSubclassesOf(cl).iterator(); cIt.hasNext(); ) {
            final SootClass c=cIt.next();
            if (workset.add(c))             worklist.add(c);
          }
        }
      }
    }
  }
 else   if (t instanceof NullType) {
  }
 else {
    throw new RuntimeException("String_Node_Str" + t);
  }
}