DATACMNS-1324 - Introduced extensible proxy detection infrastructure.

Introduced ProxyUtils.getUserClass(…) that by default is basically a facade for Spring's ClassUtils.getUserClass(…) but allows the registration of ProxyDetector implementations via Spring's SpringFactoriesLoader mechanism.

Moved all existing usages of ClassUtils.getUserClass(…) to ProxyUtils.
This commit is contained in:
Oliver Gierke
2018-05-17 16:04:54 +02:00
parent 67d3f37da2
commit d73e0a1f8f
8 changed files with 180 additions and 10 deletions

View File

@@ -15,7 +15,7 @@
*/
package org.springframework.data.domain;
import org.springframework.util.ClassUtils;
import org.springframework.data.util.ProxyUtils;
/**
* Support for query by example (QBE). An {@link Example} takes a {@code probe} to define the example. Matching options
@@ -69,10 +69,10 @@ public interface Example<T> {
* CGLIB-generated subclass.
*
* @return
* @see ClassUtils#getUserClass(Class)
* @see ProxyUtils#getUserClass(Class)
*/
@SuppressWarnings("unchecked")
default Class<T> getProbeType() {
return (Class<T>) ClassUtils.getUserClass(getProbe().getClass());
return (Class<T>) ProxyUtils.getUserClass(getProbe().getClass());
}
}