-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
No more shown finished background tasks #11574
Conversation
Co-authored-by: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com>
The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build. |
Follow-up depends on controlsfx/controlsfx#1559 |
@koppor, @calixtus Exception
I tried to revert this commit, and the issue was resolved. To reproduce the issue:
|
@@ -128,7 +128,7 @@ public <V> Future<?> schedule(BackgroundTask<V> task, long delay, TimeUnit unit) | |||
public void shutdown() { | |||
StateManager stateManager = Injector.instantiateModelOrService(StateManager.class); | |||
if (stateManager != null) { | |||
stateManager.getBackgroundTasks().stream().filter(task -> !task.isDone()).forEach(Task::cancel); | |||
stateManager.getRunningBackgroundTasks().stream().forEach(Task::cancel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue was that canceling a task removes items from the runningBackgroundTasks
list since it's a filtered list. Removing items during iteration causes an IndexOutOfBoundsException
.
Reverting this line will fix the issue.
I will reopen the PR.
JabRef collected all run tasks. This was confusing. This PR fixes this.
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)