[jboss-cvs] JBossAS SVN: r86534 - branches/JBPAPP_4_2_0_GA_CP/security/src/main/org/jboss/security.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Mar 31 09:33:57 EDT 2009
Author: mmoyses
Date: 2009-03-31 09:33:57 -0400 (Tue, 31 Mar 2009)
New Revision: 86534
Modified:
branches/JBPAPP_4_2_0_GA_CP/security/src/main/org/jboss/security/SimplePrincipal.java
Log:
JBPAPP-1841: system property is required to change equals behavior
Modified: branches/JBPAPP_4_2_0_GA_CP/security/src/main/org/jboss/security/SimplePrincipal.java
===================================================================
--- branches/JBPAPP_4_2_0_GA_CP/security/src/main/org/jboss/security/SimplePrincipal.java 2009-03-31 13:33:28 UTC (rev 86533)
+++ branches/JBPAPP_4_2_0_GA_CP/security/src/main/org/jboss/security/SimplePrincipal.java 2009-03-31 13:33:57 UTC (rev 86534)
@@ -21,7 +21,9 @@
*/
package org.jboss.security;
+import java.security.AccessController;
import java.security.Principal;
+import java.security.PrivilegedAction;
/**
* A simple String based implementation of Principal. Typically a
@@ -52,8 +54,14 @@
{
if (!(another instanceof Principal))
return false;
- if ("true".equals(System.getProperty(OVERRIDE_EQUALS_BEHAVIOR, "false")))
+ if ("true".equals(AccessController.doPrivileged(new PrivilegedAction()
{
+ public Object run()
+ {
+ return System.getProperty(OVERRIDE_EQUALS_BEHAVIOR, "false");
+ }
+ })))
+ {
if (!(another instanceof SimplePrincipal))
return false;
}
More information about the jboss-cvs-commits
mailing list