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


##########
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:
   When I first pushed I didn't realize that the default couldn't be `null`. 
:laughing: 



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to