[jboss-cvs] JBossAS SVN: r111400 - projects/security/security-jboss-sx/branches/2.0.4.SP4_SECURITY-594/identity/src/main/java/org/jboss/security/identity/plugins.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed May 18 16:04:19 EDT 2011


Author: dehort
Date: 2011-05-18 16:04:19 -0400 (Wed, 18 May 2011)
New Revision: 111400

Modified:
   projects/security/security-jboss-sx/branches/2.0.4.SP4_SECURITY-594/identity/src/main/java/org/jboss/security/identity/plugins/SimpleRoleGroup.java
Log:
Checking in a potential fix for a ConcurrentModificationException that happens in the SimpleRoleGroup
[SECURITY-594]


Modified: projects/security/security-jboss-sx/branches/2.0.4.SP4_SECURITY-594/identity/src/main/java/org/jboss/security/identity/plugins/SimpleRoleGroup.java
===================================================================
--- projects/security/security-jboss-sx/branches/2.0.4.SP4_SECURITY-594/identity/src/main/java/org/jboss/security/identity/plugins/SimpleRoleGroup.java	2011-05-18 19:55:43 UTC (rev 111399)
+++ projects/security/security-jboss-sx/branches/2.0.4.SP4_SECURITY-594/identity/src/main/java/org/jboss/security/identity/plugins/SimpleRoleGroup.java	2011-05-18 20:04:19 UTC (rev 111400)
@@ -25,6 +25,7 @@
 import java.security.acl.Group;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Collection;
 import java.util.Enumeration;
 import java.util.List;
 import java.util.Set;
@@ -173,7 +174,7 @@
       {
          //Dealing with another roleGroup
          RoleGroup anotherRG = (RoleGroup) anotherRole;
-         List<Role> anotherRoles = anotherRG.getRoles();
+         Collection<Role> anotherRoles = Collections.synchronizedCollection(anotherRG.getRoles());
          for (Role r : anotherRoles)
          {
             //if any of the roles are not there, no point checking further
@@ -193,7 +194,7 @@
    {
       if (anotherRole == null)
          throw new IllegalArgumentException("anotherRole is null");
-      List<Role> roleList = anotherRole.getRoles();
+      Collection<Role> roleList = Collections.synchronizedCollection(anotherRole.getRoles());
       for (Role r : roleList)
       {
          if (this.containsAll(r))
@@ -238,4 +239,4 @@
       builder.append(")");
       return builder.toString();
    }
-}
\ No newline at end of file
+}



More information about the jboss-cvs-commits mailing list