You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Arne Limburg (JIRA)" <ji...@apache.org> on 2012/10/11 12:11:04 UTC

[jira] [Commented] (OWB-711) Specialization does not deactivate Observer methods in parent class

    [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13474010#comment-13474010 ] 

Arne Limburg commented on OWB-711:
----------------------------------

I took a look into it (as I just ran into a similar problem).
Basically this are two bugs in one:
The first bug is that we in general call observer methods of superclasses even if they are overridden, e.g.:
{code}
public abstract Superclass {
    public void observes(@Observes MyEvent event) {
    }
}
{code}
{code}
public Subclass extends Superclass {
    public void observes(@Observes MyEvent event) {
    }
}
{code}
In this case both methods are called...
This first bug I have fixed locally.

The second bug is, that we don't check, if an observer method belongs to a disabled bean. Currently I don't know when to do this...
                
> Specialization does not deactivate Observer methods in parent class
> -------------------------------------------------------------------
>
>                 Key: OWB-711
>                 URL: https://issues.apache.org/jira/browse/OWB-711
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Inheritance, Specialization
>    Affects Versions: 1.1.5
>            Reporter: Daniel Sachse
>            Assignee: Mark Struberg
>              Labels: patch
>             Fix For: 1.1.7
>
>         Attachments: Observer, Alternative, Specialize.patch
>
>
> I found some bugs regarding @Specializes and Observer methods.
> The scenarios:
> @Specializes Bean without overriding Observer-method: Observer gets called
> @Specializes Bean with Overridden Observer-method: Overridden Observer gets called twice
> @Alternative @Specializes Bean without overriding Observer-method: Observer gets called
> @Alternative @Specializes Bean with overridden Observer-method: Overridden Observer gets called twice
> I attached a patch file for the tests which do of course fail at the moment ;)

--
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