Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JavaFX thread exception when fetching new infos #4354

Merged
merged 5 commits into from
Sep 23, 2018
Merged

Conversation

tobiasdiez
Copy link
Member

@tobiasdiez tobiasdiez commented Sep 18, 2018

Fixes JavaFX thread exceptions by reworking the SwingWorker using JavaFX BackgroundTasks.

Fixes #4348 by reworking the SwingWorker using JavaFX BackgroundTasks.
}
})
.onFailure(exception -> {
LOGGER.error("Error while fetching entry with " + fetcher.getName(), exception);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use {} for parameters

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not possible if the last argument should be treated as an exception.

if (fetcher.isPresent()) {
return fetcher.get().performSearchById(fieldContent.get());
} else {
return Optional.<BibEntry>empty();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally you don't need the genericc type in return Optional.empty

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was also surprised but it leads to compiler errors without it.

Copy link
Member

@LinusDietz LinusDietz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you resolve this TODO?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was just too lazy to do it ;-). Fixed now.

# Conflicts:
#	src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java
@tobiasdiez tobiasdiez merged commit 5dca3b6 into master Sep 23, 2018
@tobiasdiez tobiasdiez deleted the fixMerge branch September 23, 2018 19:01
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants