groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwagenleit...@apache.org
Subject [2/2] groovy git commit: formatting
Date Sun, 04 Jun 2017 23:15:46 GMT
formatting


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/9c7504c0
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/9c7504c0
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/9c7504c0

Branch: refs/heads/master
Commit: 9c7504c0bc51212f7dd9f1bdfb99f705e86ce483
Parents: ddecb50
Author: John Wagenleitner <jwagenleitner@apache.org>
Authored: Sun Jun 4 16:09:48 2017 -0700
Committer: John Wagenleitner <jwagenleitner@apache.org>
Committed: Sun Jun 4 16:09:48 2017 -0700

----------------------------------------------------------------------
 .../reflection/AccessPermissionChecker.java     | 31 ++++++++++----------
 .../reflection/CacheAccessControlException.java |  2 +-
 .../groovy/reflection/CachedMethod.java         |  3 +-
 3 files changed, 18 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/9c7504c0/src/main/org/codehaus/groovy/reflection/AccessPermissionChecker.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/reflection/AccessPermissionChecker.java b/src/main/org/codehaus/groovy/reflection/AccessPermissionChecker.java
index 73f35a9..4ad0373 100644
--- a/src/main/org/codehaus/groovy/reflection/AccessPermissionChecker.java
+++ b/src/main/org/codehaus/groovy/reflection/AccessPermissionChecker.java
@@ -26,23 +26,24 @@ import java.security.AccessControlException;
 
 import groovy.lang.GroovyObject;
 
-class AccessPermissionChecker {
+final class AccessPermissionChecker {
 
     private static final ReflectPermission REFLECT_PERMISSION = new ReflectPermission("suppressAccessChecks");
 
+    private AccessPermissionChecker() {
+    }
+
     private static void checkAccessPermission(Class<?> declaringClass, final int modifiers,
boolean isAccessible) {
         final SecurityManager securityManager = System.getSecurityManager();
         if (securityManager != null && isAccessible) {
-                if (((modifiers & Modifier.PRIVATE) != 0
-                        || ((modifiers & (Modifier.PUBLIC | Modifier.PROTECTED)) == 0
-                             && packageCanNotBeAddedAnotherClass(declaringClass)))
-                        && !GroovyObject.class.isAssignableFrom(declaringClass))
{
-                        securityManager.checkPermission(REFLECT_PERMISSION);
-                }
-                else if ((modifiers & (Modifier.PROTECTED)) != 0
-                    && declaringClass.equals(ClassLoader.class)){
-                    securityManager.checkCreateClassLoader();
-                }
+            if (((modifiers & Modifier.PRIVATE) != 0
+                    || ((modifiers & (Modifier.PUBLIC | Modifier.PROTECTED)) == 0
+                    && packageCanNotBeAddedAnotherClass(declaringClass)))
+                    && !GroovyObject.class.isAssignableFrom(declaringClass)) {
+                securityManager.checkPermission(REFLECT_PERMISSION);
+            } else if ((modifiers & (Modifier.PROTECTED)) != 0 && declaringClass.equals(ClassLoader.class))
{
+                securityManager.checkCreateClassLoader();
+            }
         }
     }
 
@@ -60,7 +61,8 @@ class AccessPermissionChecker {
 
     private static CacheAccessControlException createCacheAccessControlExceptionOf(Method
method, AccessControlException e) {
         return new CacheAccessControlException(
-                "Groovy object can not access method " + method.getName()  + " cacheAccessControlExceptionOf
class " + method.getDeclaringClass().getName()
+                "Groovy object can not access method " + method.getName()
+                        + " cacheAccessControlExceptionOf class " + method.getDeclaringClass().getName()
                         + " with modifiers \"" + Modifier.toString(method.getModifiers())
+ "\"", e);
     }
 
@@ -74,10 +76,9 @@ class AccessPermissionChecker {
 
     private static CacheAccessControlException createCacheAccessControlExceptionOf(Field
field, AccessControlException e) {
         return new CacheAccessControlException(
-                "Groovy object can not access field " + field.getName()  + " cacheAccessControlExceptionOf
class " + field.getDeclaringClass().getName()
+                "Groovy object can not access field " + field.getName()
+                        + " cacheAccessControlExceptionOf class " + field.getDeclaringClass().getName()
                         + " with modifiers \"" + Modifier.toString(field.getModifiers())
+ "\"", e);
     }
 
-    private AccessPermissionChecker() {}
-
 }

http://git-wip-us.apache.org/repos/asf/groovy/blob/9c7504c0/src/main/org/codehaus/groovy/reflection/CacheAccessControlException.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/reflection/CacheAccessControlException.java b/src/main/org/codehaus/groovy/reflection/CacheAccessControlException.java
index b1438ec..c538813 100644
--- a/src/main/org/codehaus/groovy/reflection/CacheAccessControlException.java
+++ b/src/main/org/codehaus/groovy/reflection/CacheAccessControlException.java
@@ -20,7 +20,7 @@ package org.codehaus.groovy.reflection;
 
 import groovy.lang.GroovyRuntimeException;
 
-public class CacheAccessControlException extends GroovyRuntimeException{
+public class CacheAccessControlException extends GroovyRuntimeException {
     public CacheAccessControlException(String message, Throwable cause) {
         super(message, cause);
     }

http://git-wip-us.apache.org/repos/asf/groovy/blob/9c7504c0/src/main/org/codehaus/groovy/reflection/CachedMethod.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/reflection/CachedMethod.java b/src/main/org/codehaus/groovy/reflection/CachedMethod.java
index f49bad8..64d9098 100644
--- a/src/main/org/codehaus/groovy/reflection/CachedMethod.java
+++ b/src/main/org/codehaus/groovy/reflection/CachedMethod.java
@@ -91,8 +91,7 @@ public class CachedMethod extends MetaMethod implements Comparable {
     public final Object invoke(Object object, Object[] arguments) {
         try {
             AccessPermissionChecker.checkAccessPermission(cachedMethod);
-        }
-        catch (CacheAccessControlException ex) {
+        } catch (CacheAccessControlException ex) {
             throw new InvokerInvocationException(ex);
         }
         try {


Mime
View raw message