add a useful CodeConverter method:redirectMethodCallToStatic by shifujun · Pull Request #244 · jboss-javassist/javassist (original) (raw)
Redirect non-static method call to a static method call is very useful in AOP programing. But as a rookie of bytecode manipulation, we saw the doc of Javassist and the comments in CodeConverter.java, and we were thinking of it's very hard to do this. Because there is no such method in CodeConverter , the redirectMethod limit it with same invoke type, the insertBefore limit it with void return type.
In fact, it's very easy to accomplish. So I hope this PR can remain our rookies from using Bytecode level API😁.