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

Use unmodifiable collection in UnitSeparator in Swing Event Thread Task #7070

Merged
merged 1 commit into from Jul 8, 2020

Conversation

DanVanAtta
Copy link
Member

Fixes #7066 UnitSeparator#categorize:103 - ConcurrentModificationException

This fix avoids concurrent modification to a list by creating a copy
of the list before we operate on the list in the swing even thread.
We go on to fix any other data issues that could change between when
we issue the task to the swing event queue by computing all data
the task needs before creating the task.

Functional Changes

[] New map or map update
[] New Feature
[] Feature update or enhancement
[] Feature Removal
[] Code Cleanup or refactor
[] Configuration Change
[x] Problem fix
[] Other:

Testing

  • Did a quick smoke test to make sure the placement panel rendered during a single player game and did not render if no units were purchased

Screens Shots

Additional Notes to Reviewer

Release Note

FIX|Potential game crash during calculation of units that belong in the units-to-place panel

Fixes #7066 UnitSeparator#categorize:103 - ConcurrentModificationException

This fix avoids concurrent modification to a list by creating a copy
of the list before we operate on the list in the swing even thread.
We go on to fix any other data issues that could change between when
we issue the task to the swing event queue by computing all data
the task needs before creating the task.
@codeclimate
Copy link

codeclimate bot commented Jul 8, 2020

Code Climate has analyzed commit a0ee0b1 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 26.4% (0.0% change).

View more on Code Climate.

@DanVanAtta DanVanAtta changed the title Use unmodifiable collection in UnitSeperator in Swing Event Thread Task Use unmodifiable collection in UnitSeparator in Swing Event Thread Task Jul 8, 2020
@RoiEXLab RoiEXLab merged commit ecaab66 into master Jul 8, 2020
@RoiEXLab RoiEXLab deleted the use-immutable-data-in-collapsible-panel branch July 8, 2020 09:40
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.

2.1.20365: UnitSeparator#categorize:103 - ConcurrentModificationException
2 participants