Skip to content
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

How to instrument static initializers? #2685

Closed
trask opened this issue Mar 31, 2021 · 0 comments
Closed

How to instrument static initializers? #2685

trask opened this issue Mar 31, 2021 · 0 comments
Assignees
Labels
contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome enhancement New feature or request stale

Comments

@trask
Copy link
Member

trask commented Mar 31, 2021

Instrumenting static initializers is useful if we want to execute some code on class initialization (since we can't typically execute code during transformation itself since that can load more classes which will then not be instrumented since transform() isn't called on classes loaded inside of transform()).

Not sure why not able to instrument them via normal TypeInstrumentation.transformers() advice, suspect maybe because the underlying class doesn't have a static initializer to instrument. We may need to use LoadedTypeInitializer, but that wasn't working for me either, need to investigate further.

see #2672 (comment)

@trask trask self-assigned this Mar 31, 2021
@iNikem iNikem added the enhancement New feature or request label Apr 1, 2021
@trask trask added contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome stale labels Aug 26, 2023
@trask trask closed this as completed Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

2 participants