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 enhance thread construct method #1627

Open
githubcheng2978 opened this issue Apr 29, 2024 · 7 comments
Open

how to enhance thread construct method #1627

githubcheng2978 opened this issue Apr 29, 2024 · 7 comments
Assignees
Labels
Milestone

Comments

@githubcheng2978
Copy link

how to enhance thread construct method ?

@githubcheng2978
Copy link
Author

image it is not work~

@raphw
Copy link
Owner

raphw commented Apr 29, 2024

The Thread class will already be loaded, so you likely will need to apply retransformation. Typically, you'd also disable class format changes doing so. There's steps for both in the DSL.

@raphw raphw self-assigned this Apr 29, 2024
@raphw raphw added the question label Apr 29, 2024
@raphw raphw modified the milestones: 1.11.12, 1.12.14 Apr 29, 2024
@githubcheng2978
Copy link
Author

githubcheng2978 commented Apr 29, 2024 via email

@githubcheng2978
Copy link
Author

So, what should I do to intercept the thread's constructor?
Can you give me a dmeo?

@raphw
Copy link
Owner

raphw commented May 2, 2024

You can intercept a constructor just as any method. Intercept via ElementMatchers.isConstructor().

@githubcheng2978
Copy link
Author

image it is not work~~~

@raphw
Copy link
Owner

raphw commented May 8, 2024

skip the explicit retransformClasses.

Also, add .wtih(RetransformationStrategy.RETRANSFORM).disableClassFormatChanges().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants