Skip to content

Commit 2d36ff3

Browse files
author
nmacedo
committed
fixed bug on multithread GETs
1 parent 65a9215 commit 2d36ff3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/pt/ptcris/PTCRISync.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.util.List;
2020
import java.util.Map;
2121
import java.util.Set;
22+
import java.util.concurrent.ConcurrentHashMap;
2223

2324
import org.um.dsi.gavea.orcid.client.exception.OrcidClientException;
2425
import org.um.dsi.gavea.orcid.model.common.ElementSummary;
@@ -823,7 +824,7 @@ private static <E extends ElementSummary, S extends ElementSummary, G, T extends
823824

824825
List<S> orcids = helper.getAllTypedSummaries(types);
825826

826-
Map<BigInteger, PTCRISyncResult<E>> toImport = new HashMap<BigInteger, PTCRISyncResult<E>>();
827+
Map<BigInteger, PTCRISyncResult<E>> toImport = new ConcurrentHashMap<BigInteger, PTCRISyncResult<E>>();
827828

828829
// filter novel works only
829830
List<S> temp = new ArrayList<S>();
@@ -1180,7 +1181,7 @@ private static <E extends ElementSummary, S extends ElementSummary, G, T extends
11801181
List<S> orcids = helper.getAllTypedSummaries(types);
11811182

11821183
Map<BigInteger, Set<String>> invalidsToImport = new HashMap<BigInteger, Set<String>>();
1183-
Map<BigInteger, PTCRISyncResult<E>> toImport = new HashMap<BigInteger, PTCRISyncResult<E>>();
1184+
Map<BigInteger, PTCRISyncResult<E>> toImport = new ConcurrentHashMap<BigInteger, PTCRISyncResult<E>>();
11841185

11851186
// filter invalid works only
11861187
List<S> temp = new ArrayList<S>();

0 commit comments

Comments
 (0)