This is an automated email from the ASF dual-hosted git repository.

cshannon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq.git


The following commit(s) were added to refs/heads/master by this push:
     new 0a189f8  AMQ-8012 - Move synchronized block after null check
0a189f8 is described below

commit 0a189f833e1041e589ffa9523bdbe2285a678eed
Author: Christopher Shannon <[email protected]>
AuthorDate: Fri Jul 24 16:22:24 2020 -0400

    AMQ-8012 - Move synchronized block after null check
---
 .../java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java
 
b/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java
index 0e48830..7a0e58c 100644
--- 
a/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java
+++ 
b/activemq-broker/src/main/java/org/apache/activemq/plugin/SubQueueSelectorCacheBroker.java
@@ -276,8 +276,8 @@ public class SubQueueSelectorCacheBroker extends 
BrokerFilter implements Runnabl
     @SuppressWarnings("unchecked")
     public Set<String> getSelectorsForDestination(String destinationName) {
         final Set<String> cachedSelectors = 
subSelectorCache.get(destinationName);
-        synchronized(cachedSelectors) {
-            if (cachedSelectors != null) {
+        if (cachedSelectors != null) {
+            synchronized(cachedSelectors) {
                 return new HashSet<>(cachedSelectors);
             }
         }

Reply via email to