Is it possible to access local variables using the ByteBuddy Advice?

When intercepting a method implementation with, is @Adviceit possible to access local variables?

+4
source share
1 answer

No, it is not, and it is partly in design. The implementation of the method is supposed to be a private detail, while the tip adds code after and before the call, where the method signature is part of its API.

At some point, Byte Buddy may offer the opportunity to replace certain calls to fields and methods, but in such a way that you do not rely on the implementation.

, Byte Buddy AsmVisitorWrapper API ASM , , API Byte Buddy.

+2

Source: https://habr.com/ru/post/1667277/


All Articles