Fix JavaFX thread exception when fetching new infos#4354
Merged
Conversation
Fixes #4348 by reworking the SwingWorker using JavaFX BackgroundTasks.
Siedlerchr
approved these changes
Sep 19, 2018
| } | ||
| }) | ||
| .onFailure(exception -> { | ||
| LOGGER.error("Error while fetching entry with " + fetcher.getName(), exception); |
Member
Author
There was a problem hiding this comment.
This is not possible if the last argument should be treated as an exception.
Siedlerchr
reviewed
Sep 19, 2018
| if (fetcher.isPresent()) { | ||
| return fetcher.get().performSearchById(fieldContent.get()); | ||
| } else { | ||
| return Optional.<BibEntry>empty(); |
Member
There was a problem hiding this comment.
Normally you don't need the genericc type in return Optional.empty
Member
Author
There was a problem hiding this comment.
I was also surprised but it leads to compiler errors without it.
LinusDietz
approved these changes
Sep 20, 2018
LinusDietz
left a comment
Member
There was a problem hiding this comment.
There's one TODO left.
Otherwise looks good.
| this.dialogService = panel.frame().getDialogService(); | ||
| this.panel = panel; | ||
|
|
||
| // TODO: Don't run this method as part of the constructor |
Member
Author
There was a problem hiding this comment.
Yeah, I was just too lazy to do it ;-). Fixed now.
# Conflicts: # src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java
Siedlerchr
added a commit
that referenced
this pull request
Oct 13, 2018
* upstream/master: Update Libraries (#4366) ArXiv fetcher support http url (#4367) Fix issue 3861 : XMP Dialog, Add new Groups dialog, Append Library dialog to javafx (#4264) fix IndexOutOfBoundsException when saving preferences group RadioButtons in ExportSortingPrefsTab to prevent the selection of multiple or no order types Convert Part of the Issue#3861 Quality->Cleanup entries (#4268) UPDATE gradle to 4.10.2 (#4358) Completed General Fields Customizer conversion to JavaFX (#4346) Fix JavaFX thread exception when fetching new infos (#4354) Auto trim url field (#4355) Fix freezes in entry editor (#4351) # Conflicts: # src/main/java/org/jabref/preferences/PreferencesService.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes JavaFX thread exceptions by reworking the SwingWorker using JavaFX BackgroundTasks.