Object Web, visit classes that are passed as parameter class value

不想你离开。 提交于 2019-12-13 04:25:34

问题


I want to visit classes that are passed in a method

I tried visitMethodInsn in my MethodVisitor but I get the method signature, not the class passed when it’s executed

public static class C { }

public static class B {
    void myMethod(Class clz) {
    }
}
public static class A {
    static B getB() {
        return new B();
    }
}

public static class Foo {
    public Foo() {
        A.getB().myMethod(C.class);
    }
}

So based on the code above, when visiting the Foo class I want to be noticed that C.class is being passed to myMethod in B.class

来源:https://stackoverflow.com/questions/56943191/object-web-visit-classes-that-are-passed-as-parameter-class-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!