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 2022/12/19 01:17:29 UTC

[GitHub] [pulsar] Radiancebobo commented on a diff in pull request #18967: [improvement] checkNotNull when use computeIfAbsent in ConcurrentLongHashMap and ConcurrentOpenHashMap

Radiancebobo commented on code in PR #18967:
URL: https://github.com/apache/pulsar/pull/18967#discussion_r1051710823


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

Review Comment:
   how about this ?
   ![image](https://user-images.githubusercontent.com/39521534/208330122-e43a8e37-1d48-4bb8-b4bd-7518e3fb71ab.png)
   



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