[jira] [Created] (OGNL-222) MemberAccess.setup and restore not called on method access

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (OGNL-222) MemberAccess.setup and restore not called on method access

Gilles Sadowski (Jira)
Gavin Scott created OGNL-222:
--------------------------------

             Summary: MemberAccess.setup and restore not called on method access
                 Key: OGNL-222
                 URL: https://issues.apache.org/jira/browse/OGNL-222
             Project: Commons OGNL
          Issue Type: Bug
    Affects Versions: 3.0
            Reporter: Gavin Scott


OgnlRuntime.invokeMethod() directly calls AccessibleObject.setAccessible() rather than calling MemberAccess.setup() and restore().  The MemberAccess javadoc "This interface provides a hook for preparing for accessing members of objects." leads me to believe its methods should be called for method access.

--
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
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (OGNL-222) MemberAccess.setup and restore not called on method access

Gilles Sadowski (Jira)

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

Gavin Scott updated OGNL-222:
-----------------------------

    Attachment: ognl-222.patch

This patch calls MemberAccess.setup() and restore() instead of directly calling AccessibleObject.setAccessible() during method invocation.

Note that it always calls setup() and restore() even if the method is already accessible (public) -- that's my interpretation of the MemberAccess contract and the behavior seen in the existing field access.

Also note that in this patch the synchronized block in invokeMethod is always hit.  Its not clear to me if the synchronized block is needed -- it looks like the block was originally used to keep the cache coherent, a need which was removed in the merge that happened in r1188000.  If the synchronized block is intended to make sure that the method stays accessible through the actual method invocation, similar synchronized blocks are needed in getFieldValue(), etc as well.
               

> MemberAccess.setup and restore not called on method access
> ----------------------------------------------------------
>
>                 Key: OGNL-222
>                 URL: https://issues.apache.org/jira/browse/OGNL-222
>             Project: Commons OGNL
>          Issue Type: Bug
>    Affects Versions: 3.0
>            Reporter: Gavin Scott
>         Attachments: ognl-222.patch
>
>
> OgnlRuntime.invokeMethod() directly calls AccessibleObject.setAccessible() rather than calling MemberAccess.setup() and restore().  The MemberAccess javadoc "This interface provides a hook for preparing for accessing members of objects." leads me to believe its methods should be called for method access.

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