[jboss-remoting-commits] JBoss Remoting SVN: r3941 - remoting2/branches/2.x/src/main/org/jboss/remoting/loading.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Fri Apr 11 21:04:50 EDT 2008


Author: ron.sigal at jboss.com
Date: 2008-04-11 21:04:50 -0400 (Fri, 11 Apr 2008)
New Revision: 3941

Modified:
   remoting2/branches/2.x/src/main/org/jboss/remoting/loading/ObjectInputStreamWithClassLoader.java
Log:
JBREM-934: Replaced AccessController.doPrivileged() call with SecurityUtility.getDeclaredMethod().

Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/loading/ObjectInputStreamWithClassLoader.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/loading/ObjectInputStreamWithClassLoader.java	2008-04-12 01:03:37 UTC (rev 3940)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/loading/ObjectInputStreamWithClassLoader.java	2008-04-12 01:04:50 UTC (rev 3941)
@@ -22,18 +22,14 @@
 
 package org.jboss.remoting.loading;
 
-import java.beans.IntrospectionException;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.StreamCorruptedException;
 import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
 import java.util.HashMap;
 
 import org.jboss.logging.Logger;
-import org.jboss.util.propertyeditor.PropertyEditors;
+import org.jboss.remoting.util.SecurityUtility;
 
 
 /**
@@ -56,20 +52,7 @@
    {
       try
       {
-         try {
-            clearMethod = (Method) AccessController.doPrivileged( new PrivilegedExceptionAction()
-            {
-               public Object run() throws SecurityException, NoSuchMethodException
-               {
-                  return ObjectInputStream.class.getDeclaredMethod("clear", new Class[]{});
-               }
-            });
-         }
-         catch (PrivilegedActionException e)
-         {
-            throw (NoSuchMethodException) e.getCause();
-         }
-
+         clearMethod = SecurityUtility.getDeclaredMethod(ObjectInputStream.class, "clear", new Class[]{});
          clearMethod.setAccessible(true);
          
       } catch (SecurityException e) {




More information about the jboss-remoting-commits mailing list