byte-buddy icon indicating copy to clipboard operation
byte-buddy copied to clipboard

question: is it possible to set non-static final field with byte buddy?

Open pippoflow opened this issue 3 years ago • 1 comments

If someone extends a class which contains final fields, obviously some constructor in the class sets the final fields. Now the subclass (to be defined by byte buddy) wants to change the final fields, is this possible with byte buddy? If so, how? Thanks.

pippoflow avatar Jul 04 '22 07:07 pippoflow

No, Byte Buddy can only do what is possible in Java byte code and that's not possible.

What you can do is that you'd change the original class to set the field differently.

raphw avatar Jul 05 '22 18:07 raphw