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

Misleading definition error for decorator with observer method

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Minor
    • None
    • 1.1.2.Final
    • None
    • None

    Description

      CDI 1.0 section 10.4.2 states:
      "Interceptors and decorators may not declare observer methods. If an interceptor or decorator has a method with a paramet-
      er annotated @Observes, the container automatically detects the problem and treats it as a definition error."

      Following definition error is detected for decorator with observer method: WELD-001419 - DECORATOR_CLASS_NOT_BEAN_CLASS_OF_DECORATOR

      New definition error like DECORATORS_CANNOT_HAVE_OBSERVER_METHODS would be more appropriate.

      TCK test for this scenario (CDI 1.1 master branch):
      https://github.com/jboss/cdi-tck/blob/master/impl/src/main/java/org/jboss/jsr299/tck/tests/decorators/definition/broken/observer/DecoratorWithObserverMethodTest.java

      Attachments

        Activity

          People

            rhn-engineering-jharting Jozef Hartinger
            mkouba@redhat.com Martin Kouba
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: