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 82bf87ccaf..7637cde933 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 @@ -94,7 +94,6 @@ public class DedupRecordFactory { BeanUtils.copyProperties(entity, first); - final Collection dates = Lists.newArrayList(); final List> authors = Lists.newArrayList(); entityList @@ -103,16 +102,14 @@ public class DedupRecordFactory { entity.mergeFrom(duplicate); if (ModelSupport.isSubClass(duplicate, Result.class)) { Result r1 = (Result) duplicate; - if (r1.getAuthor() != null && StringUtils.isNotBlank(r1.getDateofacceptance().getValue())) - authors.add(r1.getAuthor()); - if (r1.getDateofacceptance() != null) - dates.add(r1.getDateofacceptance().getValue()); + Optional + .ofNullable(r1.getAuthor()) + .ifPresent(a -> authors.add(a)); } }); // set authors and date if (ModelSupport.isSubClass(entity, Result.class)) { - // ((Result) entity).setDateofacceptance(DatePicker.pick(dates)); ((Result) entity).setAuthor(AuthorMerger.merge(authors)); }