[jboss-cvs] JBossAS SVN: r94990 - projects/jboss-deployers/branches/vfs3/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 15 17:56:13 EDT 2009


Author: david.lloyd at jboss.com
Date: 2009-10-15 17:56:13 -0400 (Thu, 15 Oct 2009)
New Revision: 94990

Modified:
   projects/jboss-deployers/branches/vfs3/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/SecurityActions.java
Log:
This does not throw an exception anymore

Modified: projects/jboss-deployers/branches/vfs3/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/SecurityActions.java
===================================================================
--- projects/jboss-deployers/branches/vfs3/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/SecurityActions.java	2009-10-15 21:55:47 UTC (rev 94989)
+++ projects/jboss-deployers/branches/vfs3/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/SecurityActions.java	2009-10-15 21:56:13 UTC (rev 94990)
@@ -22,10 +22,8 @@
 package org.jboss.deployers.vfs.spi.structure.helpers;
 
 import java.io.IOException;
-import java.lang.reflect.UndeclaredThrowableException;
 import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
+import java.security.PrivilegedAction;
 
 import org.jboss.vfs.VirtualFile;
 
@@ -42,41 +40,28 @@
    { 
       FileActions PRIVILEGED = new FileActions() 
       { 
-         public Boolean isLeaf(final VirtualFile f) throws IOException
+         public boolean isLeaf(final VirtualFile f) throws IOException
          {
-            try 
-            { 
-               return AccessController.doPrivileged(new PrivilegedExceptionAction<Boolean>()
+            return AccessController.doPrivileged(new PrivilegedAction<Boolean>()
+            {
+               public Boolean run()
                {
-                  public Boolean run() throws Exception
-                  {
-                     return f.isLeaf();
-                  }
-               });
-            }
-            catch(PrivilegedActionException e) 
-            { 
-               Exception ex = e.getException();
-               if( ex instanceof IOException ) 
-                  throw (IOException) ex; 
-               else if( ex instanceof RuntimeException )
-                  throw (RuntimeException) ex;
-               else
-                  throw new UndeclaredThrowableException(ex); 
-            } 
+                  return Boolean.valueOf(f.isLeaf());
+               }
+            }).booleanValue();
          }
       }; 
 
       FileActions NON_PRIVILEGED = new FileActions() 
       {
-         public Boolean isLeaf(VirtualFile f) throws IOException
+         public boolean isLeaf(VirtualFile f) throws IOException
          {
             return f.isLeaf();
          }
          
       };
 
-      public Boolean isLeaf(VirtualFile f) throws IOException;
+      boolean isLeaf(VirtualFile f) throws IOException;
    } 
 
    static boolean isLeaf(VirtualFile f) throws IOException




More information about the jboss-cvs-commits mailing list