From 2c1028418ec95709cafe5afe1f428eb104972615 Mon Sep 17 00:00:00 2001 From: Nick Mancuso <31252532+nmancus1@users.noreply.github.com> Date: Sat, 11 May 2019 09:59:28 -0500 Subject: [PATCH 1/4] fix map collision (#4962) --- .../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()); From 3baa6bd22c1dd0fab6c3c1480fc723654afd22b2 Mon Sep 17 00:00:00 2001 From: Christoph Date: Sat, 11 May 2019 17:39:58 +0200 Subject: [PATCH 2/4] Remove UI ThreadList for maintable as it prevents sorting in maintable (#4964) * Remove UI ThreadList for maintable as it prevents sorting in maintable Fixes #4886 * fix checkstyle * wrap around original entries --- src/main/java/org/jabref/gui/maintable/MainTable.java | 3 +-- .../java/org/jabref/gui/maintable/MainTableDataModel.java | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/jabref/gui/maintable/MainTable.java b/src/main/java/org/jabref/gui/maintable/MainTable.java index 10c9a278a2b..892116fb337 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTable.java +++ b/src/main/java/org/jabref/gui/maintable/MainTable.java @@ -36,7 +36,6 @@ import org.jabref.gui.keyboard.KeyBindingRepository; import org.jabref.gui.undo.NamedCompound; import org.jabref.gui.undo.UndoableInsertEntry; -import org.jabref.gui.util.BindingsHelper; import org.jabref.gui.util.CustomLocalDragboard; import org.jabref.gui.util.ViewModelTableRowFactory; import org.jabref.logic.l10n.Localization; @@ -109,7 +108,7 @@ public MainTable(MainTableDataModel model, JabRefFrame frame, } this.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE); - this.setItems(BindingsHelper.forUI(model.getEntriesFilteredAndSorted())); + this.setItems(model.getEntriesFilteredAndSorted()); // Enable sorting model.getEntriesFilteredAndSorted().comparatorProperty().bind(this.comparatorProperty()); diff --git a/src/main/java/org/jabref/gui/maintable/MainTableDataModel.java b/src/main/java/org/jabref/gui/maintable/MainTableDataModel.java index 57d0f4439f1..5ef91744ea9 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTableDataModel.java +++ b/src/main/java/org/jabref/gui/maintable/MainTableDataModel.java @@ -22,10 +22,10 @@ public class MainTableDataModel { private final SortedList entriesSorted; public MainTableDataModel(BibDatabaseContext context) { - ObservableList allEntries = context.getDatabase().getEntries(); - + ObservableList allEntries = BindingsHelper.forUI(context.getDatabase().getEntries()); + ObservableList entriesViewModel = BindingsHelper.mapBacked(allEntries, BibEntryTableViewModel::new); - + entriesFiltered = new FilteredList<>(entriesViewModel); entriesFiltered.predicateProperty().bind( Bindings.createObjectBinding(() -> this::isMatched, From c754a790d669212464742fea4bc7cf67f83e094b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20M=C3=A9ndez?= Date: Tue, 14 May 2019 09:12:10 +0200 Subject: [PATCH 3/4] Switch Jsoup's StringUtil for JabRef's StringUtil (#4970) --- build.gradle | 2 +- .../java/org/jabref/logic/importer/IdBasedParserFetcher.java | 2 +- .../org/jabref/logic/importer/SearchBasedParserFetcher.java | 3 +-- .../jabref/logic/importer/fetcher/AstrophysicsDataSystem.java | 2 +- .../java/org/jabref/logic/importer/fetcher/IsbnFetcher.java | 2 +- .../jabref/logic/importer/fetcher/IsbnViaChimboriFetcher.java | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 3731ef3acbb..1f1847f2b2a 100644 --- a/build.gradle +++ b/build.gradle @@ -138,7 +138,7 @@ dependencies { // Cannot be updated to 9.*.* until Jabref works with Java 9 compile 'org.controlsfx:controlsfx:8.40.15-SNAPSHOT' - compile 'org.jsoup:jsoup:1.11.3' + compile 'org.jsoup:jsoup:1.12.1' compile 'com.mashape.unirest:unirest-java:1.4.9' // >1.8.0-beta is required for java 9 compatibility diff --git a/src/main/java/org/jabref/logic/importer/IdBasedParserFetcher.java b/src/main/java/org/jabref/logic/importer/IdBasedParserFetcher.java index 29c1ded0e05..9dd2ec28401 100644 --- a/src/main/java/org/jabref/logic/importer/IdBasedParserFetcher.java +++ b/src/main/java/org/jabref/logic/importer/IdBasedParserFetcher.java @@ -11,8 +11,8 @@ import org.jabref.logic.net.URLDownload; import org.jabref.model.cleanup.Formatter; import org.jabref.model.entry.BibEntry; +import org.jabref.model.strings.StringUtil; -import org.jsoup.helper.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/logic/importer/SearchBasedParserFetcher.java b/src/main/java/org/jabref/logic/importer/SearchBasedParserFetcher.java index 4d1cf696ae6..dd7b732c9ff 100644 --- a/src/main/java/org/jabref/logic/importer/SearchBasedParserFetcher.java +++ b/src/main/java/org/jabref/logic/importer/SearchBasedParserFetcher.java @@ -11,8 +11,7 @@ import org.jabref.logic.net.URLDownload; import org.jabref.model.cleanup.Formatter; import org.jabref.model.entry.BibEntry; - -import org.jsoup.helper.StringUtil; +import org.jabref.model.strings.StringUtil; /** * Provides a convenient interface for search-based fetcher, which follow the usual three-step procedure: diff --git a/src/main/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java b/src/main/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java index 6b99f420526..c940d07b193 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystem.java @@ -30,10 +30,10 @@ import org.jabref.model.cleanup.FieldFormatterCleanup; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.FieldName; +import org.jabref.model.strings.StringUtil; import org.jabref.model.util.DummyFileUpdateMonitor; import org.apache.http.client.utils.URIBuilder; -import org.jsoup.helper.StringUtil; /** * Fetches data from the SAO/NASA Astrophysics Data System (http://www.adsabs.harvard.edu/) diff --git a/src/main/java/org/jabref/logic/importer/fetcher/IsbnFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/IsbnFetcher.java index c1d13f862e9..ac74cec7aca 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/IsbnFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/IsbnFetcher.java @@ -11,9 +11,9 @@ import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.FieldName; +import org.jabref.model.strings.StringUtil; import org.jabref.model.util.OptionalUtil; -import org.jsoup.helper.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/logic/importer/fetcher/IsbnViaChimboriFetcher.java b/src/main/java/org/jabref/logic/importer/fetcher/IsbnViaChimboriFetcher.java index 82c50b95ff4..4ddd9fa17a5 100644 --- a/src/main/java/org/jabref/logic/importer/fetcher/IsbnViaChimboriFetcher.java +++ b/src/main/java/org/jabref/logic/importer/fetcher/IsbnViaChimboriFetcher.java @@ -10,11 +10,11 @@ import org.jabref.logic.importer.ImportFormatPreferences; import org.jabref.logic.importer.ParseException; import org.jabref.model.entry.BibEntry; +import org.jabref.model.strings.StringUtil; import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; import com.mashape.unirest.http.exceptions.UnirestException; -import org.jsoup.helper.StringUtil; /** * Fetcher for ISBN using https://bibtex.chimbori.com/, which in turn uses Amazon's API. From 89d0f30dec396718f2c9e3ae3a5a5d12415bc804 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Thu, 16 May 2019 09:47:41 -0500 Subject: [PATCH 4/4] Revised README.md (#4974) * Update README.md Updated the Contributing section of the README.md to be more welcoming to new FOSS contributors. Reordered the section a bit. Added bullet points to break up the information. Included inline links to guides to forking a repo and making a PR. Also, linked to current issues with the "good first issue" label to help new users. * Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cec54b33f74..d0a9efc35f7 100644 --- a/README.md +++ b/README.md @@ -82,11 +82,11 @@ An explanation of donation possibilities and usage of donations is available at > Not a programmer? [Learn how to help.](http://contribute.jabref.org) -Want to be part of a free and open-source project that tens of thousands scientist use every day? -Check out our [issue tracker](https://github.com/JabRef/jabref/issues) to find something to work on. -You are also welcome to contribute new features. -To get your code included into JabRef, just fork JabRef and create a pull request. -For details have a look at our [guidelines for contributing](CONTRIBUTING.md). +Want to be part of a free and open-source project that tens of thousands scientist use every day? Check out the ways you can contribute, below: +- For details on how to contribute, have a look at our [guidelines for contributing](CONTRIBUTING.md). +- You are welcome to contribute new features. To get your code included into JabRef, just [fork](https://help.github.com/en/articles/fork-a-repo) the JabRef repository, make your changes, and create a [pull request](https://help.github.com/en/articles/about-pull-requests). +- To work on existing JabRef issues, check out our [issue tracker](https://github.com/JabRef/jabref/issues). New to open source contributing? Look for issues with the ["good first issue"](https://github.com/JabRef/jabref/labels/good%20first%20issue) label to get started. + We view pull requests as a collaborative process. Submit a pull request early to get feedback from the team on work in progress. We will discuss improvements with you and agree to merge them once the [developers](https://github.com/JabRef/jabref/blob/master/DEVELOPERS) approve.