[jboss-cvs] JBoss Messaging SVN: r2372 - trunk/src/main/org/jboss/jms/client/remoting.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Feb 20 16:55:32 EST 2007


Author: ovidiu.feodorov at jboss.com
Date: 2007-02-20 16:55:32 -0500 (Tue, 20 Feb 2007)
New Revision: 2372

Modified:
   trunk/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java
Log:
minor corrections related to http://jira.jboss.com/jira/browse/JBMESSAGING-863

Modified: trunk/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java	2007-02-20 20:30:19 UTC (rev 2371)
+++ trunk/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java	2007-02-20 21:55:32 UTC (rev 2372)
@@ -134,21 +134,26 @@
                String guid = new GUID().toString();
                int hash = guid.hashCode();
                
-               // Make sure the hash code is > 0.  See JBMESSAGING-863.
-               if (hash < 0)
+               // Make sure the hash code is > 0.
+               // See http://jira.jboss.org/jira/browse/JBMESSAGING-863.
+               while(hash <= 0)
                {
-                  if (hash == Integer.MIN_VALUE)
-                     hash = Integer.MAX_VALUE;
-                  else
-                     hash = -hash;
-               }
-               else
-               {
-                  while (hash == 0)
+                  if (hash == 0)
                   {
                      guid = new GUID().toString();
                      hash = guid.hashCode();
                   }
+                  if (hash < 0)
+                  {
+                     if (hash == Integer.MIN_VALUE)
+                     {
+                        hash = Integer.MAX_VALUE;
+                     }
+                     else
+                     {
+                        hash = -hash;
+                     }
+                  }
                }
                
                metadata.put(Client.CALLBACK_SERVER_PORT, Integer.toString(hash));




More information about the jboss-cvs-commits mailing list