Closed lucas-myx closed 1 month ago
You can use a matcher that finds all field accessed in a method. That should be straight forward? You can match the field's declaring type, for example. Internal variables are never picked up.
Thank you for your response! I will try it out.
@raphw Sorry to inflict myself on you again like this! I need find all the member variables on
foo()
method, and then replace these field onbar()
method. I can useMemberSubstitution
replace field access onbar()
method, but I'm not quite sure how to find the member variables its using from afoo()
method firstly, because I don't know how many variables are used in this method, I need to find out all of them. as follow demo:So I want to ask can Bytebuddy find out member variables used in
foo()
method? Thank you very much for any suggestions!