You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by nb...@apache.org on 2008/11/18 01:01:57 UTC

svn commit: r718443 - /velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureUberspector.java

Author: nbubna
Date: Mon Nov 17 16:01:56 2008
New Revision: 718443

URL: http://svn.apache.org/viewvc?rev=718443&view=rev
Log:
simplify getIterator and don't pass null to superclass version

Modified:
    velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureUberspector.java

Modified: velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureUberspector.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureUberspector.java?rev=718443&r1=718442&r2=718443&view=diff
==============================================================================
--- velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureUberspector.java (original)
+++ velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureUberspector.java Mon Nov 17 16:01:56 2008
@@ -75,22 +75,22 @@
      * @throws Exception
      */
     public Iterator getIterator(Object obj, Info i)
-    throws Exception
+        throws Exception
     {
-        if ((obj != null) && 
-                !((SecureIntrospectorControl) introspector)
-                .checkObjectExecutePermission(obj.getClass(),null))
+        if (obj != null)
         {
-            log.warn ("Cannot retrieve iterator from object of class " + 
-                    obj.getClass().getName() +
-                    " due to security restrictions.");
-            return null;
-
-        }
-        else
-        {
-            return super.getIterator(obj,i);
+            SecureIntrospectorControl sic = (SecureIntrospectorControl)introspector;
+            if (sic.checkObjectExecutePermission(obj.getClass(), null))
+            {
+                return super.getIterator(obj, i);
+            }
+            else
+            {
+                log.warn("Cannot retrieve iterator from " + obj.getClass() +
+                         " due to security restrictions.");
+            }
         }
+        return null;
     }
 
     /**