[jboss-cvs] JBossAS SVN: r62298 - branches/Branch_4_2/messaging/src/main/org/jboss/mq/sm.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Apr 12 06:52:04 EDT 2007


Author: adrian at jboss.org
Date: 2007-04-12 06:52:04 -0400 (Thu, 12 Apr 2007)
New Revision: 62298

Modified:
   branches/Branch_4_2/messaging/src/main/org/jboss/mq/sm/AbstractStateManager.java
Log:
[JBAS-4324] - Fix race condition in client id checking

Modified: branches/Branch_4_2/messaging/src/main/org/jboss/mq/sm/AbstractStateManager.java
===================================================================
--- branches/Branch_4_2/messaging/src/main/org/jboss/mq/sm/AbstractStateManager.java	2007-04-12 10:51:48 UTC (rev 62297)
+++ branches/Branch_4_2/messaging/src/main/org/jboss/mq/sm/AbstractStateManager.java	2007-04-12 10:52:04 UTC (rev 62298)
@@ -190,16 +190,12 @@
 
    public void addLoggedOnClientId(String ID) throws JMSException
    {
-      synchronized (loggedOnClientIds)
-      {
-         if (loggedOnClientIds.contains(ID))
-            throw new InvalidClientIDException("This client id '" + ID + "' is already registered!");
-      }
-      
       checkLoggedOnClientId(ID);
 
       synchronized (loggedOnClientIds)
       {
+         if (loggedOnClientIds.contains(ID))
+            throw new InvalidClientIDException("This client id '" + ID + "' is already registered!");
          loggedOnClientIds.add(ID);
       }
       if (log.isTraceEnabled())
@@ -384,4 +380,4 @@
          return buffer.toString();
       }
    }
-}
\ No newline at end of file
+}




More information about the jboss-cvs-commits mailing list