From 5e15f20e6e5b9961d842fcdf4590a61f84a31d2b Mon Sep 17 00:00:00 2001 From: Giambattista Bloisi Date: Fri, 21 Jul 2023 00:46:54 +0200 Subject: [PATCH] Fix entityMerger that was excluding the authors of the first entity in the list to merge --- .../main/java/eu/dnetlib/dhp/oa/dedup/DedupRecordFactory.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dhp-workflows/dhp-dedup-openaire/src/main/java/eu/dnetlib/dhp/oa/dedup/DedupRecordFactory.java b/dhp-workflows/dhp-dedup-openaire/src/main/java/eu/dnetlib/dhp/oa/dedup/DedupRecordFactory.java index 7637cde93..60669106a 100644 --- a/dhp-workflows/dhp-dedup-openaire/src/main/java/eu/dnetlib/dhp/oa/dedup/DedupRecordFactory.java +++ b/dhp-workflows/dhp-dedup-openaire/src/main/java/eu/dnetlib/dhp/oa/dedup/DedupRecordFactory.java @@ -110,6 +110,10 @@ public class DedupRecordFactory { // set authors and date if (ModelSupport.isSubClass(entity, Result.class)) { + Optional + .ofNullable(((Result) entity).getAuthor()) + .ifPresent(a -> authors.add(a)); + ((Result) entity).setAuthor(AuthorMerger.merge(authors)); }