Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can byteman trigger a rule on a lambda?

The latest Byteman documentation (4.0.16) mentions inner classes, but doesn't mention lambdas. I have a rule looking like:

RULE showdir
CLASS ReportService
METHOD lambda$retrieveReport$0
AT ENTRY
IF TRUE
DO System.out.println("XXXXXXXX");
ENDRULE

However it never seems to trigger. When I run bmsubmit without arguments it shows the rule but does not mention a trigger method. I have checked the method name with javap, and it's correct. I can trigger on other non-lambda methods of this class. I'm running AdoptOpenJdk 8 on Alpine Linux.

Does Byteman support lambdas? Do I need to do something else to have the rule trigger?

like image 822
David Plumpton Avatar asked Feb 11 '26 11:02

David Plumpton


1 Answers

Hmm, grabbing the name of the method which implements the body of the lambda out of a javap decompile is a neat trick for identifying the target method. I'm not sure why Byteman is failing to inject coe. Could you report this via the Byteman JIRA instance? I'll investigate and report the outcome on the JIRA. It may actually be possible to make this work.

like image 123
Byteman Project Avatar answered Feb 15 '26 16:02

Byteman Project



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!