[cdi-dev] [JBoss JIRA] (CDI-277) Clarify inheritance behavior of observer methods

Arne Limburg (JIRA) jira-events at lists.jboss.org
Sat Oct 13 11:50:01 EDT 2012


    [ https://issues.jboss.org/browse/CDI-277?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12726215#comment-12726215 ] 

Arne Limburg commented on CDI-277:
----------------------------------

There are some more cases to be clarified:
{code}
public class BeanA {

    private void observer1(@Observes Event1 event1) {
    }

    public void observer2(@Observes Event2 event2) {
    }

    private static void observer3(@Observes Event3 event3) {
    }

    public static void observer4(@Observes Event4 event4) {
    }
}

public class BeanB extends BeanA {

    private void observer1(@Observes Event1 event1) {
    }

    public void observer2(@Observes Event2 event2) {
    }

    private static void observer3(@Observes Event3 event3) {
    }

    public static void observer4(@Observes Event4 event4) {
    }
}

@Specializes
public class BeanC extends BeanA {

    private void observer1(@Observes Event1 event1) {
    }

    public void observer2(@Observes Event2 event2) {
    }

    private static void observer3(@Observes Event3 event3) {
    }

    public static void observer4(@Observes Event4 event4) {
    }
}
{code}
We need to clarify which methods on which instance get called on event1, event2, event3 and event4!
                
> Clarify inheritance behavior of observer methods
> ------------------------------------------------
>
>                 Key: CDI-277
>                 URL: https://issues.jboss.org/browse/CDI-277
>             Project: CDI Specification Issues
>          Issue Type: Clarification
>            Reporter: Arne Limburg
>
> Chapter 4.2 of the (1.0) spec misses a bullet point about inheritance of observer methods.
> Either
> - If X declares a non-static observer method x() then Y does inherit this method.
> or
> - If X declares a non-static observer method x() then Y does not inherit this method.
> (This behavior is different to what is defined in the Common Annotations for the Java Platform specification.)
> should be added.
> Don't know, what's right through...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the cdi-dev mailing list