|
ValidationExtension expects a ProcessBean event to be fired right after the AfterBeanDiscovery.addBean() method is called. This is not the case for CDI 1.2 where, at the time AfterBeanDiscovery is fired, the set of registered beans only contains beans discovered by the container before the AfterBeanDiscovery event is fired (see also CDI-392 and BeanManager#getBeans() javadoc).
Actually, it's not very clear in the spec. I've sent a question to the cdi-dev mailing list (http://lists.jboss.org/pipermail/cdi-dev/2014-April/005034.html) and it seems the spec will be clarified, i.e. the Weld 2.2.0.Final implementation is correct.
In any case, ValidationExtension should be fixed.
|