Exemplo n.º 1
0
  /** Returns a list of possible targets for the given method and set of receiver types. */
  public List resolveAbstractDispatch(List classes, SootMethod m) {
    m.getDeclaringClass().checkLevel(SootClass.HIERARCHY);
    ArraySet s = new ArraySet();
    Iterator classesIt = classes.iterator();

    while (classesIt.hasNext()) s.addAll(resolveAbstractDispatch((SootClass) classesIt.next(), m));

    List l = new ArrayList();
    l.addAll(s);
    return Collections.unmodifiableList(l);
  }
Exemplo n.º 2
0
  /** Returns a list of implementers of c, excluding itself. */
  public List<SootClass> getImplementersOf(SootClass i) {
    i.checkLevel(SootClass.HIERARCHY);
    if (!i.isInterface()) throw new RuntimeException("interface needed; got " + i);

    checkState();

    Iterator<SootClass> it = getSubinterfacesOfIncluding(i).iterator();
    ArraySet set = new ArraySet();

    while (it.hasNext()) {
      SootClass c = it.next();

      set.addAll(getDirectImplementersOf(c));
    }

    ArrayList l = new ArrayList();
    l.addAll(set);

    return Collections.unmodifiableList(l);
  }