Comments (2)
写了一个测试代码:
public class TestLambda {
public void testList() {
List<String> list = new ArrayList<>();
list.forEach(e -> testString(e));
}
private void testString(String data) {
System.out.println(data);
}
}
生成的方法调用关系如下:
M:1 test.call_graph.lambda.TestLambda:<init>() (O)java.lang.Object:<init>() 13 1
M:6 test.call_graph.lambda.TestLambda:testList() (O)java.util.ArrayList:<init>() 20 1
M:7 test.call_graph.lambda.TestLambda:testList() (D)java.util.function.Consumer:accept(test.call_graph.lambda.TestLambda) 21 1
M:8 test.call_graph.lambda.TestLambda:testList() (LM)test.call_graph.lambda.TestLambda:lambda$testList$1(java.lang.String) 21 1
M:9 test.call_graph.lambda.TestLambda:testList() (I)java.util.List:forEach(java.util.function.Consumer) 21 1
M:10 test.call_graph.lambda.TestLambda:testString(java.lang.String) (M)java.io.PrintStream:println(java.lang.String) 25 1
M:11 test.call_graph.lambda.TestLambda:lambda$testList$1(java.lang.String) (O)test.call_graph.lambda.TestLambda:testString(java.lang.String) 21 1
需要关注的调用关系如下:
M:8 test.call_graph.lambda.TestLambda:testList() (LM)test.call_graph.lambda.TestLambda:lambda$testList$1(java.lang.String) 21 1
M:11 test.call_graph.lambda.TestLambda:lambda$testList$1(java.lang.String) (O)test.call_graph.lambda.TestLambda:testString(java.lang.String) 21 1
M:10 test.call_graph.lambda.TestLambda:testString(java.lang.String) (M)java.io.PrintStream:println(java.lang.String) 25 1
可以看到,以下调用链是可以关联起来的
TestLambda:testList
TestLambda:lambda$testList$1
TestLambda:testString
testList方法需要通过lambda$testList$1方法再关联到testString,不知道这个能不能满足你的要求
from java-callgraph2.
可以满足,感谢
from java-callgraph2.
Related Issues (20)
- 新手村新手,环境问题 HOT 22
- 无法运行run.sh HOT 1
- method_call 缺少7,9信息 HOT 2
- class_annotation.txt缺少来自lombok的注解 HOT 1
- 指定目标是代码目录不是jar时,输出是空的。 HOT 6
- 如何进行源代码级别的处理? HOT 9
- 反射,异步,SDK调用等场景 HOT 4
- 什么时候支持jdk 17 语法的解析 HOT 2
- 实际代码中找不到<init>方法,但是在line_number这个文件中却有180多行,它是如何解析的?我要怎么check这个行号的正确性 HOT 1
- 为什么有的时候子类调用父类方法,method_call会有,有的时候却没有? HOT 4
- 方法的起始行号和结束行号不准 HOT 10
- Lombok注解无法解析出来,在method_annotaion.txt HOT 2
- 想做一个无数据库版本
- 可以支持kotlin吗? HOT 1
- 是否支持zip包解析?目前传入zip包后会报错 HOT 4
- 方法调用关系问题 HOT 5
- 使用过程中的几点疑问 HOT 1
- 生成方法调用关系的方法全路径名后自动拼接<aroundBody>的问题 HOT 2
- 关于类的继承/实现中泛型参数的关系 HOT 8
- 关于实现关系的 method_call 缺失和错误 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-callgraph2.