Description:
|
This issue has been raised a couple times (WELD-705 and WELD-1062) and marked as 'resolved' both times, but still appears broken in 1.1.8.Final?
The documentation for ProcessAnnotatedType says it allows "an extension class [to] process the annotations of a bean class before the container builds its metamodel". However this appears very brittle. For example, any attempt to touch the AnnotatedFields of an AnnotatedType breaks superclass injection?
I attach a sample that uses processAnnotationType. All it does is *recreate* each AnnotatedField and put it back into a new Set. This is sufficient to break superclass injection (CdiTest1.mConfigurationTest1 is null). Note that putting the *same* AnnotatedField (not a recreated version) back into the new Set works fine.
Of course for a real use case I would do something more useful to each AnnotatedField that simply recreating it. For example I would change its type (like Solder's @Exact does) or add additional annotations. But I wanted to keep the test case simple.
My code is very similar to that in the CDI Reference Guide: http://docs.jboss.org/weld/reference/latest/en-US/html/extend.html#d0e5057
|