boolean () { mySomethingChanged = false; // copy under lock final HashMap<VcsRoot, LazyRefreshingSelfQueue> copyMap; synchronized (myLock) { copyMap = new HashMap<>(myRefreshingQueues); } // filter only items for vcs roots that support background operations for (Iterator<Map.Entry<VcsRoot, LazyRefreshingSelfQueue>> iterator = copyMap.entrySet().iterator(); iterator.hasNext();) { final Map.Entry<VcsRoot, LazyRefreshingSelfQueue> entry = iterator.next(); final VcsRoot key = entry.getKey(); final boolean backgroundOperationsAllowed = key.getVcs().isVcsBackgroundOperationsAllowed(key.getPath()); LOG.debug("backgroundOperationsAllowed: " + backgroundOperationsAllowed + " for " + key.getVcs().getName() + ", " + key.getPath().getPath()); if (! backgroundOperationsAllowed) { iterator.remove(); } } LOG.debug("queues refresh started, queues: " + copyMap.size()); // refresh "up to date" info for (LazyRefreshingSelfQueue queue : copyMap.values()) { if (myProject.isDisposed()) throw new ProcessCanceledException(); queue.updateStep(); } return mySomethingChanged; }