Return-Path: Delivered-To: apmail-geronimo-activemq-commits-archive@www.apache.org Received: (qmail 49754 invoked from network); 29 Jul 2006 08:03:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Jul 2006 08:03:53 -0000 Received: (qmail 25073 invoked by uid 500); 29 Jul 2006 08:03:53 -0000 Delivered-To: apmail-geronimo-activemq-commits-archive@geronimo.apache.org Received: (qmail 25050 invoked by uid 500); 29 Jul 2006 08:03:52 -0000 Mailing-List: contact activemq-commits-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-commits@geronimo.apache.org Received: (qmail 25040 invoked by uid 99); 29 Jul 2006 08:03:52 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Jul 2006 01:03:52 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Jul 2006 01:03:52 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id EBD021A981A; Sat, 29 Jul 2006 01:03:31 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r426764 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java Date: Sat, 29 Jul 2006 08:03:31 -0000 To: activemq-commits@geronimo.apache.org From: jstrachan@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060729080331.EBD021A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jstrachan Date: Sat Jul 29 01:03:31 2006 New Revision: 426764 URL: http://svn.apache.org/viewvc?rev=426764&view=rev Log: fix for AMQ-839 - lets not use == but compare the connectionIDs by value when removing a clientID Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java?rev=426764&r1=426763&r2=426764&view=diff ============================================================================== --- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java (original) +++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java Sat Jul 29 01:03:31 2006 @@ -28,6 +28,7 @@ import org.apache.activemq.command.ActiveMQDestination; import org.apache.activemq.command.BrokerId; import org.apache.activemq.command.BrokerInfo; +import org.apache.activemq.command.ConnectionId; import org.apache.activemq.command.ConnectionInfo; import org.apache.activemq.command.ConsumerInfo; import org.apache.activemq.command.DestinationInfo; @@ -209,12 +210,18 @@ synchronized (clientIdSet) { ConnectionInfo oldValue = (ConnectionInfo) clientIdSet.get(clientId); // we may be removing the duplicate connection, not the first connection to be created - if (oldValue == info) { - clientIdSet.remove(clientId); + // so lets check that their connection IDs are the same + if (oldValue != null) { + if (isEqual(oldValue.getConnectionId(), info.getConnectionId())) { + clientIdSet.remove(clientId); + } } } - connections.remove(context.getConnection()); + } + + protected boolean isEqual(ConnectionId connectionId, ConnectionId connectionId2) { + return connectionId == connectionId2 || (connectionId != null && connectionId.equals(connectionId2)); } public Connection[] getClients() throws Exception {