Lukas Jusko opened SPR-15458 and commented
Method isInstance(object) returns false even if object is instance of given type. When incoming object is JDK proxy, object.getClass() returns com.sun.Proxy class instead of proxied class. Then this method evaluates to false, even if I'd expect to be true. Works only for CGLib proxies.
No further details from SPR-15458
Comment From: spring-projects-issues
Juergen Hoeller commented
Would you expect a comparison against the target class behind the proxy here? What are you trying to match it against?
In general, dynamic proxy introspection is not within the scope of ResolvableType
, just like it isn't part of Class.isInstance
either...
Comment From: spring-projects-issues
Lukas Jusko commented
I do not access ResolvableType directly, it is called by DefaultListableBeanFactory#getBeanNamesForType method used in SpringComponentProvider, which enables injecting spring beans to Jersey realm. For dynamic proxies this method for the specified reason returns empty array, so I have to enable ApectJAutoProxy on individual component objects, which implement some interfaces.
Comment From: spring-projects-issues
Juergen Hoeller commented
Well, what type are you trying to request here? For dynamic proxies - like for any other exposed bean objects - only the implemented interfaces are going to match; this is currently by definition and quite natural from an OO perspective. Is this not working for you, or are you trying to match against the target type?
Comment From: snicoll
Closing due to the lack of feedback.