diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2008-07-15 11:35:54 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2008-07-15 11:35:54 +0000 |
| commit | 5c732b199e21e34d942bbbadca3c25e1fcf6b101 (patch) | |
| tree | 2cc9f301cc22a3a8e88e4b2efd39acfa025c5bd5 /java | |
| parent | cd204dcc2a3eb8e040c4f41f77d71e391b24594d (diff) | |
| download | qpid-python-5c732b199e21e34d942bbbadca3c25e1fcf6b101.tar.gz | |
QPID-1175 : VirtualHost now validates that name is non-null and non-empty. Full protocol validation of the virtualhost name has not been performed.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@676883 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
| -rw-r--r-- | java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java | 5 | ||||
| -rw-r--r-- | java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java b/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java index 977bd84491..b25a56344e 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java +++ b/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java @@ -149,6 +149,11 @@ public class VirtualHost implements Accessable public VirtualHost(String name, Configuration hostConfig, MessageStore store) throws Exception { + if (name == null || name.length() == 0) + { + throw new IllegalArgumentException("Illegal name (" + name + ") for virtualhost."); + } + _name = name; _virtualHostMBean = new VirtualHostMBean(); diff --git a/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java b/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java index 45db47a1c3..98639f6970 100644 --- a/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java @@ -110,7 +110,7 @@ public class TxAckTest extends TestCase new LinkedList<RequiredDeliveryException>() ); AMQQueue queue = - AMQQueueFactory.createAMQQueueImpl(new AMQShortString("test"), false, null, false, new VirtualHost("", new MemoryMessageStore()), + AMQQueueFactory.createAMQQueueImpl(new AMQShortString("test"), false, null, false, new VirtualHost("test", new MemoryMessageStore()), null); for (int i = 0; i < messageCount; i++) |
