commit | 0a189f833e1041e589ffa9523bdbe2285a678eed | [log] [tgz] |
---|---|---|
author | Christopher Shannon <chris@Christophers-MacBook.local> | Fri Jul 24 16:22:24 2020 -0400 |
committer | Christopher Shannon <chris@Christophers-MacBook.local> | Fri Jul 24 16:22:24 2020 -0400 |
tree | f8d84207db3f930ff661b5ac09b10252ec20cffd | |
parent | 62f5576fe5dc8bc06eefc1e26b8e66a10781fe32 [diff] |
AMQ-8012 - Move synchronized block after null check
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 @@ @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); } }