Skip to content

#2242: hotfix: prevent ConcurrentModificationException in TaskManager.addTask() - #2243

Merged
hohwille merged 13 commits into
devonfw:mainfrom
laim2003:#2242-fix-concurrent-modification-in-task-manager
Aug 6, 2026
Merged

#2242: hotfix: prevent ConcurrentModificationException in TaskManager.addTask()#2243
hohwille merged 13 commits into
devonfw:mainfrom
laim2003:#2242-fix-concurrent-modification-in-task-manager

Conversation

@laim2003

@laim2003 laim2003 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #2242

Implemented changes:

  • Modified TaskManager.addTask() logic to use a copy of the current task list when checking if the added tasks' ID already exists in the list.

Testing instructions

As stated in the Issue, reproducing this is quite hard. What you can do is, to run this test locally and to check whether this test succeeds locally and also here on GitHub.


Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labeled
    with internal
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

- Create a defensive copy of the tasks list before streaming to avoid
  ConcurrentModificationException when the list is modified by FX listeners
- This resolves intermittent test failures in listContentsAreCoherent test
  that occur in CI environments with different thread scheduling
- Fixes issue where TaskWindowTest fails on GitHub Actions
@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Jul 31, 2026
@laim2003 laim2003 self-assigned this Jul 31, 2026
@laim2003 laim2003 added test related to testing and QA internal Nothing to be added to CHANGELOG, only internal story labels Jul 31, 2026
@laim2003 laim2003 moved this from 🆕 New to 🏗 In progress in IDEasy board Jul 31, 2026
@laim2003 laim2003 changed the title #2242: fix: prevent ConcurrentModificationException in TaskManager.addTask() #2242: hotfix: prevent ConcurrentModificationException in TaskManager.addTask() Jul 31, 2026
@coveralls

coveralls commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 31097769566

Coverage increased (+0.01%) to 72.898%

Details

  • Coverage increased (+0.01%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 1 coverage regression across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/tool/ide/IdeToolCommandlet.java 1 78.69%

Coverage Stats

Coverage Status
Relevant Lines: 17493
Covered Lines: 13298
Line Coverage: 76.02%
Relevant Branches: 7727
Covered Branches: 5087
Branch Coverage: 65.83%
Branches in Coverage %: Yes
Coverage Strength: 3.23 hits per line

💛 - Coveralls

@laim2003

laim2003 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

With the current state of the PR, the underlying issue is not fully resolved, but we at least are more stable in the tests.

@laim2003
laim2003 marked this pull request as ready for review August 3, 2026 08:28
@laim2003 laim2003 moved this from 🏗 In progress to Team Review in IDEasy board Aug 3, 2026
Comment thread gui/src/main/java/com/devonfw/ide/gui/context/TaskManager.java Outdated
@laim2003 laim2003 moved this from Team Review to 🏗 In progress in IDEasy board Aug 4, 2026
@laim2003
laim2003 marked this pull request as draft August 4, 2026 11:57
Signed-off-by: laim2003 <luk.faber@gmx.de>
@laim2003
laim2003 marked this pull request as ready for review August 4, 2026 15:07
@laim2003 laim2003 moved this from 🏗 In progress to Team Review in IDEasy board Aug 4, 2026
@laim2003
laim2003 requested a review from JoelAdbu August 4, 2026 15:07
Signed-off-by: laim2003 <luk.faber@gmx.de>
@JoelAdbu JoelAdbu moved this from Team Review to 👀 In review in IDEasy board Aug 5, 2026
@laim2003
laim2003 requested a review from hohwille August 5, 2026 11:54

@JoelAdbu JoelAdbu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me. I verified the latest changes and my feedback has been addressed.

@hohwille hohwille added this to the release:2026.08.001 milestone Aug 6, 2026

@hohwille hohwille left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@laim2003 thanks for fixing this issue unblocking others. Great job 👍

@hohwille
hohwille merged commit c442a8f into devonfw:main Aug 6, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in IDEasy board Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Nothing to be added to CHANGELOG, only internal story test related to testing and QA

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

TaskWindowTest running as a flaky test due to concurrency issues

4 participants