commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gavin Scott (JIRA)" <>
Subject [jira] [Updated] (OGNL-222) MemberAccess.setup and restore not called on method access
Date Tue, 18 Sep 2012 18:56:07 GMT


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

View raw message