In Spring HATEOAS we create proxies for the special purpose of recording method invocations on controllers. To do so, we have to proxy the return type of the controller method and those might contain final
methods. Those trigger some log output in CglibAopProxy
that the final methods cannot be properly intercepted. While this is very helpful information in general, in our special case it causes confusion with users to see this output because we will never actually invoke any method on the proxy but rather just inspect it via an introduced interface.
It would be nice to be able to configure the ProxyFactory
in a way that it skips the class validation so that we can opt into that mode.
Comment From: jhoeller
I've made this part of our existing optimize
flag which has a very general "perform aggressive optimizations" definition anyway. Previously that flag just enforced a CGLIB proxy similar to proxyTargetClass
; now it also suppresses class validation and therefore actually makes a difference...