Fix the ConcurrentModification test that fails in jdk9+

Modification registration seems to changed in Java 9. Now if the asked
capacity in `ensureCapacity` function is less than current capacity,
no modification is registered.
This commit is contained in:
Abduqodiri Qurbonzoda
2023-06-26 03:09:14 +03:00
committed by Space Team
parent ac0e493bac
commit bf1c9774aa
2 changed files with 1 additions and 3 deletions
@@ -167,8 +167,8 @@ actual class ArrayList<E> private constructor(
final actual fun ensureCapacity(minCapacity: Int) {
if (backingList != null) throw IllegalStateException() // just in case somebody casts subList to ArrayList
registerModification()
if (minCapacity <= backingArray.size) return
registerModification()
ensureCapacityInternal(minCapacity)
}