diff options
Diffstat (limited to 'qpid/java')
| -rw-r--r-- | qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java index 6fece81e88..ec6fb1f8de 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java +++ b/qpid/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<QueueEntry> 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<QueueEntry> entries = getMessagesOnTheQueue(new QueueEntryFilter() { |
