From ea99603d745c4370738dfbcc2877727f7f276a5c Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Sat, 18 Sep 2010 21:19:48 +0000 Subject: QPID-2869: prevent entering the source queue as destination git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@998548 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'java') diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java b/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java index 6fece81e88..ec6fb1f8de 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java +++ b/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java @@ -1114,6 +1114,10 @@ public class SimpleAMQQueue implements AMQQueue, Subscription.StateListener { throw new IllegalArgumentException("Queue '" + queueName + "' is not registered with the virtualhost."); } + else if (toQueue == this) + { + throw new IllegalArgumentException("The destination queue cant be the same as the source queue"); + } List entries = getMessagesOnTheQueue(new QueueEntryFilter() { @@ -1188,6 +1192,10 @@ public class SimpleAMQQueue implements AMQQueue, Subscription.StateListener { throw new IllegalArgumentException("Queue '" + queueName + "' is not registered with the virtualhost."); } + else if (toQueue == this) + { + throw new IllegalArgumentException("The destination queue cant be the same as the source queue"); + } List entries = getMessagesOnTheQueue(new QueueEntryFilter() { -- cgit v1.2.1