From 50080c1b3ca86166bc7b219fb19611834fb4be42 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Mon, 2 Mar 2020 16:41:37 +0100 Subject: [PATCH] changed the implementation of addAll method. Before adding all the items in a collection, we check if the accumulator set is not empty --- .../src/main/java/eu/dnetlib/dhp/TypedRow.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dhp-workflows/dhp-propagation/src/main/java/eu/dnetlib/dhp/TypedRow.java b/dhp-workflows/dhp-propagation/src/main/java/eu/dnetlib/dhp/TypedRow.java index 8ca6eb7ed..56d519509 100644 --- a/dhp-workflows/dhp-propagation/src/main/java/eu/dnetlib/dhp/TypedRow.java +++ b/dhp-workflows/dhp-propagation/src/main/java/eu/dnetlib/dhp/TypedRow.java @@ -40,7 +40,10 @@ public class TypedRow implements Serializable { } - public void addAll(Set toadd){ + public void addAll(Collection toadd){ + if(accumulator == null){ + accumulator = new HashSet<>(); + } this.accumulator.addAll(toadd); }