From 3f99c4b84613d88a9caba4cb4cf15f6cb0bb1a13 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Mon, 6 Jul 2020 21:45:27 -0400 Subject: [PATCH] ARTEMIS-2797 Fixing updateQueue on filter / fixing ActiveMQServerControlTest --- .../activemq/artemis/core/postoffice/impl/PostOfficeImpl.java | 2 +- .../integration/management/ActiveMQServerControlTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java index 0d6f89d271..04b5c9ce7b 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java @@ -701,7 +701,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding final SimpleString empty = new SimpleString(""); Filter oldFilter = FilterImpl.createFilter(queue.getFilter() == null ? empty : queue.getFilter().getFilterString()); Filter newFilter = FilterImpl.createFilter(queueConfiguration.getFilterString() == null ? empty : queueConfiguration.getFilterString()); - if ((forceUpdate || newFilter != null) && !Objects.equals(oldFilter, newFilter)) { + if ((forceUpdate || newFilter != oldFilter) && !Objects.equals(oldFilter, newFilter)) { changed = true; queue.setFilter(newFilter); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java index afc70b45b0..e559b0f2cd 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java @@ -514,8 +514,8 @@ public class ActiveMQServerControlTest extends ManagementTestBase { producer.send(m); - assertNotNull(consumer1.receiveImmediate()); - assertNotNull(consumer2.receiveImmediate()); + assertNotNull(consumer1.receive(1000)); + assertNotNull(consumer2.receive(1000)); } @Test