Skip to content

匿名内部类会导致调用链终止 #74

@CemeteryWarden

Description

@CemeteryWarden

如题:

我在使用这个项目的时候遇到一个问题,我的代码大概长这样:

public class Main {
    public static void main(String[] args) {
        new NotFoundCallBack() {
            @Override
            public void execute() {
                doSomeThing();                            
            }
        };
    }

    static void doSomeThing() {

    }

}
interface NotFoundCallBack {
    void execute();
}

然后分析结果大概长这样:
cn.com.example.service.hna.HnaService:doSomeThing()
[0]#cn.com.example.service.hna.HnaService:doSomeThing
[1]# cn.com.example.service.hna.HnaService:access$000 (HnaService:52)
[2]# cn.com.example.service.hna.HnaService$2:execute (HnaService$2:133) !entry!

main 方法创建了一个匿名内部类并调用了他的 execute 方法,execute 又调用了 doSomeThing方法,当我指定 doSomeThing 并运行TestRunnerGenAllGraph4Callee以生成向上的调用链时,结果中没有 main 方法,链路中止在了 execute。

但我希望获得包括 main 方法在内的完整调用链路,请问我该怎么做呢?谢谢!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions