getappmap / getappmap/appmap-java

CannotCompileException thrown while recording

Open
#33 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
88
Forks
17
Avg merge
2d 2h
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing HookClassSystem.match and Hook.apply, then reproduce the failure with ./appmap_remote.sh ./tmp/appmap against the spring-petclinic scenario described. Check how inherited and multiple-interface methods are handled when an interface is hooked. Done means recording no longer fails to compile for unexpected methods while the hooked interface methods continue to capture events.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.