コード例 #1
0
ファイル: Hierarchy.java プロジェクト: Hounge/apkinspector
  /** Returns the target for the given SpecialInvokeExpr. */
  public SootMethod resolveSpecialDispatch(SpecialInvokeExpr ie, SootMethod container) {
    container.getDeclaringClass().checkLevel(SootClass.HIERARCHY);
    SootMethod target = ie.getMethod();
    target.getDeclaringClass().checkLevel(SootClass.HIERARCHY);

    /* This is a bizarre condition!  Hopefully the implementation is correct.
    See VM Spec, 2nd Edition, Chapter 6, in the definition of invokespecial. */
    if (target.getName().equals("<init>") || target.isPrivate()) return target;
    else if (isClassSubclassOf(target.getDeclaringClass(), container.getDeclaringClass()))
      return resolveConcreteDispatch(container.getDeclaringClass(), target);
    else return target;
  }