Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2130

Do not log WELD-000411 for CDI 1.0 bean archives

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Won't Do
    • Minor
    • None
    • None
    • Extensions
    • None

    Description

      The WELD-000411 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 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:

      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.
      

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            astefanu@redhat.com Antonin Stefanutti
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: