How to extend a final class?(Reflection, Javassist)
问题 I have a .JAR file and it has tons of classes. One, that I need is set as final, so I cannot extend it. There is one method, that I basically have to extend and fix, otherwise everything breaks. How can I do that? I know Reflection and Javassist can be used for this, but I have no idea how. Any other tool is also acceptable, as long as it works. 回答1: You can't use reflection to modify existing class definitions. If the licence of that JAR allows you to, I would suggest a different solution: