Program: 85312
Project: 85312
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.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);
  }
}

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");
  FastHierarchy fastHierachy=Scene.v().getOrMakeFastHierarchy();
  if (declaredType != null && !fastHierachy.canStoreType(t,declaredType)) {
    return;
  }
  if (sigType != null && !fastHierachy.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) {
      assert(declaredType instanceof RefType);
      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 (!fastHierachy.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);
      String[] split=subSig.getString().replaceAll("String_Node_Str","String_Node_Str").split("String_Node_Str");
      Type declaredReturnType=Scene.v().getType(split[0]);
      String declaredName=split[1];
      List<Type> declaredParamTypes=new ArrayList<Type>();
      if (split.length == 3) {
        for (        String type : split[2].split("String_Node_Str")) {
          declaredParamTypes.add(Scene.v().getType(type));
        }
      }
      Chain<SootClass> classes=Scene.v().getClasses();
      for (      SootClass sc : classes) {
        for (        SootMethod sm : sc.getMethods()) {
          if (sm.isConcrete() || sm.isNative()) {
            if (!sm.getName().equals(declaredName))             continue;
            if (!fastHierachy.canStoreType(sm.getReturnType(),declaredReturnType))             continue;
            List<Type> paramTypes=sm.getParameterTypes();
            if (declaredParamTypes.size() != paramTypes.size())             continue;
            boolean check=true;
            for (int i=0; i < paramTypes.size(); i++) {
              if (!fastHierachy.canStoreType(paramTypes.get(i),declaredParamTypes.get(i))) {
                check=false;
                break;
              }
            }
            if (check) {
              Type st=sc.getType();
              if (!fastHierachy.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=fastHierachy;
      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);
  }
}