getappmap / getappmap/appmap-java
CannotCompileException thrown while recording
还没有人认领这个 Issue。
- 主要语言
- Java
- 星标
- 88
- 派生
- 17
- 平均合并
- 2 天 2 小时
- 30 天内合并 PR
- 1
描述
Scenario 1 :
Suppose we have an interface Parent with method foo declared in it, another interface Child which extends Parent, and has method bar in it. Now we have written a class Implementation which implements interface Child and have method bodies for foo and bar. Now suppose we have hooked Parent class with our HookClassSystem and have written methods to capture events for this interface. Now during runtime, when foo is called on an object of Implementation, event will get captured as expected. However, this won't be same for bar method's execution. The point of interest is match method in HookClassSystem. It will return true for both methods as their declaring class Implementation is child of Parent. The problem will occur when Hook.apply method gets called for foo and bar behaviours. foo method will have respective method to capture event in appmap-java codebase as we have consciously added it. however, for bar , which was unexpected, will result in a failed to compile message when appropriate event capturing method is not found in appmap-java.
Scenario 2 :
Same situation may occur when a class implements multiple interfaces, out of which we have hooked one interface using HookClassSystem
Scenario 1 can be seen with spring-petclinic where we have hooked java.sql.Statement.
error message failed to compile can be seen using remote recording script : ./appmap_remote.sh ./tmp/appmap
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先跟踪 HookClassSystem.match 和 Hook.apply,然后针对所述的 spring-petclinic 场景,使用 ./appmap_remote.sh ./tmp/appmap 重现失败。检查对接口进行 hook 时,继承的方法和多个接口中的方法是如何处理的。完成的标准是:即使存在意外的方法,记录也不再因编译失败,并且被 hook 的接口方法仍能继续捕获事件。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- devtools
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100