You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Mark Struberg (JIRA)" <ji...@apache.org> on 2015/04/12 21:03:13 UTC

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

     [ https://issues.apache.org/jira/browse/OWB-811?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg resolved OWB-811.
-------------------------------
       Resolution: Fixed
    Fix Version/s: 1.5.0
         Assignee: Mark Struberg

> (public or protected) Observer methods don't get intercepted in the first firing of the event
> ---------------------------------------------------------------------------------------------
>
>                 Key: OWB-811
>                 URL: https://issues.apache.org/jira/browse/OWB-811
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Events
>    Affects Versions: 1.1.7
>         Environment: JRE 1.7
>            Reporter: Taha Ghasemi
>            Assignee: Mark Struberg
>             Fix For: 1.5.0
>
>
> 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 was sent by Atlassian JIRA
(v6.3.4#6332)