tabish121 commented on code in PR #5771:
URL: https://github.com/apache/activemq-artemis/pull/5771#discussion_r2140952770


##########
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/collections/ConcurrentLongHashMap.java:
##########
@@ -289,12 +290,12 @@ V put(long key, V value, int keyHash, boolean 
onlyIfAbsent, LongFunction<V> valu
 
                if (storedKey == key) {
                   if (storedValue == EmptyValue) {
-                     values[bucket] = value != null ? value : (valueProvider 
!= null ? valueProvider.apply(key) : null);
+                     values[bucket] = Objects.requireNonNullElse(value, 
(valueProvider != null ? valueProvider.apply(key) : null));

Review Comment:
   I believe this would throw if the `valueProvider` is null, is that intended? 
 The old code seems to be okay with assigning null in that case but would now 
throw 



-- 
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: gitbox-unsubscr...@activemq.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org
For additional commands, e-mail: gitbox-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact


Reply via email to