Skip @Decorator
classes when instrumenting
#1045
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In CDI (Contexts and Dependency Injection) environments, classes annotated with
@Decorator
wrap other classes. Decorators implement the same interfaces but delegate to another class. See the Oracle docs.In general, the tracer should instrument the delegate (decorated class) and not the decorator. When the tracer instruments the decorator, it cause the CDI container to be confused about the interfaces of the decorator and crash on startup.
This pull request changes that behavior.
I added a CDI project that contains no instrumentation and just a test (like the vertx project). The test tests a specific crash that happened because of the interaction between the
RunnableCallableInstrumentation
andRunnableDecorator
. In the future, more instrumentation and/or tests can be added if necessary.