如何从java代码中使用Java ASM来检测方法?

时间:2017-03-14 17:56:03

标签: java eclipse bytecode java-bytecode-asm

我是使用ASM库的新手。

1-i必须在代码中找到类的数量 2 - 哪个类调用哪个方法,(调用者类) 3 - 每个方法由哪个类

调用

源代码

    public class Start {
public static void main(String[] args) {
    Cls1 c1=new Cls1();
    Cls2 c2=new Cls2();

    c1.m2c1();
    }

}

公共类Cls1 {

 int var1;
 int var2;
 String name;
 boolean bool;
 Cls1()
 {
    var1 = this.var1;
    var1 = this.var1;
    name = this.name;
    bool = this.bool;


 }
 Cls2 cl2=new Cls2();
 int z=cl2.m1c2(5,6);

 public int m1c1(int x,int y)
 {
     return x+y;
 }

 public void m2c1()
 {
     System.out.println("From m2c1  z= "+z);
 }

}

公共类Cls2 {

 public int m1c2(int x,int y)
 {
     return x+y;
 }

}

我不知道我是怎么做这个项目的。

0 个答案:

没有答案