You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Taha Ghasemi (JIRA)" <ji...@apache.org> on 2013/04/04 10:47:16 UTC

[jira] [Created] (OWB-810) (public or protected) Observer methods don't get intercepted in the first firing of the event

Taha Ghasemi created OWB-810:
--------------------------------

             Summary: (public or protected) Observer methods don't get intercepted in the first firing of the event
                 Key: OWB-810
                 URL: https://issues.apache.org/jira/browse/OWB-810
             Project: OpenWebBeans
          Issue Type: Bug
          Components: Events
    Affects Versions: 1.1.7
         Environment: JRE 1.7
            Reporter: Taha Ghasemi


If an observer method has an interceptor, the interceptor isn't called by OWB in the first firing of the event. While this is expected for private observer methods (as they can't be proxied), for public or protected methods this is a bug.

Apparently, the root problem is in ObserverMethodImpl:notify which decides a method is private or not based on this code:

boolean isPrivateMethod = !observerMethod.isAccessible() ;

And then make the method accessible if it is not. By default, all reflected objects are inaccessible so even public methods in the first time treated as private and thus the obtained object is not a proxy. 

In addition, with the above code, the private methods are detected properly in the first time, but in the next times they treated as non-private methods which is wrong.

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