From f07db9b43bc9761fad57f2293e99b5f13ef5d42a Mon Sep 17 00:00:00 2001 From: nick Date: Fri, 10 May 2019 15:29:47 -0400 Subject: [PATCH] fix map collision --- .../gui/externalfiles/FindFullTextAction.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java b/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java index 098175d865e..72c2bedd70d 100644 --- a/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java +++ b/src/main/java/org/jabref/gui/externalfiles/FindFullTextAction.java @@ -69,14 +69,14 @@ public void execute() { } } - Task, BibEntry>> findFullTextsTask = new Task, BibEntry>>() { + Task>> findFullTextsTask = new Task>>() { @Override - protected Map, BibEntry> call() { - Map, BibEntry> downloads = new ConcurrentHashMap<>(); + protected Map> call() { + Map> downloads = new ConcurrentHashMap<>(); int count = 0; for (BibEntry entry : basePanel.getSelectedEntries()) { FulltextFetchers fetchers = new FulltextFetchers(Globals.prefs.getImportFormatPreferences()); - downloads.put(fetchers.findFullTextPDF(entry), entry); + downloads.put(entry, fetchers.findFullTextPDF(entry)); updateProgress(++count, basePanel.getSelectedEntries().size()); } return downloads; @@ -93,10 +93,10 @@ protected Map, BibEntry> call() { Globals.TASK_EXECUTOR.execute(findFullTextsTask); } - private void downloadFullTexts(Map, BibEntry> downloads) { - for (Map.Entry, BibEntry> download : downloads.entrySet()) { - BibEntry entry = download.getValue(); - Optional result = download.getKey(); + private void downloadFullTexts(Map> downloads) { + for (Map.Entry> download : downloads.entrySet()) { + BibEntry entry = download.getKey(); + Optional result = download.getValue(); if (result.isPresent()) { Optional dir = basePanel.getBibDatabaseContext().getFirstExistingFileDir(Globals.prefs.getFilePreferences());