From a72f26f0df75749a6655a86f72b46a056964fcfd Mon Sep 17 00:00:00 2001 From: Gary Tully Date: Thu, 9 Jul 2009 16:00:29 +0000 Subject: [PATCH] resolve https://issues.apache.org/activemq/browse/AMQ-2321 git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@792591 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/activemq/broker/BrokerService.java | 2 +- .../src/test/java/org/apache/activemq/broker/BrokerTest.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java b/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java index 08699af77c..e908c14ad9 100644 --- a/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java @@ -960,7 +960,7 @@ public class BrokerService implements Service { } public Service[] getServices() { - return (Service[]) services.toArray(); + return (Service[]) services.toArray(new Service[0]); } /** diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/BrokerTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/BrokerTest.java index 1742e2144e..1c5ae00106 100755 --- a/activemq-core/src/test/java/org/apache/activemq/broker/BrokerTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/broker/BrokerTest.java @@ -1741,6 +1741,10 @@ public class BrokerTest extends BrokerTestSupport { connection.request(createAck(consumerInfo, m3, 1, MessageAck.DELIVERED_ACK_TYPE)); } + public void testGetServices() throws Exception { + assertTrue(broker.getServices().length != 0); + } + public static Test suite() { return suite(BrokerTest.class); }