gmunozfe commented on code in PR #2178:
URL: 
https://github.com/apache/incubator-kie-kogito-apps/pull/2178#discussion_r1924869687


##########
data-index/data-index-common/src/main/java/org/kie/kogito/index/CommonUtils.java:
##########
@@ -67,6 +69,29 @@ public static TypeDefinitionRegistry 
loadSchemaDefinitionFile(String fileName) {
         }
     }
 
+    @SuppressWarnings("unchecked")
+    public static <K, V> Map<K, V> mergeMap(Map<K, V> source, Map<K, V> 
target) {
+        if (source == null) {
+            return target;
+        } else if (target == null) {
+            return source;
+        } else {
+            Map<K, V> result = new HashMap<>(target);
+            source.forEach((key, value) -> {
+                if (value != null) {

Review Comment:
   In case of merging the same key, if the source is null, it's ignored and 
target key keeps the original value, isn't it? Perhaps this can be documented. 
I see this case is covered in the test `testNullMergeMap`



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

Reply via email to