[jboss-remoting-commits] JBoss Remoting SVN: r3845 - remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/jboss.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Wed Apr 2 00:12:05 EDT 2008


Author: ron.sigal at jboss.com
Date: 2008-04-02 00:12:05 -0400 (Wed, 02 Apr 2008)
New Revision: 3845

Modified:
   remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/jboss/LocalMarshalledValue.java
Log:
JBREM-934: Put Thread().getContextClassLoader() call in AccessController.doPrivileged() call.

Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/jboss/LocalMarshalledValue.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/jboss/LocalMarshalledValue.java	2008-04-02 04:11:26 UTC (rev 3844)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/serialization/impl/jboss/LocalMarshalledValue.java	2008-04-02 04:12:05 UTC (rev 3845)
@@ -36,6 +36,8 @@
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 /**
  * Does lazy serialization based on JBossSerialization.
@@ -84,7 +86,14 @@
    {
       try
       {
-         container.getCache().setLoader(Thread.currentThread().getContextClassLoader());
+         ClassLoader tcl = (ClassLoader) AccessController.doPrivileged( new PrivilegedAction()
+         {
+            public Object run()
+            {
+               return Thread.currentThread().getContextClassLoader();
+            }
+         });
+         container.getCache().setLoader(tcl);
          return container.getInput().readObject();
       }
       catch(RuntimeException e)




More information about the jboss-remoting-commits mailing list