BewareMyPower commented on issue #23215:
URL: https://github.com/apache/pulsar/issues/23215#issuecomment-2308144400

   https://github.com/apache/pulsar/pull/12729 shows the 
`ConcurrentOpenHashMap` allows null values. It adds a `removeNullValue` public 
method to handle the null values. This is very error-prone.
   
   Here is an example:
   
   ```java
           final var map = new ConcurrentHashMap<String, String>();
           map.computeIfAbsent("A", __ -> null);
           System.out.println(map.size());
   
           final var map2 = new ConcurrentOpenHashMap<String, String>();
           map2.computeIfAbsent("A", __ -> null);
           System.out.println(map2.size());
   ```
   
   Outputs:
   
   ```
   0
   1
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to