Index: acl/pom.xml
===================================================================
--- acl/pom.xml	(revision 113426)
+++ acl/pom.xml	(working copy)
@@ -2,7 +2,7 @@
    <parent>
       <groupId>org.jboss.security</groupId>
       <artifactId>jboss-security-spi-parent</artifactId>
-      <version>2.0.5.Final</version>
+      <version>2.0.6-SNAPSHOT</version>
       <relativePath>../parent</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
Index: assembly/pom.xml
===================================================================
--- assembly/pom.xml	(revision 113426)
+++ assembly/pom.xml	(working copy)
@@ -2,7 +2,7 @@
   <parent>
     <groupId>org.jboss.security</groupId>
     <artifactId>jboss-security-spi-parent</artifactId>
-    <version>2.0.5.Final</version>
+    <version>2.0.6-SNAPSHOT</version>
     <relativePath>../parent</relativePath>
   </parent>
   <modelVersion>4.0.0</modelVersion>
Index: authorization/pom.xml
===================================================================
--- authorization/pom.xml	(revision 113426)
+++ authorization/pom.xml	(working copy)
@@ -2,7 +2,7 @@
    <parent>
       <groupId>org.jboss.security</groupId>
       <artifactId>jboss-security-spi-parent</artifactId>
-      <version>2.0.5.Final</version>
+      <version>2.0.6-SNAPSHOT</version>
       <relativePath>../parent</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
Index: jboss-security-spi-as4/pom.xml
===================================================================
--- jboss-security-spi-as4/pom.xml	(revision 113426)
+++ jboss-security-spi-as4/pom.xml	(working copy)
@@ -2,7 +2,7 @@
   <parent>
     <groupId>org.jboss.security</groupId>
     <artifactId>jboss-security-spi-parent</artifactId>
-    <version>2.0.5.Final</version>
+    <version>2.0.6-SNAPSHOT</version>
     <relativePath>../parent</relativePath>
   </parent>
   <modelVersion>4.0.0</modelVersion>
Index: identity/pom.xml
===================================================================
--- identity/pom.xml	(revision 113426)
+++ identity/pom.xml	(working copy)
@@ -2,7 +2,7 @@
    <parent>
       <groupId>org.jboss.security</groupId>
       <artifactId>jboss-security-spi-parent</artifactId>
-      <version>2.0.5.Final</version>
+      <version>2.0.6-SNAPSHOT</version>
       <relativePath>../parent</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
Index: parent/pom.xml
===================================================================
--- parent/pom.xml	(revision 113426)
+++ parent/pom.xml	(working copy)
@@ -8,7 +8,7 @@
    <groupId>org.jboss.security</groupId>
    <artifactId>jboss-security-spi-parent</artifactId>
    <packaging>pom</packaging>
-   <version>2.0.5.Final</version>
+   <version>2.0.6-SNAPSHOT</version>
    <name>JBoss Security SPI - Parent</name>
    <url>http://labs.jboss.org/portal/jbosssecurity/</url>
    <description>JBoss Security is a cross cutting project that handles security for the JEMS projects</description>
Index: pom.xml
===================================================================
--- pom.xml	(revision 113426)
+++ pom.xml	(working copy)
@@ -2,7 +2,7 @@
    <parent>
       <groupId>org.jboss.security</groupId>
       <artifactId>jboss-security-spi-parent</artifactId>
-      <version>2.0.5.Final</version>
+      <version>2.0.6-SNAPSHOT</version>
       <relativePath>parent</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
Index: spi/src/main/java/org/jboss/security/SecurityContextUtil.java
===================================================================
--- spi/src/main/java/org/jboss/security/SecurityContextUtil.java	(revision 113426)
+++ spi/src/main/java/org/jboss/security/SecurityContextUtil.java	(working copy)
@@ -137,8 +137,7 @@
     */
    public void clearIdentities(Class<?> clazz)
    {
-      Set<Identity> resultSet = new HashSet<Identity>();
-      
+
       Set<Identity> ids  = this.securityContext.getSubjectInfo().getIdentities();
       if(ids != null)
       {
@@ -147,9 +146,8 @@
          {
             Identity id = iter.next();
             if(clazz.isAssignableFrom(id.getClass()))
-               resultSet.add(id);
+                this.securityContext.getSubjectInfo().removeIdentity(id);
          }
-         ids.removeAll(resultSet);
       }  
    }
    
Index: spi/src/main/java/org/jboss/security/SubjectInfo.java
===================================================================
--- spi/src/main/java/org/jboss/security/SubjectInfo.java	(revision 113426)
+++ spi/src/main/java/org/jboss/security/SubjectInfo.java	(working copy)
@@ -96,6 +96,11 @@
       identities.add(id);   
    }
    
+   public synchronized void removeIdentity( Identity id )
+   {
+      identities.remove( id );
+   }
+   
    @SuppressWarnings("unchecked")
    public synchronized <T> T getIdentity(Class<T> clazz)
    {
Index: spi/pom.xml
===================================================================
--- spi/pom.xml	(revision 113426)
+++ spi/pom.xml	(working copy)
@@ -2,7 +2,7 @@
    <parent>
       <groupId>org.jboss.security</groupId>
       <artifactId>jboss-security-spi-parent</artifactId>
-      <version>2.0.5.Final</version>
+      <version>2.0.6-SNAPSHOT</version>
       <relativePath>../parent</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
