Program: 85307
Project: 85307
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");
  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) {
    RefType base=((AnySubType)t).getBase();
    if (options.library() == CGOptions.library_name_resolution && base.getSootClass().isInterface()) {
      assert(declaredType instanceof RefType);
      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)) {
                if (!sc.isFinal()) {
                  resolve(st,st,sigType,subSig,container,targets);
                  types.add(st);
                }
              }
 else {
                resolve(st,declaredType,sigType,subSig,container,targets);
                types.add(st);
              }
            }
          }
        }
      }
    }
 else {
      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);
  }
}

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) {
    RefType base=((AnySubType)t).getBase();
    if (options.library() == CGOptions.library_name_resolution && base.getSootClass().isInterface()) {
      assert(declaredType instanceof RefType);
      Pair<Type,NumberedString> pair=new Pair<Type,NumberedString>(base,subSig);
      List<Pair<Type,NumberedString>> types=baseToPossibleSubTypes.get(pair);
      if (types != null) {
        for (        Pair<Type,NumberedString> tuple : types) {
          Type st=tuple.getO1();
          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<Pair<Type,NumberedString>>());
      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(declaredParamTypes.get(i),paramTypes.get(i))) {
                check=false;
                break;
              }
            }
            if (check) {
              Type st=sc.getType();
              if (!fastHierachy.canStoreType(st,declaredType)) {
                if (!sc.isFinal()) {
                  resolve(st,st,sigType,sm.getNumberedSubSignature(),container,targets);
                  types.add(new Pair<Type,NumberedString>(st,sm.getNumberedSubSignature()));
                }
              }
 else {
                resolve(st,declaredType,sigType,subSig,container,targets);
                types.add(new Pair<Type,NumberedString>(st,subSig));
              }
            }
          }
        }
      }
    }
 else {
      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);
  }
}