RFR: 8340572: ConcurrentModificationException when sorting ArrayList sublists [v2]
Stuart Marks
smarks at openjdk.org
Fri Oct 4 19:00:44 UTC 2024
On Thu, 3 Oct 2024 19:31:06 GMT, Attila Szegedi <attila at openjdk.org> wrote:
>> Fixes a regression with #17818 where `ArrayList.subList(…).sort()` started incrementing `ArrayList.modCount` resulting in some cases throwing a `ConcurrentModificationException` where none was thrown before.
>>
>> This change keeps the optimization from #17818 but restores the behavior where only sorting the `ArrayList` changes the mod count, but sorting its sublists does not.
>
> Attila Szegedi has updated the pull request incrementally with one additional commit since the last revision:
>
> - Rename test to more descriptive
> - Add a test case for whole list sorting
Thanks for the updates! I've run these changes through our internal testing system and the results look good.
-------------
Marked as reviewed by smarks (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/21250#pullrequestreview-2348901655
More information about the core-libs-dev
mailing list