Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Fix concurrent modifcation exception when destroying scoops #60

Merged
merged 2 commits into from
Apr 4, 2016

Conversation

buildbreaker
Copy link

No description provided.

@kathyma
Copy link
Contributor

kathyma commented Apr 4, 2016

👍

@buildbreaker buildbreaker force-pushed the scoop-destruction-concurrency branch from 237334a to ca38ac5 Compare April 4, 2016 21:14
@itspbj
Copy link
Contributor

itspbj commented Apr 4, 2016

👍

@buildbreaker
Copy link
Author

🚀

@buildbreaker buildbreaker merged commit 78ba41f into master Apr 4, 2016
@buildbreaker buildbreaker deleted the scoop-destruction-concurrency branch April 4, 2016 21:36
final Set<Map.Entry<String, Scoop>> entries = this.children.entrySet();

final Set<Map.Entry<String, Scoop>> entriesCopy = new HashSet<>(entries);
for (Map.Entry<String, Scoop> entry : entriesCopy) {
Copy link

Choose a reason for hiding this comment

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

@buildbreaker This could be simplified

for (Scoop value : entriesCopy.values()) {
  value.destroy();
}

Or iterate over a list of scoops:
List<Scoop> valuesCopy = new ArrayList(entries.values())

It's already merged though so it's ok.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants