[jboss-remoting-commits] JBoss Remoting SVN: r3688 - remoting2/branches/2.x/src/tests/org/jboss/test/security.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Thu Mar 20 17:51:13 EDT 2008


Author: david.lloyd at jboss.com
Date: 2008-03-20 17:51:13 -0400 (Thu, 20 Mar 2008)
New Revision: 3688

Modified:
   remoting2/branches/2.x/src/tests/org/jboss/test/security/LoggingSecurityManager.java
Log:
Minor cleanup

Modified: remoting2/branches/2.x/src/tests/org/jboss/test/security/LoggingSecurityManager.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/security/LoggingSecurityManager.java	2008-03-20 20:55:51 UTC (rev 3687)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/security/LoggingSecurityManager.java	2008-03-20 21:51:13 UTC (rev 3688)
@@ -12,16 +12,16 @@
     public LoggingSecurityManager() {
     }
 
-    private static void logAndRethrow(SecurityException ex) {
-        ex.printStackTrace(System.err);
-        throw ex;
+    private static SecurityException logged(SecurityException se) {
+        se.printStackTrace(System.err);
+        return se;
     }
 
     public void checkPermission(final Permission perm) {
         try {
             super.checkPermission(perm);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -29,7 +29,7 @@
         try {
             super.checkPermission(perm, context);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -37,7 +37,7 @@
         try {
             super.checkCreateClassLoader();
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -45,7 +45,7 @@
         try {
             super.checkAccess(t);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -53,7 +53,7 @@
         try {
             super.checkAccess(g);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -61,7 +61,7 @@
         try {
             super.checkExit(status);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -69,7 +69,7 @@
         try {
             super.checkExec(cmd);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -77,7 +77,7 @@
         try {
             super.checkLink(lib);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -85,7 +85,7 @@
         try {
             super.checkRead(fd);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -93,7 +93,7 @@
         try {
             super.checkRead(file);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -101,7 +101,7 @@
         try {
             super.checkRead(file, context);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -109,7 +109,7 @@
         try {
             super.checkWrite(fd);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -117,7 +117,7 @@
         try {
             super.checkWrite(file);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -125,7 +125,7 @@
         try {
             super.checkDelete(file);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -133,7 +133,7 @@
         try {
             super.checkConnect(host, port);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -141,7 +141,7 @@
         try {
             super.checkConnect(host, port, context);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -149,7 +149,7 @@
         try {
             super.checkListen(port);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -157,7 +157,7 @@
         try {
             super.checkAccept(host, port);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -165,7 +165,7 @@
         try {
             super.checkMulticast(maddr);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -174,7 +174,7 @@
         try {
             super.checkMulticast(maddr, ttl);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -182,7 +182,7 @@
         try {
             super.checkPropertiesAccess();
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -190,7 +190,7 @@
         try {
             super.checkPropertyAccess(key);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -198,8 +198,7 @@
         try {
             return super.checkTopLevelWindow(window);
         } catch (SecurityException se) {
-            logAndRethrow(se);
-            return false; // not reached
+            throw logged(se);
         }
     }
 
@@ -207,7 +206,7 @@
         try {
             super.checkPrintJobAccess();
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -215,7 +214,7 @@
         try {
             super.checkSystemClipboardAccess();
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -223,7 +222,7 @@
         try {
             super.checkAwtEventQueueAccess();
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -231,7 +230,7 @@
         try {
             super.checkPackageAccess(pkg);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -239,7 +238,7 @@
         try {
             super.checkPackageDefinition(pkg);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -247,7 +246,7 @@
         try {
             super.checkSetFactory();
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -255,7 +254,7 @@
         try {
             super.checkMemberAccess(clazz, which);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 
@@ -263,7 +262,7 @@
         try {
             super.checkSecurityAccess(target);
         } catch (SecurityException se) {
-            logAndRethrow(se);
+            throw logged(se);
         }
     }
 }




More information about the jboss-remoting-commits mailing list