groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwagenleitner <...@git.apache.org>
Subject [GitHub] groovy pull request #532: Prevent CachedField and CachedMethod from leaking ...
Date Sat, 13 May 2017 20:20:19 GMT
Github user jwagenleitner commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/532#discussion_r116365354
  
    --- Diff: src/main/org/codehaus/groovy/reflection/CachedMethod.java ---
    @@ -90,6 +91,12 @@ public CachedClass getDeclaringClass() {
     
         public final Object invoke(Object object, Object[] arguments) {
             try {
    +            AccessPermissionChecker.checkAccessPermission(cachedMethod);
    +        }
    +        catch (AccessControlException ex) {
    +            throw new InvokerInvocationException(new IllegalArgumentException("Illegal
access to method" + cachedMethod.getName()));
    --- End diff --
    
    Throwing an `IllegalArgumentException` could be confusing since it's not the `arguments`
passed to the invoked method causing the problem.  Maybe
    
    `throw new InvokerInvocationException(ex)`
    
    or 
    
    ```
    throw new InvokerInvocationException(
            new AccessControlException("Illegal access to method" + cachedMethod.getName(),
ex)
    )
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message