Well, the current behaviour follows the spec...
manager.getReference(bean, Object.class, manager.createCreationalContext(bean));
So the returned contextual reference must implement the given/required bean type (Object) and all bean types of the bean which are Java interfaces.
On the other hand Weld proxies always implement all the bean types. The only special case happens if there is a non-proxyable type within the set of bean types (UriEndpointComponent in this case) - here the proxy implements the requested type + bean interfaces (if the requested type is proxyable) or a proxyable subtype if exists within the set of bean types. This fix was introduced in Weld 2.2.9.Final, see also
WELD-1834
. It works with Weld 1.1 because there is no unproxyable check during proxy creation.
I'm going to lower the priority of the bug. However, I will continue with investigation and will try to find out whether there is a better solution.
|