英文:
Can Byte Buddy use the advice method to handle things like "==", "!=", "<", ">" in the program?
问题
我想在Java程序中使用Byte Buddy的advice方法来监视以下比较操作,例如
"1<2", "3>2", "param1!=null", "param3==param2"
这些比较操作可以使用Byte Buddy进行监视吗?例如使用
@Advice.OnMethodEnter
如果可能的话,是否有参考的示例代码?
英文:
I want to use Byte Buddy's advice method in a Java program to monitor the following comparisons, such as
"1<2", "3>2", "param1!=null", "param3==param2"
Can these comparison operators be monitored with Byte Buddy? Such as using
@Advice.OnMethodEnter
If it is possible, is there any sample code for reference?
答案1
得分: 0
建议无法做到这一点。通常情况下,将目标定为代码变动这样详细的元素并不太有意义,因为代码经常变动,但您需要使用 ASM 来操纵这样的代码。
英文:
Advice is not capable of this. Normally, it does not make much sense to aim for such detailed elements as code changes to frequently, but you would need to use ASM to manipulate such code.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论