This PR fixes the bug where list changes could be wrong (incorrect index). 
Nearly everything was already in place, but one usecase that had a minor flaw.

Fix is simple, the index we use for iterating must be adjusted in case we 
remove a change from `addRemoveChanges`.

All tests are green and I also added the Tests that were in the ticket. 
Adjusted to JUnit 5 and with a bit of explaination which helped me a lot to 
better understand the issue and fix it.

-------------

Commit messages:
 - JDK-8208758: ListChangeBuilder doesn't shift indices after idempotent change 
pairs

Changes: https://git.openjdk.org/jfx/pull/2117/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=2117&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8208758
  Stats: 177 lines in 2 files changed: 173 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jfx/pull/2117.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/2117/head:pull/2117

PR: https://git.openjdk.org/jfx/pull/2117

Reply via email to