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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With