Closed githubcheng2978 closed 1 month ago
it is not work~
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.
Thank you very much for your answer.because lambda Runnable didn’t can be interceptor, so I want interceptor Thread construct method,then delegate lambda .
获取 Outlook for iOShttps://aka.ms/o0ukef
发件人: Rafael Winterhalter @.> 发送时间: Tuesday, April 30, 2024 12:46:10 AM 收件人: raphw/byte-buddy @.> 抄送: githubcheng2978 @.>; Author @.> 主题: Re: [raphw/byte-buddy] how to enhance thread construct method (Issue #1627)
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.
― Reply to this email directly, view it on GitHubhttps://github.com/raphw/byte-buddy/issues/1627#issuecomment-2083201404, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFISMWBFD4IMBLY2GVROWIDY7Z2NFAVCNFSM6AAAAABG5RVBKWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBTGIYDCNBQGQ. You are receiving this because you authored the thread.Message ID: @.***>
So, what should I do to intercept the thread's constructor? Can you give me a dmeo?
You can intercept a constructor just as any method. Intercept via ElementMatchers.isConstructor()
.
it is not work~~~
skip the explicit retransformClasses
.
Also, add .wtih(RetransformationStrategy.RETRANSFORM).disableClassFormatChanges()
.
how to enhance thread construct method ?