Adrninistrator / java-all-call-graph

Generate all call graph for Java Code.
Apache License 2.0
426 stars 110 forks source link

jacg_method_line_number_appname数据表存的方法对应起止行与实际java文件中不符 #45

Open kandy-wang opened 1 year ago

kandy-wang commented 1 year ago

image

xiongxt86 commented 1 year ago

明明是287,没有问题啊,287-290都lambda包含的,以起始行号为准

Adrninistrator commented 1 year ago

之前通过邮件回复的看起来没有生效,这里获取到的行号是java文件编译成class文件之后的值,可能和直观上从java代码里看到的行号会不完全一样,但结果是没有问题的 可以参考test模块中的这个类,test.call_graph.future.TestFuture

    public void test4() throws ExecutionException, InterruptedException {
        int b = 1;

        FutureTaskChild futureTaskChild = new FutureTaskChild(() -> {
            int a = 1;
            System.getProperty("");
            return null;
        });
        futureTaskChild.get();
    }

lambda表达式的方法行号是39-41,解析出来也是这样

gJcVWsWR4oY0AwzhA7Qufg==#032 | TestFuture | lambda$test4$0 | 39 | 41 | test.call_graph.future.TestFuture:lambda$test4$0()