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

Fix ConcurrentModificationException in Structure View #1588

Merged
merged 3 commits into from Sep 20, 2019

Conversation

KronicDeth
Copy link
Owner

@KronicDeth KronicDeth commented Sep 20, 2019

Fixes #1488

Changelog

Bug Fixes

  • Fix ConcurrentModificationException in Structure View

    Java 9 fixed a bug (https://bugs.openjdk.java.net/browse/JDK-8071667) in HashMap where computeIfAbsent did not check for concurrent modifications, and it turns out that TreeElementList was using concurrent modifications, so it was now broke.

    Fixed by use get or put if it is absent, so that putNew can ensure that the CallDefinition is in the TreeElementList before it is added to the MutableList<TreeElement>, which was the original reason why there was a put inside of computeIfAbsent, which would have put when the function returned anyway.

@KronicDeth KronicDeth added this to the 11.1.0 milestone Sep 20, 2019
@KronicDeth KronicDeth self-assigned this Sep 20, 2019
KronicDeth added a commit that referenced this pull request Sep 20, 2019
Fixes #1488

Java 9 fixed a bug (https://bugs.openjdk.java.net/browse/JDK-8071667) in
`HashMap` where `computeIfAbsent` did not check for concurrent modifications,
and it turns out that `TreeElementList` was using concurrent modifications,
so it was now broke.

Fixed by use `get` or `put` if it is absent, so that `putNew` can ensure that
the `CallDefinition` is in the `TreeElementList` before it is added to the
`MutableList<TreeElement>`, which was the original reason why there was a `put`
inside of `computeIfAbsent`, which would have `put` when the function returned
anyway.
@KronicDeth KronicDeth force-pushed the concurrent-modification-exception branch from a9612d9 to 2283e97 Compare September 20, 2019 15:21
@KronicDeth KronicDeth merged commit b2b3013 into master Sep 20, 2019
@KronicDeth KronicDeth deleted the concurrent-modification-exception branch September 20, 2019 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Structure view (Cmd+F12) ConcurrentModificationException
1 participant