You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/11/23 14:50:40 UTC

[GitHub] [pulsar] lhotari commented on a change in pull request #12729: [Issue 12723] Fix race condition in PersistentTopic#addReplicationCluster

lhotari commented on a change in pull request #12729:
URL: https://github.com/apache/pulsar/pull/12729#discussion_r755200501



##########
File path: pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/ConcurrentOpenHashMap.java
##########
@@ -43,6 +43,27 @@
     private static final Object EmptyKey = null;
     private static final Object DeletedKey = new Object();
 
+    /**
+     * This object is used to delete empty value in this map.
+     * EmptyValue.equals(null) = true.
+     */
+    private static final Object EmptyValue = new Object() {
+
+        @SuppressFBWarnings
+        @Override
+        public boolean equals(Object obj) {
+            return obj == null;

Review comment:
       this looks like a solution that violates the contract of Object.equals. Isn't there an alternative way to achieve the desired outcome?




-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org