Thinking a bit more about this: couldn't we simply use the annotation type's class loader to load the proxy:
Class<T> proxyClass = ( Class<T> ) Proxy.getProxyClass( descriptor.type().getClassLoader(), descriptor.type() );
The documentation for Proxy#getProxyClass() says "All of the interface types must be visible by name through the specified class loader." Since we pass only one interface type, using that interface's loader seems best to me.
Thinking a bit more about this: couldn't we simply use the annotation type's class loader to load the proxy:
The documentation for Proxy#getProxyClass() says "All of the interface types must be visible by name through the specified class loader." Since we pass only one interface type, using that interface's loader seems best to me.