From 69c5efbd8b2015f993a04205e117cbb4b204f0e2 Mon Sep 17 00:00:00 2001 From: Giambattista Bloisi Date: Fri, 3 May 2024 13:57:56 +0200 Subject: [PATCH] Fix: when applying enrichments with no instance information the resulting merge entity was generated with no instance instead of keeping the original information --- .../java/eu/dnetlib/dhp/schema/oaf/utils/MergeUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dhp-common/src/main/java/eu/dnetlib/dhp/schema/oaf/utils/MergeUtils.java b/dhp-common/src/main/java/eu/dnetlib/dhp/schema/oaf/utils/MergeUtils.java index 9eb1ec01d..28db94766 100644 --- a/dhp-common/src/main/java/eu/dnetlib/dhp/schema/oaf/utils/MergeUtils.java +++ b/dhp-common/src/main/java/eu/dnetlib/dhp/schema/oaf/utils/MergeUtils.java @@ -874,9 +874,11 @@ public class MergeUtils { if (toEnrichInstances == null) { return enrichmentResult; } - if (enrichmentInstances == null) { - return enrichmentResult; + + if (enrichmentInstances == null || enrichmentInstances.isEmpty()) { + return toEnrichInstances; } + Map ri = toInstanceMap(enrichmentInstances); toEnrichInstances.forEach(i -> {