Closed rupinder10 closed 6 days ago
You can register a custom annotation that binds the argument differently. Have a look at Advice.withCustomBinding().
Did you mean Advice.withCustomMapping() ?
From: Rafael Winterhalter @.> Sent: Sunday, December 3, 2023 11:29 AM To: raphw/byte-buddy @.> Cc: Rupinder Singh @.>; Author @.> Subject: Re: [raphw/byte-buddy] Instrumenting two methods with the same Advice class (Issue #1568)
You can register a custom annotation that binds the argument differently. Have a look at Advice.withCustomBinding().
— Reply to this email directly, view it on GitHubhttps://github.com/raphw/byte-buddy/issues/1568#issuecomment-1837531593, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB56UZY7O3HDUII76NX7ZDDYHSSG5AVCNFSM6AAAAABAE2OSUCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZXGUZTCNJZGM. You are receiving this because you authored the thread.Message ID: @.***>
Yes, indeed.
I have a class with two similar methods but with a different set of arguments. For example these are two methods:
The Advice class for instrumenting the first method is:
The instrumenting logic is the same for the second method but the argument number is 2 instead of 1. Is there a way for me to use the same Advice class for both methods or do I have to duplicate the code with just a different argument number ?