AMQ-8012 - Move synchronized block after null check

This commit is contained in:
Christopher Shannon 2020-07-24 16:22:24 -04:00
parent 62f5576fe5
commit 0a189f833e
1 changed files with 2 additions and 2 deletions

View File

@ -276,8 +276,8 @@ public class SubQueueSelectorCacheBroker extends BrokerFilter implements Runnabl
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public Set<String> getSelectorsForDestination(String destinationName) { public Set<String> getSelectorsForDestination(String destinationName) {
final Set<String> cachedSelectors = subSelectorCache.get(destinationName); final Set<String> cachedSelectors = subSelectorCache.get(destinationName);
synchronized(cachedSelectors) {
if (cachedSelectors != null) { if (cachedSelectors != null) {
synchronized(cachedSelectors) {
return new HashSet<>(cachedSelectors); return new HashSet<>(cachedSelectors);
} }
} }