From 24a380383777903d18ae5d6d535bc0dda23f05f6 Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Wed, 13 Mar 2013 15:39:18 +0000 Subject: QPID-3769 Applying a modified version of a patch from Siddesh Poyarekar. The original patch did a literal comparison of the address strings which can cause issues if it had white spaces. The modified version matches the type and name. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1456007 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/qpid/client/AMQDestination.java | 32 +++++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'qpid/java/client/src') diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java index f14b6d810b..58f7a465be 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java @@ -638,20 +638,38 @@ public abstract class AMQDestination implements Destination, Referenceable final AMQDestination that = (AMQDestination) o; - if (!_exchangeClass.equals(that._exchangeClass)) + if (_destSyntax != that.getDestSyntax()) { return false; } - if (!_exchangeName.equals(that._exchangeName)) + + if (_destSyntax == DestSyntax.ADDR) { - return false; + if (_addressType != that.getAddressType()) + { + return false; + } + if (!_name.equals(that.getAddressName())) + { + return false; + } } - if ((_queueName == null && that._queueName != null) || - (_queueName != null && !_queueName.equals(that._queueName))) + else { - return false; + if (!_exchangeClass.equals(that._exchangeClass)) + { + return false; + } + if (!_exchangeName.equals(that._exchangeName)) + { + return false; + } + if ((_queueName == null && that._queueName != null) || + (_queueName != null && !_queueName.equals(that._queueName))) + { + return false; + } } - return true; } -- cgit v1.2.1