lhotari commented on code in PR #24048: URL: https://github.com/apache/pulsar/pull/24048#discussion_r1993159898
########## pulsar-common/src/main/java/org/apache/pulsar/common/policies/data/TopicPolicies.java: ########## @@ -192,7 +192,11 @@ public Set<String> getReplicationClustersSet() { return replicationClusters != null ? Sets.newTreeSet(this.replicationClusters) : null; } + @SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE") public Map<String, SubscriptionPolicies> getSubscriptionPolicies() { - return subscriptionPolicies == null ? Collections.emptyMap() : subscriptionPolicies; + if (subscriptionPolicies == null) { + subscriptionPolicies = new HashMap<>(); Review Comment: `ConcurrentHashMap` should be used instead of `HashMap`. There's an unresolved thread safety issue with `TopicPolicies`, #21303. Using a `ConcurrentHashMap` here would be preferred although it doesn't solve #21303. -- 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: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org