cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Struberg <strub...@yahoo.de.INVALID>
Subject Re: [DISCUSS] CDI Beans & BeanManager.getReference
Date Mon, 12 Dec 2016 08:13:05 GMT

> Am 11.12.2016 um 22:24 schrieb John D. Ament <johndament@apache.org>:
> 
> However, using bean.getBeanClass() is more correct.

Nope, read the spec paragraph for producer methods and fields:

11.1. The Bean interface
"• getBeanClass() returns the bean class of the managed bean or session bean or of the bean
that declares the producer method or field."

So for a producer method or field getBeanClass() will NOT give you the type of the produced
contextual instance but the class which _contains_ the producer!
Means relying on getBeanClass() to produce the proxy is plain wrong and Weld should not do
that (IF they do, did not verify that)!

LieGrue,
strub
Mime
View raw message