-
Notifications
You must be signed in to change notification settings - Fork 867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor TypeInstrumentation#transformers() method #3019
Refactor TypeInstrumentation#transformers() method #3019
Conversation
If |
I would suggest splitting this into at least two commits to make it easier to review. (one with the API change, another with all the instrumentation changes) |
Add TypeInstrumentation and its implementations
Use the new method in all existing TypeInstrumentation implementations
e9c1241
to
be92d78
Compare
That's a good idea, done. The first commit in this PR contains all the API changes, the second one is just changing all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better.
@@ -30,8 +28,8 @@ | |||
} | |||
|
|||
@Override | |||
public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will not miss this method signature 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
This PR was inspired by DataDog's
AdviceTransformation
interface introduced in DataDog/dd-trace-java#2673 (FYI @tylerbenson)I've changed the
TypeInstrumentation
interface and introducedTypeTransformer
:This has several merits:
The PR is has lots of changed files, but 98% of it is just changing all existing
TypeInstrumentation
s. The most interesting parts are injavaagent-extension-api
andjavaagent-tooling
.