Author: ron.sigal(a)jboss.com
Date: 2008-03-20 21:31:59 -0400 (Thu, 20 Mar 2008)
New Revision: 3699
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java
Log:
JBREM-934: Put System.getProperty() and System.getProperty() in
AccessController.doPrivileged() call.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java 2008-03-21 01:31:14
UTC (rev 3698)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/Version.java 2008-03-21 01:31:59
UTC (rev 3699)
@@ -22,6 +22,13 @@
package org.jboss.remoting;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+import org.jboss.remoting.loading.ClassByteClassLoader;
+
/**
* @author <a href="mailto:tom.elrod@jboss.com">Tom Elrod</a>
*/
@@ -48,7 +55,15 @@
static
{
boolean precompatibleFlag = false;
- String precompatible = System.getProperty(PRE_2_0_COMPATIBLE);
+ String precompatible = (String)AccessController.doPrivileged( new
PrivilegedAction()
+ {
+ public Object run()
+ {
+ return System.getProperty(PRE_2_0_COMPATIBLE);
+ }
+ });
+
+
if(precompatible != null && precompatible.length() > 0)
{
precompatibleFlag = Boolean.valueOf(precompatible).booleanValue();
@@ -61,7 +76,15 @@
}
else
{
- String userDefinedVersion = System.getProperty(REMOTING_VERSION_TO_USE);
+ String userDefinedVersion = (String) AccessController.doPrivileged( new
PrivilegedAction()
+ {
+ public Object run()
+ {
+ return System.getProperty(REMOTING_VERSION_TO_USE);
+ }
+ });
+
+
if(userDefinedVersion != null && userDefinedVersion.length() > 0)
{
byte userByteVersion = new Byte(userDefinedVersion).byteValue();
@@ -81,7 +104,14 @@
}
else
{
- System.setProperty(REMOTING_VERSION_TO_USE, new
Byte(defaultByteVersion).toString());
+ AccessController.doPrivileged( new PrivilegedAction()
+ {
+ public Object run()
+ {
+ System.setProperty(REMOTING_VERSION_TO_USE, new
Byte(defaultByteVersion).toString());
+ return null;
+ }
+ });
}
}
}
Show replies by date