vigna / fastutil

fastutil extends the Java™ Collections Framework by providing type-specific maps, sets, lists and queues.
Apache License 2.0
1.81k stars 199 forks source link

ArrayList iterator back() bug fix, compute remaining correctly #314

Closed barakugav closed 9 months ago

barakugav commented 9 months ago

The current implementation of ArrayList.iterator().back(int n) compute the number of remaining elements wrongly. It compute size-pos, which is correct for the skip(int n) method, but wrong for the back(int n) method.

barakugav commented 9 months ago

Together with https://github.com/vigna/fastutil/pull/291, these bugs are kind of limiting the use of the lists. Is there a plan for a new release soon? @vigna

vigna commented 9 months ago

Good catch!

vigna commented 9 months ago

Just done 8.5.13! Should be on sonatype soon.

barakugav commented 9 months ago

Thanks!