hangc0276 commented on code in PR #3706:
URL: https://github.com/apache/bookkeeper/pull/3706#discussion_r1051755667


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/util/collections/ConcurrentLongHashMap.java:
##########
@@ -382,6 +382,9 @@ V get(long key, int keyHash) {
         }
 
         V put(long key, V value, int keyHash, boolean onlyIfAbsent, 
LongFunction<V> valueProvider) {
+            if (value == null) {
+                checkNotNull(valueProvider.apply(key));

Review Comment:
   if `valueProvider.apply(key)` returns an object and is not null, it will 
create at least two objects, this is not expected.



-- 
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