Repository navigation
Copy annotation lists during scan data compaction - #708
Merged
embeddedt merged 1 commit intoNov 13, 2026
Merged
Conversation
Contributor
Author
|
Thanks for merging this! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Copy the ArrayList annotation values when compacting scan data, instead of trimming the originals. The copy keeps the ArrayList type and is already sized to its elements, and the lists that other mods' scan data still point to are never modified.
Compaction runs from ModernFix's constructor, during parallel mod construction, while Forge can be streaming the same lists in AutomaticEventSubscriber.inject to pick each subscriber's sides. ArrayList.trimToSize increments modCount even when nothing is removed, so an overlapping stream throws ConcurrentModificationException and mod loading fails. We hit this exception in that stream once, while loading a large pack.
Both builds are ModernFix 5.27.92+mc1.20.1 from the 1.20 head, on Minecraft 1.20.1. With a small test mod on Forge 47.4.28 that streams its own scan data and waits inside the stream until ModernFix has compacted it, the unchanged build threw in 3 of 3 starts and this change in 0 of 3, with the same elements and subscriber registrations. In Better MC 4's server files on Forge 47.4.20, both builds completed ten fresh starts and a saved world restart with identical subscriber registrations and no new errors; those ordinary starts did not hit the race.