【发布时间】:2018-07-12 13:30:05
【问题描述】:
我有一个类似下面例子的案例
public String test(Trail trail) {
AnotherClass.access(trail);
this.executeAnotherMethod(trail);
futureCall(trail::end);
return "emptyString";
}
我想使用 byte-buddy 来做这样的事情
public String test(Trail trail) {
Trail clonedTrail = trail.clone("test");
AnotherClass.access(clonedTrail);
this.executeAnotherMethod(clonedTrail);
futureCall(clonedTrail::end);
return "emptyString";
}
我已经尝试Advice 来拦截调用,但是这弄乱了对象引用。我一直在研究 byte-buddy 测试用例以及阅读 ASM,但到目前为止还没有取得很大进展。
【问题讨论】:
标签: java reflection byte-buddy