Is it possible to monkey patch in Java?

后端 未结 9 548
有刺的猬
有刺的猬 2020-12-09 16:40

I don\'t want to discuss the merits of this approach, just if it is possible. I believe the answer to be \"no\". But maybe someone will surprise me!

Imagine you have

9条回答
  •  情话喂你
    2020-12-09 16:49

    Perhaps you could use Aspect Oriented Programming to trap calls to that function and return your own version instead?

    Spring offers some AOP functionality but there are other libraries that do it as well.

提交回复
热议问题