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

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

Daniel Sachse created OWB-711:
---------------------------------

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


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 an patch file for the tests which do of course at the moment fail ;)

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

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

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13474012#comment-13474012 ] 

Mark Struberg commented on OWB-711:
-----------------------------------

That's a no-brainer: OwbBean#isEnabled() 

Congratulations Arne, you did win this very issue - gonna assign it to you, thanks ;)
                
> 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

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

Posted by "Daniel Sachse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13475676#comment-13475676 ] 

Daniel Sachse commented on OWB-711:
-----------------------------------

"From my point of view it would be illegal to call the observer methods from a superclass, if the subclass defines @Specializes althouth observer methods should in general be called." should have been:
"From my point of view it would be illegal to call the observer methods from a superclass, if the subclass defines @Specializes althouth observer methods in general should be inherited."
                
> 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: Arne Limburg
>              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

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

Posted by "Arne Limburg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13475556#comment-13475556 ] 

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

Daniel, thanks for reporting this.
But I am not really sure, if the requested behavior is correct in all cases:

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

the second and the fourth scenario where bugs in OWB and are now fixed :-)
About the first and the third scenario, I am not sure about the correct behavior. In fact this has nothing to do with specialization at all (btw. the bug was not limited to specialization, too). The question is, if observer methods are inherted at all. If that is the case, then the OWB behavior in the first and third behavior are perfectly fine. But the spec is not clear about this (chapter 4.2 misses a bullet point about this).
I have added a clarification request to the spec: https://issues.jboss.org/browse/CDI-277
                
> 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: Arne Limburg
>              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

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

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13490575#comment-13490575 ] 

Mark Struberg commented on OWB-711:
-----------------------------------

This is also related to OWB-675, so we have much more to clean up it seems.

@Specialized beans will not get hit by our events because they are not enabled - I hope so at least ;)
and removing overridden methods from our list of observerMethods should be done for all beans imo.
                
> 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: Arne Limburg
>              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

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

Posted by "Daniel Sachse (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Sachse updated OWB-711:
------------------------------

    Attachment: Observer, Alternative, Specialize.patch

Patch for the tests I created to show the bugs.
                
> 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
>              Labels: patch
>         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 an patch file for the tests which do of course at the moment fail ;)

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

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

Posted by "Arne Limburg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13475635#comment-13475635 ] 

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

Hi Mark,

Yes, you are right about the needed clarifications. OWB will behave that way from 1.1.7 on.
As you wrote, a private observer method in a superclass cannot be disabled at all...
Static methods cannot be overridden, but should not belong to beans of subclasses. I completely missed that case and I belief OWB acts wrong here. I will create a separate ticket for that case.
So imho static observer methods should be disabled if the bean of that class is disabled (regardless of being subclassed) i.e. by specialization.

                
> 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: Arne Limburg
>              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

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

Posted by "Arne Limburg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13475564#comment-13475564 ] 

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

Cases two and four are fixed.
For scenario one and three, you have to override the observer methods without the @Observer annotation to get the behavior you want.
                
> 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: Arne Limburg
>              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

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

Posted by "Arne Limburg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13475562#comment-13475562 ] 

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

And there was another bug: When the subclass overrides the observer method but does not declare the @Observes annotation, the observer method is called anyway. I fixed this, too.
                
> 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: Arne Limburg
>              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

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

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13475569#comment-13475569 ] 

Mark Struberg commented on OWB-711:
-----------------------------------

JBoss Jira is down atm, so an uneducated question:

{quote}
10.2. Observer resolution 
An event is delivered to an observer method if:
• The observer method belongs to an enabled bean.
{quote}

In my opinion the following must get clarified:

1.) This bullet clearly disables veto() beans from receiving Observers.
2.) @Alternative has no influence on Observers at all! They do not disable beans but only affect the resolution process.
3.) A @Specializes class Y must be a subclass of anoter class X. If X defines an observe rmethod then this is also part of class Y and thus will get called.
4.) Any Reception.ALWAYS Observer method in X will NOT create a contextual instance of X but _only_ of type Y (as X is not an enabled bean)

What I'm asking me is how one can disable a private observe rmethod in it's superclass or a static observer method at all ^^ Probably only via Extensions.

                
> 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: Arne Limburg
>              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

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

Posted by "Arne Limburg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arne Limburg resolved OWB-711.
------------------------------

    Resolution: Fixed

I am closing it for now, as all the bugs I can see are fixed.

Thanks Daniel for the excellent test cases.

If the spec is clarified the other way, we can reopen it and fix scenario one and three.
                
> 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: Arne Limburg
>              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

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

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg updated OWB-711:
------------------------------

    Fix Version/s: 1.1.7
    
> 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

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

Posted by "Daniel Sachse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13475673#comment-13475673 ] 

Daniel Sachse commented on OWB-711:
-----------------------------------

Hey guys,

thanks for your effort so far.
To me, the situation regarding scenarios one and three is clearly stated in the specification(last paragraph of 4.3):
"When an enabled bean, as defined in Section 5.1.2, “Enabled and disabled beans”, specializes a second bean, we can be certain that the second bean is never instantiated or called by the container. Even if the second bean defines a producer or observer method, the method will never be called."
>From my point of view it would be illegal to call the observer methods from a superclass, if the subclass defines @Specializes althouth observer methods should in general be called.
WDYT?
                
> 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: Arne Limburg
>              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

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

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg resolved OWB-711.
-------------------------------

    Resolution: Fixed
    
> 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: Arne Limburg
>              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

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

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg reassigned OWB-711:
---------------------------------

    Assignee: Mark Struberg
    
> 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
>         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

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

Posted by "Arne Limburg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arne Limburg resolved OWB-711.
------------------------------

    Resolution: Fixed

Fixed, observer methods of specialized beans are now disabled
                
> 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: Arne Limburg
>              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

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

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg reopened OWB-711:
-------------------------------


It seems that we disable too much now. 
EventTest#testObserverCalledOnMostSpecializedInstance is now failing

please check with
mvn clean install -Ptck

I think we must only disable observer methods if they are overridden in a subclass.
                
> 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: Arne Limburg
>              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

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

Posted by "Arne Limburg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13474014#comment-13474014 ] 

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

Unfortunately the OwbBean is the (specialized) subclass here, which is enabled. But anyway, I see, how to fix it...
                
> 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: Arne Limburg
>              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

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

Posted by "Arne Limburg (JIRA)" <ji...@apache.org>.
    [ 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

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

Posted by "Arne Limburg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arne Limburg reopened OWB-711:
------------------------------


Daniel, I missed that sentence. You are right, from reading that, the method should not be called... Although to me this behavior feels strange and we definitely need to clarify inheritance in CDI 1.1.
But for now I'll fix it.
                
> 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: Arne Limburg
>              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

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

Posted by "Daniel Sachse (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Sachse updated OWB-711:
------------------------------

    Description: 
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 ;)

  was:
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 an patch file for the tests which do of course at the moment fail ;)

    
> 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
>              Labels: patch
>         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

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

Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OWB-711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg reassigned OWB-711:
---------------------------------

    Assignee: Arne Limburg  (was: Mark Struberg)
    
> 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: Arne Limburg
>              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