mivanac commented on a change in pull request #7113: URL: https://github.com/apache/geode/pull/7113#discussion_r815157691
########## File path: geode-core/src/main/java/org/apache/geode/internal/cache/persistence/PersistenceAdvisorImpl.java ########## @@ -721,12 +721,19 @@ public void addListener(PersistentStateListener listener) { @Override public void removeListener(PersistentStateListener listener) { synchronized (this) { + if (persistentStateListeners.isEmpty()) { Review comment: Thanks for comment. Updated. ########## File path: geode-core/src/main/java/org/apache/geode/internal/cache/persistence/PersistenceAdvisorImpl.java ########## @@ -721,12 +721,19 @@ public void addListener(PersistentStateListener listener) { @Override public void removeListener(PersistentStateListener listener) { synchronized (this) { + if (persistentStateListeners.isEmpty()) { + return; + } Set<PersistentStateListener> tmpListeners = new HashSet<>(persistentStateListeners); tmpListeners.remove(listener); persistentStateListeners = Collections.unmodifiableSet(tmpListeners); } } + Set<PersistentStateListener> getPersistentStateListenerSet() { Review comment: Updated. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@geode.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org