2016-12-12 9:13 GMT+01:00 Mark Struberg <strub...@yahoo.de.invalid>: > > > Am 11.12.2016 um 22:24 schrieb John D. Ament <johndam...@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)! > > Yep + "managed bean" doesn't mean "implementation" so Bus is very valid.
> LieGrue, > strub