| Steve Ebersole], yes Envers uses Javassist in a few select places. The first is behind the AuditReader and AuditQueryCreator methods where we basically check if the supplied class is proxied and if so, get the source class instead of the proxy:
public static <T> Class<T> getTargetClassIfProxied(Class<T> clazz) {
if ( clazz == null ) {
return null;
}
else if ( ProxyFactory.isProxyClass( clazz ) ) {
return (Class<T>) clazz.getSuperclass();
}
return clazz;
}
The second usage is in MapProxyTool where we create a bean proxy instance backed by a map for dynamic components. |