diff options
author | Som Snytt <som.snytt@gmail.com> | 2014-11-14 11:16:06 -0800 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2014-12-06 21:29:51 -0800 |
commit | 6ba7068b9f0389812bb03eae88c31035ad73c1aa (patch) | |
tree | 6047a08b293e779d9d839b628bb19e2e2a632cc2 /test/files | |
parent | a1ee57da54eff4fe372e304fb5695941a70211c6 (diff) | |
download | scala-6ba7068b9f0389812bb03eae88c31035ad73c1aa.tar.gz scala-6ba7068b9f0389812bb03eae88c31035ad73c1aa.tar.bz2 scala-6ba7068b9f0389812bb03eae88c31035ad73c1aa.zip |
SI-8976 MutableList.tail.iterator.size is length
The previous behavior was to iterate over the mutated
list of arbitrary length. The previous iteration of
the iterator would also iterate the terminal element
of the list without halting.
This is fixed by capping the length of iterator.
That is OK because mutating the list by adding to it during
iteration is not recommended.
For good measure, the exhausted iterator does not hold
a reference to any remaining tail.
A test is added that will no doubt be superseded by the QCC tests.
(Quasi-Comprehensive Collections.)
The test just checks that the extra tail is not strongly
reachable from the iterator. If the garbage collector happens
to kick in and determine that the object is weakly reachable,
then the check terminates early.
Diffstat (limited to 'test/files')
0 files changed, 0 insertions, 0 deletions