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 ExceptionI tried to revert this commit, and the issue was resolved. To reproduce the issue:
|
| 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.
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.mddescribed in a way that is understandable for the average user (if applicable)