Skip to content

Delete ClassInjector api#18112

Merged
trask merged 4 commits into
open-telemetry:mainfrom
laurit:delete-class-injector
Apr 22, 2026
Merged

Delete ClassInjector api#18112
trask merged 4 commits into
open-telemetry:mainfrom
laurit:delete-class-injector

Conversation

@laurit
Copy link
Copy Markdown
Contributor

@laurit laurit commented Apr 21, 2026

Resolves #16975

@laurit laurit assigned SylvainJuge and unassigned SylvainJuge Apr 21, 2026
@laurit laurit marked this pull request as ready for review April 21, 2026 08:33
@laurit laurit requested a review from a team as a code owner April 21, 2026 08:33
Copy link
Copy Markdown
Contributor

@SylvainJuge SylvainJuge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job on removing so much complexity !

"([Ljava/lang/Class;Ljava/lang/Class;)[Ljava/lang/Class;",
false);
if (isIndy) {
IndyBootstrap.invokeStatic(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With indy, this will invoke the ReflectionHelper.filterInterfaces method using invokedynamic. If I'm understanding this correctly we have to do this because the ReflectionInstrumentationModule is loaded in its own classloader and is thus not directly accessible to the instrumented class which is in the bootstrap CL. It could be worth adding some javadoc/comments to clarify this for future reference.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your understanding is correct. Added a comment. In boot loader we can't use exposedClassNames to make the helper class accessible. An alternative would be to use inline advice in this module.

@trask trask merged commit 31188f0 into open-telemetry:main Apr 22, 2026
93 checks passed
@laurit laurit deleted the delete-class-injector branch April 23, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

invokedynamic API promotion : injectClasses

3 participants