Author: tolusha
Date: 2011-06-06 04:48:55 -0400 (Mon, 06 Jun 2011)
New Revision: 4478
Modified:
kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/SecurityHelper.java
Log:
EXOJCR-1365: commented out code: use privileged action only when SecurityManager is
installed.
Modified:
kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/SecurityHelper.java
===================================================================
---
kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/SecurityHelper.java 2011-06-06
08:10:53 UTC (rev 4477)
+++
kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils/SecurityHelper.java 2011-06-06
08:48:55 UTC (rev 4478)
@@ -281,12 +281,12 @@
*/
public static <E> E doPrivilegedAction(PrivilegedAction<E> action)
{
-// if (System.getSecurityManager() != null)
+ if (System.getSecurityManager() != null)
{
// A security manager has been established
return AccessController.doPrivileged(action);
}
-// return action.run();
+ return action.run();
}
/**
@@ -299,18 +299,18 @@
public static <E> E
doPrivilegedExceptionAction(PrivilegedExceptionAction<E> action)
throws PrivilegedActionException
{
-// if (System.getSecurityManager() != null)
+ if (System.getSecurityManager() != null)
{
// A security manager has been established
return AccessController.doPrivileged(action);
}
-/* try
+ try
{
return action.run();
}
catch (Exception e)
{
throw new PrivilegedActionException(e);
- }*/
+ }
}
}
Show replies by date