|
|
|
The WELD\-000411 warning INFO message is emitted for {{ProcessAnnotatedType}} lifecycle observer methods whose types is unbounded wildcard or {{Object}} and that do not use {{@WithAnnotations}}.
However, {{@WithAnnotations}} is CDI 1.1 and that leads to having the WELD\-000411 warning message emitted for CDI 1.0 applications that are executed in Weld 2.x.
For example, the Camel CDI still maintain compatibility with CDI 1.0 given the number of users that still depends on CDI 1.0. And the following warning is logged: {code} 2016-04-02 13:13:29,672 [main ] INFO Event - WELD-000411: Observer method [BackedAnnotatedMethod] private org.apache.camel.cdi.CdiCamelExtension.processAnnotatedType(@Observes ProcessAnnotatedType<?>) receives events for all annotated types. Consider restricting events using @WithAnnotations or a generic type with bounds. {code}
While that warning make sense for CDI 1.1+ applications, it would be ideal to avoid it for CDI 1.0 beans archives.
One way of detecting CDI 1.0 beans archives could be to rely on the {{version}} attribute of the {{beans.xml}} descriptor. The drawback being that this attribute is defined starting CDI 1.1. Though that may be an acceptable trade-off.
|
|
|
|